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

  • Type Parameters:
    T - the type of the first argument to the operation
    U - the type of the second argument to the operation
    E - the type of the thrown checked 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 ThrowingBiConsumer<T,​U,​E extends java.lang.Exception>
    Represents an operation that accepts two input arguments and returns no result. This is the two-arity specialization of ThrowingConsumer. Unlike most other functional interfaces, ThrowingBiConsumer is expected to operate via side-effects.
    See Also:
    ThrowingConsumer
    • Method Detail

      • accept

        void accept​(T t,
                    U u)
             throws E extends java.lang.Exception
        Throws:
        E extends java.lang.Exception
      • asFunction

        default ThrowingBiFunction<T,​U,​java.lang.Void,​E> asFunction()
        Returns this ThrowingBiConsumer instance as a ThrowingBiFunction
        Returns:
        this action as a ThrowingBiFunction
      • unchecked

        static <T,​U> java.util.function.BiConsumer<T,​U> unchecked​(ThrowingBiConsumer<T,​U,​?> consumer)
      • sneaky

        static <T,​U> java.util.function.BiConsumer<T,​U> sneaky​(ThrowingBiConsumer<T,​U,​?> consumer)
        Returns a new BiConsumer instance which rethrows the checked exception using the Sneaky Throws pattern
        Returns:
        BiConsumer instance that rethrows the checked exception using the Sneaky Throws pattern
      • uncheck

        default java.util.function.BiConsumer<T,​U> uncheck()
        Returns a new BiConsumer instance which wraps thrown checked exception instance into a RuntimeException
        Returns:
        BiConsumer instance that packages checked exceptions into RuntimeException instances