Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Boolean expressions

Groovy supports the standard conditional operators on boolean expressions, e.g.:

In addition, Groovy has special rules for coercing non-boolean objects to a boolean value.

Collections

Empty collections are coerced to false.

Maps

Non-empty maps are coerced to true.

Matchers

Matching regex patterns are coerced to true.

h4, Strings

Non-empty Strings, GStrings and CharSequences are coerced to true.

Numbers

Non-zero numbers are coerced to true.

Object references

Non-null object references are coerced to true.

  • No labels