public class VirtDataComposer extends Object
This library implements the ability to compose a lambda function from a sequence of other functions. The resulting lambda will use the specialized primitive function interfaces, such as LongUnaryOperator, LongFunction, etc. Where there are two functions which do not have matching input and output types, the most obvious conversion is made. This means that while you are able to compose a LongUnaryOperator with a LongUnaryOperator for maximum efficiency, you can also compose LongUnaryOperator with an IntFunction, and a best effort attempt will be made to do a reasonable conversion in between.
Due to type erasure, it is not possible to know the generic type parameters for non-primitive functional types. These include IntFunction<?>, LongFunction<?>, and in the worst case, Function<?,?>. For these types, annotations are provided to better inform the runtime lambda compositor.
The library allows for there to be multiple functions which match the spec, possibly because multiple functions have the same name, but exist in different libraries or in different packages within the same library. This means that the composer library must find a connecting path between the functions that can match at each stage, disregarding all but one.
The rule for finding the best path among the available functions is as follows, at each pairing between adjacent stages of functions:
ValueType| Constructor and Description |
|---|
VirtDataComposer() |
VirtDataComposer(VirtDataFunctionLibrary functionLibrary) |
| Modifier and Type | Method and Description |
|---|---|
Optional<ResolvedFunction> |
resolveFunctionFlow(String flowspec) |
Optional<ResolvedFunction> |
resolveFunctionFlow(VirtDataFlow flow) |
public VirtDataComposer(VirtDataFunctionLibrary functionLibrary)
public VirtDataComposer()
public Optional<ResolvedFunction> resolveFunctionFlow(String flowspec)
public Optional<ResolvedFunction> resolveFunctionFlow(VirtDataFlow flow)
Copyright © 2018. All rights reserved.