Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Invalid
-
None
-
None
-
None
Description
Currently I would have to write code like this (in the Groovy Console) to be safe:
def json = [ messages: [ [message: 'test'] ], errors: null ] [ *(json.messages ? json.messages*.message : []), *(json.errors ? json.errors*.message : []) ].join('\n')
I would like to request for an operator like ?*. so I can write something like this:
[
*(json.messages?*.message ?: []),
*(json.errors?*.message ?: [])
].join('\n')
Not sure if it can be simplified further, but that's the idea.