Is it possible to include statements with expressions with Groovy's conditional operator? This is what I'm doing now, and I want break this down in a single conditional statement with the println statements...
if(!expired){
println 'expired is null'
return true
}
else if( now.after(expired)){
println 'cache has expired'
return true
}
else
return false
Converted into single statement...
return (!expired) ? true : (now.after(expired)) ? true : false
...would like to do something like this for debugging purposes...
return (!expired) ? println 'expired is null' true : (now.after(expired)) ? println 'cache has expired' true : false
if
statements imo. – Hankow