I know Groovy has the null check operator ?
, where you can do something like: params.name?
which will check if it's null, and return null. Is there a way to return the empty string instead of a null? Something like:
params.name? "" : params.name
When you're creating a new object and you're passing in a value for the class variables, like:
Foo myObj = new Foo(name : params.name? "" : params.name)