Class AbstractMapping
- java.lang.Object
-
- org.odpi.egeria.connectors.juxt.crux.mapping.AbstractMapping
-
- Direct Known Subclasses:
InstanceAuditHeaderMapping,InstancePropertyValueMapping
public abstract class AbstractMapping extends Object
General utilities for the mapping of any instance data.
-
-
Field Summary
Fields Modifier and Type Field Description protected CruxOMRSRepositoryConnectorcruxConnectorprotected static com.fasterxml.jackson.databind.ObjectMappermapper
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMapping(CruxOMRSRepositoryConnector cruxConnector)Default constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static <T> TgetDeserializedValue(CruxOMRSRepositoryConnector cruxConnector, String type, String property, clojure.lang.IPersistentMap embedded, com.fasterxml.jackson.databind.JavaType javaType)Retrieve the deserialized value given an embedded form.protected static clojure.lang.IPersistentMapgetEmbeddedSerializedForm(CruxOMRSRepositoryConnector cruxConnector, String type, String property, Object value)Retrieve an embedded JSON-serialized form of a given object.static StringgetKeyword(String name)Construct a string representation of a keyword.static StringgetKeyword(String namespace, String name)Construct a string representation of a keyword.
-
-
-
Field Detail
-
cruxConnector
protected final CruxOMRSRepositoryConnector cruxConnector
-
mapper
protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Constructor Detail
-
AbstractMapping
protected AbstractMapping(CruxOMRSRepositoryConnector cruxConnector)
Default constructor.- Parameters:
cruxConnector- connectivity to Crux
-
-
Method Detail
-
getKeyword
public static String getKeyword(String name)
Construct a string representation of a keyword.- Parameters:
name- of the keyword- Returns:
- String representation of the form ':name'
-
getKeyword
public static String getKeyword(String namespace, String name)
Construct a string representation of a keyword.- Parameters:
namespace- of the keyword (optional)name- of the keyword- Returns:
- String representation of the form ':namespace/name'
-
getEmbeddedSerializedForm
protected static clojure.lang.IPersistentMap getEmbeddedSerializedForm(CruxOMRSRepositoryConnector cruxConnector, String type, String property, Object value)
Retrieve an embedded JSON-serialized form of a given object. This will prevent the object from being searchable, but provides an efficient means to store structured information.- Parameters:
cruxConnector- connectivity to the repositorytype- name of the type into which the value is being serializedproperty- name of the property for which the value is being serializedvalue- to JSON-serialize- Returns:
- IPersistentMap giving the embedded serialized form
-
getDeserializedValue
protected static <T> T getDeserializedValue(CruxOMRSRepositoryConnector cruxConnector, String type, String property, clojure.lang.IPersistentMap embedded, com.fasterxml.jackson.databind.JavaType javaType)
Retrieve the deserialized value given an embedded form. This will prevent the object from being searchable, but provides an efficient means to retrieve structured information.- Type Parameters:
T- type of value to deserialize- Parameters:
cruxConnector- connectivity to the repositorytype- name of the type from which the value is being deserializedproperty- name of the property from which the value is being deserializedembedded- value to JSON-deserializejavaType- the type of value to deserialize- Returns:
- the deserialized value
-
-