Class Closures.ConsumerClosure<T>

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

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

    • accept

      public void accept(T t)
      Specified by:
      accept in interface Consumer<T>
    • call

      public Void 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<Void>
      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 Void 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<Void>
      Returns:
      The value if applicable or null if there is no return statement in the closure.