Interface ThrowingBiConsumer<T,U,E extends 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 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:
  • Method Details

    • accept

      void accept(T t, U u) throws E
      Throws:
      E
    • andThenConsume

      default ThrowingBiConsumer<T,U,E> andThenConsume(ThrowingBiConsumer<? super T,? super U,? extends E> after)
    • asFunction

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

      static <T, U> BiConsumer<T,U> unchecked(ThrowingBiConsumer<T,U,?> consumer)
    • sneaky

      static <T, U> 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 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