Interface ThrowingFunction<T,R,E extends java.lang.Throwable>
-
- Type Parameters:
T- the type of argument passed to the functionR- the type of results returned by the functionE- the type of exception that the function throws
- 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 ThrowingFunction<T,R,E extends java.lang.Throwable>The same asFunction, but the lambda expression throws anEchecked exception.This is a functional interface whose functional method is
apply(Object)- Since:
- v0.1.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Rapply(T t)Applies this function to the given argument, or throws an exception.static <T,E extends java.lang.Throwable>
ThrowingFunction<T,T,E>identity()Returns a function that always returns its input argument.
-
-
-
Method Detail
-
apply
R apply(T t) throws E extends java.lang.Throwable
Applies this function to the given argument, or throws an exception.
-
identity
static <T,E extends java.lang.Throwable> ThrowingFunction<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- the type of exception that the function throws- Returns:
- a function that always returns its input argument
-
-