Class AbstractMapping
- java.lang.Object
-
- org.odpi.egeria.connectors.juxt.xtdb.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 static com.fasterxml.jackson.databind.ObjectMappermapperprotected XtdbOMRSRepositoryConnectorxtdbConnector
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMapping()Default constructor.protectedAbstractMapping(XtdbOMRSRepositoryConnector xtdbConnector)Default constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static <T> TgetDeserializedValue(clojure.lang.IPersistentMap embedded, com.fasterxml.jackson.databind.JavaType javaType)Retrieve the deserialized value given an embedded form.protected static <T> TgetDeserializedValue(XtdbOMRSRepositoryConnector xtdbConnector, 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(Object value)Retrieve an embedded JSON-serialized form of a given object.protected static clojure.lang.IPersistentMapgetEmbeddedSerializedForm(XtdbOMRSRepositoryConnector xtdbConnector, 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
-
xtdbConnector
protected final XtdbOMRSRepositoryConnector xtdbConnector
-
mapper
protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Constructor Detail
-
AbstractMapping
protected AbstractMapping()
Default constructor.
-
AbstractMapping
protected AbstractMapping(XtdbOMRSRepositoryConnector xtdbConnector)
Default constructor.- Parameters:
xtdbConnector- connectivity to XTDB
-
-
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(XtdbOMRSRepositoryConnector xtdbConnector, 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:
xtdbConnector- 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
-
getEmbeddedSerializedForm
protected static clojure.lang.IPersistentMap getEmbeddedSerializedForm(Object value) throws IOException
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:
value- to JSON-serialize- Returns:
- IPersistentMap giving the embedded serialized form
- Throws:
IOException- on any issue serializing the value
-
getDeserializedValue
protected static <T> T getDeserializedValue(XtdbOMRSRepositoryConnector xtdbConnector, 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:
xtdbConnector- 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
-
getDeserializedValue
protected static <T> T getDeserializedValue(clojure.lang.IPersistentMap embedded, com.fasterxml.jackson.databind.JavaType javaType) throws IOExceptionRetrieve 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:
embedded- value to JSON-deserializejavaType- the type of value to deserialize- Returns:
- the deserialized value
- Throws:
IOException- on any error deserializing the value
-
-