Interface ChainFunction<SOURCE_TYPE,TARGET_TYPE>
-
- Type Parameters:
SOURCE_TYPE- the in-bound type of the functionTARGET_TYPE- the out-bound type of the function
- All Superinterfaces:
java.util.function.Function<SOURCE_TYPE,java.util.Optional<TARGET_TYPE>>
public interface ChainFunction<SOURCE_TYPE,TARGET_TYPE> extends java.util.function.Function<SOURCE_TYPE,java.util.Optional<TARGET_TYPE>>Represents a function that will delegate its returnedOptional-wrapped value to anotherChainFunctionif its own execution returns empty.This is functional interface whose functional method is
Function.apply(Object).- See Also:
Function
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default ChainFunction<SOURCE_TYPE,TARGET_TYPE>orElse(ChainFunction<SOURCE_TYPE,TARGET_TYPE> orElse)Enablement of the chaining of aChainFunctionby specifying the delegation to another candidate at the orElse phase.
-
-
-
Method Detail
-
orElse
default ChainFunction<SOURCE_TYPE,TARGET_TYPE> orElse(ChainFunction<SOURCE_TYPE,TARGET_TYPE> orElse)
Enablement of the chaining of aChainFunctionby specifying the delegation to another candidate at the orElse phase.- Parameters:
orElse- aChainFunction- Returns:
- the function's result if it succeeds, otherwise the result of the orElse function
-
-