Interface FailableFunction<T,R,E extends java.lang.Throwable>
-
- Type Parameters:
T- Input type 1.R- Return type.E- Thrown 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 FailableFunction<T,R,E extends java.lang.Throwable>A functional interface likeFunctionthat declares aThrowable.- Since:
- 3.11
-
-
Field Summary
Fields Modifier and Type Field Description static FailableFunctionNOPNOP singleton
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <V> FailableFunction<T,V,E>andThen(FailableFunction<? super R,? extends V,E> after)Returns a composedFailableFunctionlikeFunction.andThen(Function).Rapply(T input)Applies this function.default <V> FailableFunction<V,R,E>compose(FailableFunction<? super V,? extends T,E> before)Returns a composedFailableFunctionlikeFunction.compose(Function).static <T,E extends java.lang.Throwable>
FailableFunction<T,T,E>identity()Returns a function that always returns its input argument.static <T,R,E extends java.lang.Throwable>
FailableFunction<T,R,E>nop()Returns The NOP singleton.
-
-
-
Field Detail
-
NOP
static final FailableFunction NOP
NOP singleton
-
-
Method Detail
-
identity
static <T,E extends java.lang.Throwable> FailableFunction<T,T,E> identity()
Returns a function that always returns its input argument.- Type Parameters:
T- the type of the input and output objects to the functionE- Thrown exception.- Returns:
- a function that always returns its input argument
-
nop
static <T,R,E extends java.lang.Throwable> FailableFunction<T,R,E> nop()
Returns The NOP singleton.- Type Parameters:
T- Consumed type 1.R- Return type.E- Thrown exception.- Returns:
- The NOP singleton.
-
andThen
default <V> FailableFunction<T,V,E> andThen(FailableFunction<? super R,? extends V,E> after)
Returns a composedFailableFunctionlikeFunction.andThen(Function).- Type Parameters:
V- the output type of theafterfunction, and of the composed function.- Parameters:
after- the operation to perform after this one.- Returns:
- a composed
FailableFunctionlikeFunction.andThen(Function). - Throws:
java.lang.NullPointerException- whenafteris null.
-
compose
default <V> FailableFunction<V,R,E> compose(FailableFunction<? super V,? extends T,E> before)
Returns a composedFailableFunctionlikeFunction.compose(Function).- Type Parameters:
V- the input type to thebeforefunction, and to the composed function.- Parameters:
before- the operator to apply before this one.- Returns:
- a a composed
FailableFunctionlikeFunction.compose(Function). - Throws:
java.lang.NullPointerException- if before is null.- See Also:
andThen(FailableFunction)
-
-