Groovy object properties in map

Viewed 19735

Instead of having to declare all the properties in a map from an object like:

prop1: object.prop1

Can't you just drop the object in there like below somehow? Or what would be a proper way to achieve this?

results: [
    object, 
    values: [
        test: 'subject'
    ]
]
3 Answers
Related