Package io.virtdata.api.composers
Class FunctionAssembler
- java.lang.Object
-
- io.virtdata.api.composers.FunctionAssembler
-
public class FunctionAssembler extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFunctionAssembler.LongIdentity
-
Constructor Summary
Constructors Constructor Description FunctionAssembler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctionAssemblerandThen(java.lang.Object functionObject)FunctionAssemblerandThen(java.util.function.Function andThen)Allows for mapping generic functions into the composed lambda.FunctionAssemblerandThen(java.util.function.LongFunction andThen)Only valid after 0 or more LongUnaryOperators, but not after another LongFunction which isn't a LongFunction<Long>.FunctionAssemblerandThen(java.util.function.LongUnaryOperator andThen)Valid for any number of calls from the beginning of assembly.<T> DataMapper<T>getDataMapper()java.util.function.LongFunction<?>getFunction()
-
-
-
Method Detail
-
andThen
public FunctionAssembler andThen(java.lang.Object functionObject)
-
andThen
public FunctionAssembler andThen(java.util.function.LongUnaryOperator andThen)
Valid for any number of calls from the beginning of assembly.- Parameters:
andThen- a LongUnaryOperator- Returns:
- this FunctionAssemble
-
andThen
public FunctionAssembler andThen(java.util.function.LongFunction andThen)
Only valid after 0 or more LongUnaryOperators, but not after another LongFunction which isn't a LongFunction<Long>. Without explicit type annotations (type erasure doesn't help you for late binding), we will assume that multiple LongFunctions in sequence follow LongFunction<Long>s and cast or error if not.- Parameters:
andThen- a LongFunction- Returns:
- this FunctionAssembler
-
andThen
public FunctionAssembler andThen(java.util.function.Function andThen)
Allows for mapping generic functions into the composed lambda. This is not yet type safe, because type erasure.
If this is called after a LongFunction<?> has been added, then the types are presumed to match, and the lamda is coerced via casting.
- Parameters:
andThen- Function to add to the outer calling layer- Returns:
- this FunctionAssembler
-
getFunction
public java.util.function.LongFunction<?> getFunction()
-
getDataMapper
public <T> DataMapper<T> getDataMapper()
-
-