Package org.n52.janmayen.function
Interface ThrowingBiConsumer<A,B,X extends Exception>
-
- Type Parameters:
A- the type of the first argument to the operationB- the type of the second argument to the operationX- the type of the exception that might be thrown
- 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<A,B,X extends Exception>
Represents an operation that accepts two input arguments and returns no result. This is the two-arity specialization ofConsumer. Unlike most other functional interfaces,BiConsumeris expected to operate via side-effects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaccept(A t, B u)Performs this operation on the given arguments.default ThrowingBiConsumer<A,B,X>andThen(ThrowingBiConsumer<? super A,? super B,? extends X> after)Returns a composedBiConsumerthat performs, in sequence, this operation followed by theafteroperation.default ThrowingConsumer<B,X>curryFirst(A t)Get aThrowingConsumerby currying the first parameter.default ThrowingConsumer<A,X>currySecond(B u)GetThrowingConsumerby currying the second parameter.default <T> ThrowingBiConsumer<T,B,X>mapFirst(ThrowingFunction<? super T,? extends A,X> fun)Change the first parameter using the supplied mapper.default <T> ThrowingBiConsumer<A,T,X>mapSecond(ThrowingFunction<? super T,? extends B,X> fun)Change the second parameter using the supplied mapper.
-
-
-
Method Detail
-
accept
void accept(A t, B u) throws X extends Exception
Performs this operation on the given arguments.
-
andThen
default ThrowingBiConsumer<A,B,X> andThen(ThrowingBiConsumer<? super A,? super B,? extends X> after)
Returns a composedBiConsumerthat performs, in sequence, this operation followed by theafteroperation. If performing either operation throws an exception, it is relayed to the caller of the composed operation. If performing this operation throws an exception, theafteroperation will not be performed.- Parameters:
after- the operation to perform after this operation- Returns:
- a composed
BiConsumerthat performs in sequence this operation followed by theafteroperation - Throws:
NullPointerException- ifafteris null
-
curryFirst
default ThrowingConsumer<B,X> curryFirst(A t)
Get aThrowingConsumerby currying the first parameter.- Parameters:
t- the constant parameter- Returns:
- the consumer
-
currySecond
default ThrowingConsumer<A,X> currySecond(B u)
GetThrowingConsumerby currying the second parameter.- Parameters:
u- the constant parameter- Returns:
- the consumer
-
mapFirst
default <T> ThrowingBiConsumer<T,B,X> mapFirst(ThrowingFunction<? super T,? extends A,X> fun)
Change the first parameter using the supplied mapper.- Type Parameters:
T- the new type of the first parameter- Parameters:
fun- the mapper- Returns:
- the consumer
-
mapSecond
default <T> ThrowingBiConsumer<A,T,X> mapSecond(ThrowingFunction<? super T,? extends B,X> fun)
Change the second parameter using the supplied mapper.- Type Parameters:
T- the new type of the second parameter- Parameters:
fun- the mapper- Returns:
- the consumer
-
-