Guest User

Untitled

a guest
Sep 14th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.21 KB | None | 0 0
  1. Boolean.metaClass.ifTrue = { cl ->
  2.     if (this) cl()
  3. }
  4.  
  5. Boolean.metaClass.ifFalse = { cl ->
  6.     if (!this) cl()
  7. }
  8.  
  9.  
  10. (4 > 3).ifTrue {
  11.     println "asdf"  
  12. }
  13.  
  14. (1 > 5).ifFalse {
  15.     println "wasd"
  16. }
Add Comment
Please, Sign In to add comment