Interface ThrowableFunction<T,R>
-
- Type Parameters:
T- the type of the input to the functionR- the type of the result of the function
- All Superinterfaces:
java.util.function.Function<T,R>
- All Known Subinterfaces:
ThrowableUnaryOperator<T>
- 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 ThrowableFunction<T,R> extends java.util.function.Function<T,R>Represents a function that accepts one argument and produces a result.Permits checked exceptions unlike
FunctionThis is a functional interface whose functional method is
apply(Object).
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Rapply(T t)Applies this function to the given argument.RapplyUnsafe(T t)Applies this function to the given argument.static <T> ThrowableFunction<T,T>identity()Returns a function that always returns its input argument.
-
-
-
Method Detail
-
applyUnsafe
R applyUnsafe(T t) throws java.lang.Throwable
Applies this function to the given argument.- Parameters:
t- the function argument- Returns:
- the function result
- Throws:
java.lang.Throwable- occurred during processing
-
apply
default R apply(T t)
Applies this function to the given argument.Has default implementation in order to make
Function.compose(Function)andFunction.andThen(Function)work.
-
identity
static <T> ThrowableFunction<T,T> identity()
Returns a function that always returns its input argument.- Type Parameters:
T- the type of the input and output objects to the function- Returns:
- a function that always returns its input argument
-
-