Package io.fluxcapacitor.common
Interface ThrowingBiFunction<T,U,R>
- Type Parameters:
T
- the type of the first argument to the functionU
- the type of the second argument to the functionR
- the type of the result of the function
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Variant of
BiFunction
whose apply(Object, Object)
method is allowed to
throw a checked Exception
.
It can be used in place of a standard BiFunction
when the operation may fail with a checked exception.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <V> ThrowingBiFunction
<T, U, V> andThen
(@NonNull ThrowingFunction<? super R, ? extends V> after) Returns a composed function that first applies this function to its input, and then applies theafter
function to the result.Applies this function to the given arguments.
-
Method Details
-
apply
Applies this function to the given arguments.- Parameters:
t
- the first function argumentu
- the second function argument- Returns:
- the function result
- Throws:
Exception
- if unable to compute a result
-
andThen
default <V> ThrowingBiFunction<T,U, andThenV> (@NonNull @NonNull ThrowingFunction<? super R, ? extends V> after) Returns a composed function that first applies this function to its input, and then applies theafter
function to the result.- Type Parameters:
V
- the type of output of theafter
function, and of the composed function- Parameters:
after
- the function to apply after this function- Returns:
- a composed function that first applies this function and then the
after
function
-