Created
November 15, 2016 02:35
-
-
Save ppazos/2543bac3a6561d80d6bf9b275fb9ca12 to your computer and use it in GitHub Desktop.
groovy check null and empty list, return somethig instead
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def nuli = null | |
def empi = [] | |
def algi = [1,2,3] | |
println nuli ?: empi | |
println nuli ?: algi | |
println empi ?: algi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment