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 passed through
Author:
Jakub Cechacek
  • Method Summary

    Modifier and Type
    Method
    Description
    default Commands<T,E>
    andThen(Commands<? super T,E> after)
    void
    Performs this operation on the given argument.
  • Method Details

    • execute

      void execute(T t) throws E
      Performs this operation on the given argument.
      Parameters:
      t - the input argument
      Throws:
      E - possibly thrown exception
    • 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