Interface DataMapperLibrary
public interface DataMapperLibrary
A DataMapperLibrary is an independently loadable library of data mapping functions.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanParseSpec(String spec) DataMapper Libraries are required to test specifier strings in order to determine whether or not the library could possibly find matching functions.default <T> Optional<DataMapper<T>> getDataMapper(String spec) Find the implementation for and construct an instance of a data mapper function, as described.default <T> DataMapper<T> getDataMapper(String spec, Class<? extends T> clazz) Get the list of known data mapping function names.default Optional<DataMapper<Double>> getDoubleDataMapper(String spec) default Optional<DataMapper<Integer>> getIntegerDataMapper(String spec) Return the name for this data mapper implementation, as it can be used in spec strings, etc.default Optional<DataMapper<Long>> getLongDataMapper(String spec) default <T> Optional<DataMapper<T>> getOptionalDataMapper(String spec, Class<? extends T> clazz) default Optional<DataMapper<String>> getStringDataMapper(String spec) resolveFunction(String spec) resolveFunctions(String specifier)
-
Method Details
-
getLibraryName
String getLibraryName()Return the name for this data mapper implementation, as it can be used in spec strings, etc.
- Returns:
- Simple lower-case canonical library name
-
getDataMapper
Find the implementation for and construct an instance of a data mapper function, as described.
- Type Parameters:
T- The result type produced by the data mapping function.- Parameters:
spec- A specifier that describes the type and or parameterization of a data mapping function instance.- Returns:
- An optional data mapping function instance
-
getOptionalDataMapper
-
getDataMapper
-
canParseSpec
DataMapper Libraries are required to test specifier strings in order to determine whether or not the library could possibly find matching functions. This allows varying types of specifiers to be used that are library specific, allowing an ad-hoc form of syntax layering.- Parameters:
spec- a data mapping function spec- Returns:
- a tagged Specifier option if successful
-
resolveFunction
-
resolveFunctions
- Parameters:
specifier- A specifier that describes the type and parameterization of a data mapping function instance. The type of specifier will be specific to your library implementation. You can use SpecData by default.- Returns:
- a list of function instances
-
getDataMapperNames
-
getLongDataMapper
-
getDoubleDataMapper
-
getIntegerDataMapper
-
getStringDataMapper
-