Class Closures.PredicateClosure<T>

java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.Closure<Boolean>
org.apache.groovy.util.Closures.PredicateClosure<T>
All Implemented Interfaces:
GroovyCallable<Boolean>, GroovyObject, Serializable, Cloneable, Runnable, Callable<Boolean>, Predicate<T>
Enclosing class:
Closures

public static class Closures.PredicateClosure<T> extends Closure<Boolean> implements Predicate<T>
Hybrid one-argument function that is both a Closure and a Predicate.
Since:
6.0.0
See Also:
  • Method Details

    • test

      public boolean test(T t)
      Specified by:
      test in interface Predicate<T>
    • call

      public Boolean call(Object arg)
      Description copied from class: Closure
      Invokes the closure with given argument(s), returning any value if applicable.
      Overrides:
      call in class Closure<Boolean>
      Parameters:
      arg - could be a single value or a List of values
      Returns:
      The value if applicable or null if there is no return statement in the closure.
    • call

      public Boolean call(Object... args)
      Description copied from class: Closure
      Invokes the closure with given argument(s), returning any value if applicable.
      Overrides:
      call in class Closure<Boolean>
      Returns:
      The value if applicable or null if there is no return statement in the closure.