Class VirtData
java.lang.Object
io.nosqlbench.virtdata.core.bindings.VirtData
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TgetFunction(String flowSpec, Class<? extends T> functionType) static <T> Tstatic <T> DataMapper<T> static <T> DataMapper<T> static <T> DataMapper<T> Instantiate a data mapping function of the specified type, or throw an error.static <T> DataMapper<T> Instantiate a data mapping function, or throw an exception.static ResolverDiagnosticsgetMapperDiagnostics(String flowSpec) static ResolverDiagnosticsgetMapperDiagnostics(String flowSpec, Map<String, Object> config) static <T> Optional<T> getOptionalFunction(String flowSpec, Class<? extends T> functionType) static <T> Optional<T> static <T> Optional<DataMapper<T>> getOptionalMapper(String flowSpec) static <T> Optional<DataMapper<T>> static <T> Optional<DataMapper<T>> getOptionalMapper(String flowSpec, Class<? extends T> clazz) Instantiate an optional data mapping function if possible, with type awareness.static <T> Optional<DataMapper<T>> getOptionalMapper(String flowSpec, Map<String, ?> config) Instantiate an optional data mapping function if possible.static BindingsTemplategetTemplate(String... namesAndSpecs) static BindingsTemplategetTemplate(Map<String, Object> config, String... namesAndSpecs) Create a bindings template from the pair-wise names and specifiers.static BindingsTemplateCreate a bindings template from a provided list ofBindPoints, ensuring that the syntax of the bindings specs is parsable first.
-
Constructor Details
-
VirtData
public VirtData()
-
-
Method Details
-
getTemplate
Create a bindings template from the pair-wise names and specifiers. Each even-numbered (starting with zero) argument is a binding name, and each odd-numbered (starting with one) argument is a binding spec.- Parameters:
namesAndSpecs- names and specs in "name", "spec", ... form- Returns:
- A bindings template that can be used to resolve a bindings instance
-
getTemplate
-
getTemplate
-
getOptionalMapper
Instantiate an optional data mapping function if possible.- Type Parameters:
T- The parameterized return type of the function- Parameters:
flowSpec- The VirtData specifier for the mapping functionconfig- A map of configuration objects- Returns:
- An optional function which will be empty if the function could not be resolved.
-
getOptionalMapper
-
getMapperDiagnostics
-
getMapperDiagnostics
-
getOptionalMapper
public static <T> Optional<DataMapper<T>> getOptionalMapper(String flowSpec, Class<? extends T> clazz) Instantiate an optional data mapping function if possible, with type awareness. This version ofgetOptionalMapper(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.- Type Parameters:
T- The parameterized return type of the function.- Parameters:
flowSpec- The VirtData specifier for the mapping functionclazz- The explicit class which must be of type T or assignable to type T- Returns:
- An optional function which will be empty if the function could not be resolved.
-
getOptionalMapper
-
getFunction
-
getFunction
-
getOptionalFunction
-
getOptionalFunction
-
getMapper
Instantiate a data mapping function, or throw an exception.- Type Parameters:
T- The parameterized return type of the function- Parameters:
flowSpec- The VirtData specifier for the mapping functionconfig- A map of configuration objects- Returns:
- A data mapping function
- Throws:
RuntimeException- if the function could not be resolved
-
getMapper
-
getMapper
public static <T> DataMapper<T> getMapper(String flowSpec, Class<? extends T> clazz, Map<String, Object> config) Instantiate a data mapping function of the specified type, or throw an error.- Type Parameters:
T- The parameterized class of the data mapping return type- Parameters:
flowSpec- The VirtData flow specifier for the function to be returnedclazz- The class of the data mapping function return typeconfig- A map of configuration objects- Returns:
- A new data mapping function.
- Throws:
RuntimeException- if the function could not be resolved
-
getMapper
-