Package org.pipecraft.infra.concurrent
Interface FailableFunction<T,R,E extends Exception>
-
- Type Parameters:
T- The type of the inputR- The type of the outputE- The exception type
- 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 Exception>
A function that may fail with a checked exception during the execution of the apply(..) method.- Author:
- Eyal Schneider
-
-
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)Similar to Function.andThen(..), but works withFailableFunctionRapply(T v)Applies the functiondefault <V> FailableFunction<V,R,E>compose(FailableFunction<? super V,? extends T,E> before)Similar to Function.compose(..), but works withFailableFunctionstatic <T,E extends Exception>
FailableFunction<T,T,E>identity()Similar to Function.identity(), but returns aFailableFunction
-
-
-
Method Detail
-
compose
default <V> FailableFunction<V,R,E> compose(FailableFunction<? super V,? extends T,E> before)
Similar to Function.compose(..), but works withFailableFunction- Parameters:
before-- Returns:
-
andThen
default <V> FailableFunction<T,V,E> andThen(FailableFunction<? super R,? extends V,E> after)
Similar to Function.andThen(..), but works withFailableFunction- Parameters:
after-- Returns:
-
identity
static <T,E extends Exception> FailableFunction<T,T,E> identity()
Similar to Function.identity(), but returns aFailableFunction- Returns:
-
-