java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
Direct Known Subclasses:
InstanceAuditHeaderMapping, InstancePropertyValueMapping

public abstract class AbstractMapping extends Object
General utilities for the mapping of any instance data.
  • Field Details

    • xtdbConnector

      protected final XTDBOMRSRepositoryConnector xtdbConnector
    • mapper

      protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
  • Constructor Details

    • AbstractMapping

      protected AbstractMapping()
      Default constructor.
    • AbstractMapping

      protected AbstractMapping(XTDBOMRSRepositoryConnector xtdbConnector)
      Default constructor.
      Parameters:
      xtdbConnector - connectivity to XTDB
  • Method Details

    • 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 repository
      type - name of the type into which the value is being serialized
      property - name of the property for which the value is being serialized
      value - 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 repository
      type - name of the type from which the value is being deserialized
      property - name of the property from which the value is being deserialized
      embedded - value to JSON-deserialize
      javaType - 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-deserialize
      javaType - the type of value to deserialize
      Returns:
      the deserialized value
      Throws:
      IOException - on any error deserializing the value