Package com.pivovarit.function
Interface ThrowingBiConsumer<T,U,E extends java.lang.Exception>
-
- Type Parameters:
T
- the type of the first argument to the operationU
- the type of the second argument to the operationE
- 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 ofThrowingConsumer
. Unlike most other functional interfaces,ThrowingBiConsumer
is expected to operate via side-effects.- See Also:
ThrowingConsumer
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
accept(T t, U u)
default ThrowingBiConsumer<T,U,E>
andThenConsume(ThrowingBiConsumer<? super T,? super U,? extends E> after)
default ThrowingBiFunction<T,U,java.lang.Void,E>
asFunction()
Returns this ThrowingBiConsumer instance as a ThrowingBiFunctionstatic <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 patterndefault java.util.function.BiConsumer<T,U>
uncheck()
Returns a new BiConsumer instance which wraps thrown checked exception instance into a RuntimeExceptionstatic <T,U>
java.util.function.BiConsumer<T,U>unchecked(ThrowingBiConsumer<T,U,?> consumer)
-
-
-
Method Detail
-
accept
void accept(T t, U u) throws E extends java.lang.Exception
- Throws:
E extends java.lang.Exception
-
andThenConsume
default ThrowingBiConsumer<T,U,E> andThenConsume(ThrowingBiConsumer<? super T,? super U,? extends E> after)
-
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
-
-