Class NamedMappingTransformer<T>
java.lang.Object
org.incenp.obofoundry.sssom.transform.NamedMappingTransformer<T>
- Type Parameters:
T
- The type of object to transform the mapping into.
- All Implemented Interfaces:
IMappingTransformer<T>
A mapping transformer that has a string representation. This class merely
wraps an existing transformer. It is mostly intended for debugging, so that
transformers created using lambda functions can still be displayed in a
readable form.
Example, for a transformer that produces basic string representations of mappings:
IMappingTransformer<String> myTransformer = new NamedMappingTransformer<String>("mapping-to-string", (mapping) -> String.format("%s -[%s]-> %s", mapping.getSubjectId(), mapping.getPredicateId(), mapping.getObjectId()));
-
Constructor Summary
ConstructorsConstructorDescriptionNamedMappingTransformer
(String name, IMappingTransformer<T> transformer) Creates a new instance. -
Method Summary
-
Constructor Details
-
NamedMappingTransformer
Creates a new instance.- Parameters:
name
- A string representation of the transformer.transformer
- The actual transformer.
-
-
Method Details
-
transform
Description copied from interface:IMappingTransformer
Transform a mapping into something else.- Specified by:
transform
in interfaceIMappingTransformer<T>
- Parameters:
mapping
- The mapping to transform.- Returns:
- The object generated from the mapping.
-
toString
-