Interface ConsumerWithException<T,​E extends java.lang.Exception>

  • 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 ConsumerWithException<T,​E extends java.lang.Exception>
    An interface with an accept(Object) method that can propagate checked exceptions.
    Since:
    3.12
    Author:
    Eike Stepper
    • Method Detail

      • accept

        void accept​(T t)
             throws E extends java.lang.Exception
        Throws:
        E extends java.lang.Exception
      • consumer

        static <T,​E extends java.lang.Exception> java.util.function.Consumer<T> consumer​(ConsumerWithException<T,​E> consumerWithException,
                                                                                               java.lang.Class<E> exceptionClass,
                                                                                               java.util.function.Consumer<E> exceptionHandler)
      • consumer

        static <T,​E extends java.lang.Exception> java.util.function.Consumer<T> consumer​(ConsumerWithException<T,​E> consumerWithException)