Class Composite<T>

  • All Implemented Interfaces:
    FragileProcedure<T,​java.lang.RuntimeException>, Procedure<T>

    public final class Composite<T>
    extends java.lang.Object
    implements Procedure<T>
    A Procedure composed of other procedures.

    Example

    
     new Composite(System.out::println, Logger::info).process("log message");
     
    Prints "log message" to the console and to the log.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void process​(T arg)
      Executes the procedure with the given argument.
      • Methods inherited from class java.lang.Object

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

      • Composite

        @SafeVarargs
        public Composite​(Procedure<? super T>... delegates)
      • Composite

        public Composite​(java.lang.Iterable<? extends Procedure<? super T>> delegates)
    • Method Detail

      • process

        public void process​(T arg)
        Description copied from interface: Procedure
        Executes the procedure with the given argument.
        Specified by:
        process in interface FragileProcedure<T,​java.lang.RuntimeException>
        Specified by:
        process in interface Procedure<T>