Class ConsumerWithDelegate<T>

java.lang.Object
space.jasan.support.groovy.closure.ConsumerWithDelegate<T>
All Implemented Interfaces:
Consumer<T>

public class ConsumerWithDelegate<T> extends Object implements Consumer<T>
Utility for converting closure to consumer.
  • Method Details

    • create

      public static <T> Consumer<T> create(groovy.lang.Closure c, Object owner, int strategy)
      Create a consumer from a closure.
      Type Parameters:
      T - the parameter
      Parameters:
      c - the closure
      owner - the owner
      strategy - the strategy
      Returns:
      the consumer
    • create

      public static <T> Consumer<T> create(groovy.lang.Closure c, Object owner)
      Create a consumer from a closure.
      Type Parameters:
      T - the parameter
      Parameters:
      c - the closure
      owner - the owner
      Returns:
      the consumer
    • create

      public static <T> Consumer<T> create(groovy.lang.Closure c, int strategy)
      Create a consumer from a closure.
      Type Parameters:
      T - the parameter
      Parameters:
      c - the closure
      strategy - the strategy
      Returns:
      the consumer
    • create

      public static <T> Consumer<T> create(groovy.lang.Closure c)
      Create a consumer from a closure.
      Type Parameters:
      T - the parameter
      Parameters:
      c - the closure
      Returns:
      the consumer
    • accept

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