Interface FailableBiConsumer<A,​B,​E extends Exception>

  • Type Parameters:
    A - The type of the first argument being consumed
    B - The type of the second argument being consumed
    E - The exception type
    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 FailableBiConsumer<A,​B,​E extends Exception>
    A bi-consumer that may fail with a checked exception during the execution of the accept(..) method.
    Author:
    Eyal Schneider
    • Method Detail

      • accept

        void accept​(A a,
                    B b)
             throws E extends Exception
        Performs this operation on the given arguments.
        Parameters:
        a - argument #1
        b - argument #2
        Throws:
        E extends Exception
      • fromBiConsumer

        static <X,​Y,​E extends ExceptionFailableBiConsumer<X,​Y,​E> fromBiConsumer​(BiConsumer<X,​Y> biConsumer)
        Utility method for wrapping a bi-consumer with a failable bi-consumer
        Parameters:
        biConsumer - The bi-consumer to wrap
        Returns:
        The failable bi-consumer (which effectively never throws checked exceptions)