Groovy Documentation

org.grules.functions.lib
[Groovy] Class CommonFunctions

java.lang.Object
  org.grules.functions.lib.CommonFunctions

@Functions
class CommonFunctions

Standard grules converters and validators.


Method Summary
boolean areIn(java.util.List values, java.util.List list)

Checks that all values are members of the list.

boolean areIn(java.util.List values, java.util.Set list)

Checks that all values are members of the set.

java.util.List collect(java.util.List values, groovy.lang.Closure closure)

Iterates through this aggregate Object transforming each item into a new value using the transform closure, returning a list of transformed values.

java.lang.String decimalFormat(java.lang.Double value, java.lang.String pattern)

@see java.text.NumberFormat#format(double)

java.lang.String decimalFormat(java.lang.Long value, java.lang.String pattern)

@see java.text.NumberFormat#format(long)

boolean eq(java.lang.Object value, java.lang.Object object)

@see isEqual

java.lang.Boolean inverse(java.lang.Boolean value)

Returns an opposite value wrapped into ConverterBooleanResult: true for false and false for true.

boolean isAny(java.util.List values)

Checks that at least one member is true according to the Groovy Truth

boolean isAny(java.util.List values, groovy.lang.Closure validator)

Checks that at least one member is valid according to the predicate.

boolean isEmpty(java.util.List values)

Checks that the list contains no members.

boolean isEmpty(java.lang.String value)

Checks that the string matches \/\s*\/.

boolean isEqual(java.lang.Object value, java.lang.Object object)

Checks that a value is equal to the specified object.

boolean isEvery(java.util.List values, groovy.lang.Closure validator)

Checks that all list members are valid according to the predicate.

boolean isEvery(java.util.List values)

Checks that all list members are true according to the Groovy Truth.

boolean isFalse(java.lang.Object value)

Checks that a value coerces to boolean false.

boolean isIn(java.lang.Object value, java.util.List list)

Checks that a value is equal to any member of the specified list.

boolean isIn(java.lang.Object value, java.util.Set set)

Checks that a value is equal to any member of the specified set.

boolean isTrue(java.lang.Object value)

Checks that a value coerces to boolean true.

java.lang.Object join(java.util.Collection values, java.lang.String separator)

@see DefaultGroovyMethods#join(java.util.Collection, String)

java.lang.Object nop(java.lang.Object value)

Returns the passed value. s

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

areIn

boolean areIn(java.util.List values, java.util.List list)
Checks that all values are members of the list.


areIn

boolean areIn(java.util.List values, java.util.Set list)
Checks that all values are members of the set.


collect

java.util.List collect(java.util.List values, groovy.lang.Closure closure)
Iterates through this aggregate Object transforming each item into a new value using the transform closure, returning a list of transformed values.
See Also:
org.codehaus.groovy.runtime.DefaultGroovyMethods#collect(java.util.Collection, groovy.lang.Closure)


decimalFormat

java.lang.String decimalFormat(java.lang.Double value, java.lang.String pattern)
See Also:
java.text.NumberFormat#format(double)


decimalFormat

java.lang.String decimalFormat(java.lang.Long value, java.lang.String pattern)
See Also:
java.text.NumberFormat#format(long)


eq

boolean eq(java.lang.Object value, java.lang.Object object)
See Also:
isEqual


inverse

@Converter
java.lang.Boolean inverse(java.lang.Boolean value)
Returns an opposite value wrapped into ConverterBooleanResult: true for false and false for true.


isAny

boolean isAny(java.util.List values)
Checks that at least one member is true according to the Groovy Truth


isAny

boolean isAny(java.util.List values, groovy.lang.Closure validator)
Checks that at least one member is valid according to the predicate.


isEmpty

boolean isEmpty(java.util.List values)
Checks that the list contains no members.


isEmpty

boolean isEmpty(java.lang.String value)
Checks that the string matches \/\s*\/.


isEqual

boolean isEqual(java.lang.Object value, java.lang.Object object)
Checks that a value is equal to the specified object.


isEvery

boolean isEvery(java.util.List values, groovy.lang.Closure validator)
Checks that all list members are valid according to the predicate.


isEvery

boolean isEvery(java.util.List values)
Checks that all list members are true according to the Groovy Truth.


isFalse

boolean isFalse(java.lang.Object value)
Checks that a value coerces to boolean false.


isIn

boolean isIn(java.lang.Object value, java.util.List list)
Checks that a value is equal to any member of the specified list.


isIn

boolean isIn(java.lang.Object value, java.util.Set set)
Checks that a value is equal to any member of the specified set.


isTrue

boolean isTrue(java.lang.Object value)
Checks that a value coerces to boolean true.


join

java.lang.Object join(java.util.Collection values, java.lang.String separator)
See Also:
DefaultGroovyMethods#join(java.util.Collection, String)


nop

java.lang.Object nop(java.lang.Object value)
Returns the passed value. s


 

Groovy Documentation