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:
Function<T,
R>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents a function that accepts one argument and produces a result.
Permits checked exceptions unlike Function
This is a functional interface whose functional method is
apply(Object)
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault R
Applies this function to the given argument.applyUnsafe
(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 Details
-
applyUnsafe
Applies this function to the given argument.- Parameters:
t
- the function argument- Returns:
- the function result
- Throws:
Throwable
- occurred during processing
-
apply
Applies this function to the given argument.Has default implementation in order to make
Function.compose(Function)
andFunction.andThen(Function)
work. -
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
-