public class VirtData extends Object
| Constructor and Description |
|---|
VirtData() |
| Modifier and Type | Method and Description |
|---|---|
static <T> DataMapper<T> |
getMapper(String flowSpec)
Instantiate a data mapping function, or throw an exception.
|
static <T> DataMapper<T> |
getMapper(String flowSpec,
Class<? extends T> clazz)
Instantiate a data mapping function of the specified type, or throw an error.
|
static <T> Optional<DataMapper<T>> |
getOptionalMapper(String flowSpec)
Instantiate an optional data mapping function if possible.
|
static <T> Optional<DataMapper<T>> |
getOptionalMapper(String flowSpec,
Class<? extends T> clazz)
Instantiate an optional data mapping function if possible, with type awareness.
|
static BindingsTemplate |
getTemplate(Map<String,String> namedBindings)
Create a bindings template from the provided map, ensuring that
the syntax of the bindings specs is parsable first.
|
static BindingsTemplate |
getTemplate(String... namesAndSpecs)
Create a bindings template from the pair-wise names and specifiers.
|
public static BindingsTemplate getTemplate(String... namesAndSpecs)
namesAndSpecs - names and specs in "name", "spec", ... formpublic static BindingsTemplate getTemplate(Map<String,String> namedBindings)
namedBindings - The named bindings mappublic static <T> Optional<DataMapper<T>> getOptionalMapper(String flowSpec)
T - The parameterized return type of the functionflowSpec - The VirtData specifier for the mapping functionpublic static <T> Optional<DataMapper<T>> getOptionalMapper(String flowSpec, Class<? extends T> clazz)
getOptionalMapper(String) will use the additional type information in the clazz
parameter to automatically parameterize the flow specifier.
If the flow specifier does contain
an output type qualifier already, then a check is made to ensure that the output type qualifier is
assignable to the specified class in the clazz parameter. This ensures that type parameter awareness
at compile time is honored and verified when this call is made.T - The parameterized return type of the function.flowSpec - The VirtData specifier for the mapping functionclazz - The explicit class which must be of type T or assignable to type Tpublic static <T> DataMapper<T> getMapper(String flowSpec)
T - The parameterized return type of the functionflowSpec - The VirtData specifier for the mapping functionRuntimeException - if the function could not be resolvedpublic static <T> DataMapper<T> getMapper(String flowSpec, Class<? extends T> clazz)
T - The parameterized class of the data mapping return typeflowSpec - The VirtData flow specifier for the function to be returnedclazz - The class of the data mapping function return typeRuntimeException - if the function could not be resolvedCopyright © 2018. All rights reserved.