I am using groovy compiler 2.4 I get a java.util.LinkedHashMap
containing all the properties and their values returned by calling getProperties()
on a groovy object.
class PropertyDemoClass {
int firstProperty = 1;
String secondProperty = "rhubarb"
String thirdProperty = "custard"
}
PropertyDemoClass demoClass = new PropertyDemoClass()
println demoClass.getProperties().toString()
which results in:
[firstProperty:1, secondProperty:rhubarb, class:class PropertyDemoClass, thirdProperty:custard]