Class AbstractMapping
java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
- Direct Known Subclasses:
InstanceAuditHeaderMapping
,InstancePropertyValueMapping
General utilities for the mapping of any instance data.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final com.fasterxml.jackson.databind.ObjectMapper
protected final XTDBOMRSRepositoryConnector
-
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor.protected
AbstractMapping
(XTDBOMRSRepositoryConnector xtdbConnector) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static <T> T
getDeserializedValue
(clojure.lang.IPersistentMap embedded, com.fasterxml.jackson.databind.JavaType javaType) Retrieve the deserialized value given an embedded form.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.protected static clojure.lang.IPersistentMap
getEmbeddedSerializedForm
(Object value) Retrieve an embedded JSON-serialized form of a given object.protected static clojure.lang.IPersistentMap
getEmbeddedSerializedForm
(XTDBOMRSRepositoryConnector xtdbConnector, String type, String property, Object value) Retrieve an embedded JSON-serialized form of a given object.static String
getKeyword
(String name) Construct a string representation of a keyword.static String
getKeyword
(String namespace, String name) Construct a string representation of a keyword.
-
Field Details
-
xtdbConnector
-
mapper
protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Constructor Details
-
AbstractMapping
protected AbstractMapping()Default constructor. -
AbstractMapping
Default constructor.- Parameters:
xtdbConnector
- connectivity to XTDB
-
-
Method Details
-
getKeyword
Construct a string representation of a keyword.- Parameters:
name
- of the keyword- Returns:
- String representation of the form ':name'
-
getKeyword
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 IOException 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:
embedded
- value to JSON-deserializejavaType
- the type of value to deserialize- Returns:
- the deserialized value
- Throws:
IOException
- on any error deserializing the value
-