Interface FailableConsumer<T,E extends Exception>

Type Parameters:
T - the type of results supplied by this supplier
E - the type of the exception thrown by the supplier
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 FailableConsumer<T,E extends Exception>
Represents a consumer of arguments which can throw exceptions.
Since:
4.1.19
  • Method Details

    • accept

      void accept(T t) throws E
      Performs this operation on the given argument.
      Parameters:
      t - the input argument
      Throws:
      E
    • wrapper

      static <T, E extends Exception> Consumer<T> wrapper(FailableConsumer<T,E> consumer)
      Wrapper responsible for converting a certain FailableConsumer into a Consumer.
      Type Parameters:
      T - the type of results supplied by this consumer
      E - the type of the exception thrown by the consumer
      Parameters:
      consumer - The consumer function to be converted.
      Returns:
      The build Supplier.