General functions
The following table describes the general functions.
Function | Description |
---|---|
isEmpty (value) | Checks whether the value is empty, null, or doesn't contain any element. |
isNotEmpty (value) | Checks whether the value isn't empty. |
isEqual (value1, value2) | Checks whether the first value is the same as the second value. |
isNotEqual (value1, value2) | Checks whether the value isn't the same as the second value. |
isIn (value, Collection) | Checks whether the value is part of a collection. |
areIn (Collection values, Collection collection) | Checks whether the collection is part of another collection. |
isAny (Collection, Closure) | Checks whether any value in a collection meets the criteria of a validation closure. |
isEvery (Collection, Closure) | Checks whether all values in a collection meet the criteria of a validation closure. |
isFalse (value) |
Checks whether the value is false, empty, or null according to the Groovy truth. Examples:
|
isTrue (value) |
Checks whether the value is true, empty, or null according to the Groovy truth. Examples:
|
isUnique (Collection, Closure) |
Checks whether all values in a collection are unique. Examples:
The closure
|
validate (value) |
Checks whether the value is a valid function, accepting any closure that is capable of returning true or false. validate (value) is a general validation function used to check another function. |