Class Consumers


  • public final class Consumers
    extends java.lang.Object
    Helper methods for the Consumer facade.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> Consumer<T> from​(java.lang.Object delegate)  
      static <T> java.lang.Object from​(Consumer<T> delegate)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • from

        public static <T> Consumer<T> from​(java.lang.Object delegate)
        Parameters:
        delegate - Must be a java.util.Consumer
        Returns:
        A Consumer that forwards all invocations of Consumer.accept(Object) to the delegate
      • from

        public static <T> java.lang.Object from​(Consumer<T> delegate)
        Returns:
        A java.util.Consumer that forwards all invocations of accept(T) to the delegate.