Interface Commands<T,​E extends Throwable>

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface Commands<T,​E extends Throwable>
    An adaptation of Consumer which allows for exceptions to pass through
    Author:
    Jakub Cechacek
    • Method Detail

      • execute

        void execute​(T t)
              throws E extends Throwable
        Performs this operation on the given argument.
        Parameters:
        t - the input argument
        Throws:
        E - possibly thrown exception
        E extends Throwable
      • andThen

        default Commands<T,​E> andThen​(Commands<? super T,​E> after)
        Parameters:
        after - the operation to perform after this operation
        Returns:
        a composed Consumer that performs in sequence this operation followed by the after operation
        Throws:
        NullPointerException - if after is null