Interface BiConsumerWithException<T,​U,​E extends Throwable>

  • Type Parameters:
    T - type of the first argument
    U - type of the second argument
    E - type of the thrown 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 BiConsumerWithException<T,​U,​E extends Throwable>
    A checked extension of the BiConsumer interface.
    • Method Detail

      • accept

        void accept​(T t,
                    U u)
             throws E extends Throwable
        Performs this operation on the given arguments.
        Parameters:
        t - the first input argument
        u - the second input argument
        Throws:
        E - in case of an error
        E extends Throwable
      • unchecked

        static <A,​B> java.util.function.BiConsumer<A,​B> unchecked​(BiConsumerWithException<A,​B,​?> biConsumerWithException)
        Convert a BiConsumerWithException into a BiConsumer.
        Type Parameters:
        A - first input type
        B - second input type
        Parameters:
        biConsumerWithException - BiConsumer with exception to convert into a BiConsumer.
        Returns:
        BiConsumer which rethrows all checked exceptions as unchecked.