Class EnumPropertyValueMapping
java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstancePropertyValueMapping
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.EnumPropertyValueMapping
Maps singular EnumPropertyValues between persistence and objects.
These cannot simply be serialized to JSON as that would impact the ability to search their values correctly, so we
will serde and search based strictly on their ordinal values:
{
...
:instanceProvenanceType 1
:currentStatus 15
...
}
-
Field Summary
Fields inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
mapper, xtdbConnector
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic clojure.lang.IPersistentMap
addEnumPropertyValueToDoc
(clojure.lang.IPersistentMap doc, clojure.lang.Keyword propertyKeyword, EnumPropertyValue value) Add the provided enum value to the XTDB map.static void
addEnumPropertyValueToDoc
(xtdb.api.XtdbDocument.Builder builder, PropertyKeywords keywords, EnumPropertyValue value) Add the provided enum value to the XTDB document.static Integer
Convert the provided enumeration property value into a XTDB comparable form.static InstanceProvenanceType
Convert the provided ordinal into its InstanceProvenanceType.static InstanceProvenanceType
getInstanceProvenanceTypeFromOrdinal
(XTDBOMRSRepositoryConnector xtdbConnector, Integer ordinal) Convert the provided ordinal into its InstanceProvenanceType.static InstanceStatus
getInstanceStatusFromOrdinal
(Integer ordinal) Convert the provided ordinal into its InstanceStatus.static InstanceStatus
getInstanceStatusFromOrdinal
(XTDBOMRSRepositoryConnector xtdbConnector, Integer ordinal) Convert the provided ordinal into its InstanceStatus.static Integer
Convert the provided InstanceProvenanceType into its symbolic name.static Integer
Convert the provided InstanceStatus into its ordinal.Methods inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstancePropertyValueMapping
addInstancePropertyValueToDoc, getKeywordsForProperty, getValueForComparison, getValueForComparison
Methods inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
getDeserializedValue, getDeserializedValue, getEmbeddedSerializedForm, getEmbeddedSerializedForm, getKeyword, getKeyword
-
Constructor Details
-
EnumPropertyValueMapping
public EnumPropertyValueMapping()
-
-
Method Details
-
addEnumPropertyValueToDoc
public static void addEnumPropertyValueToDoc(xtdb.api.XtdbDocument.Builder builder, PropertyKeywords keywords, EnumPropertyValue value) Add the provided enum value to the XTDB document.- Parameters:
builder
- to which to add the property valuekeywords
- of the propertyvalue
- of the property
-
addEnumPropertyValueToDoc
public static clojure.lang.IPersistentMap addEnumPropertyValueToDoc(clojure.lang.IPersistentMap doc, clojure.lang.Keyword propertyKeyword, EnumPropertyValue value) Add the provided enum value to the XTDB map.- Parameters:
doc
- the XTDB map to which to add the propertypropertyKeyword
- the property whose value should be set, fully-qualified with namespace and type namevalue
- of the property- Returns:
- IPersistentMap of the updated XTDB doc
-
getEnumPropertyValueForComparison
Convert the provided enumeration property value into a XTDB comparable form.- Parameters:
epv
- Egeria value to translate to XTDB-comparable value- Returns:
- Integer value that XTDB can compare
-
getInstanceProvenanceTypeFromOrdinal
public static InstanceProvenanceType getInstanceProvenanceTypeFromOrdinal(XTDBOMRSRepositoryConnector xtdbConnector, Integer ordinal) Convert the provided ordinal into its InstanceProvenanceType.- Parameters:
xtdbConnector
- connectivity to the repositoryordinal
- to convert- Returns:
- InstanceProvenanceType
-
getInstanceProvenanceTypeFromOrdinal
public static InstanceProvenanceType getInstanceProvenanceTypeFromOrdinal(Integer ordinal) throws InvalidParameterException Convert the provided ordinal into its InstanceProvenanceType.- Parameters:
ordinal
- to convert- Returns:
- InstanceProvenanceType
- Throws:
InvalidParameterException
- if there is no such enumeration
-
getOrdinalForInstanceProvenanceType
Convert the provided InstanceProvenanceType into its symbolic name.- Parameters:
ipt
- to convert- Returns:
- Integer
-
getInstanceStatusFromOrdinal
public static InstanceStatus getInstanceStatusFromOrdinal(XTDBOMRSRepositoryConnector xtdbConnector, Integer ordinal) Convert the provided ordinal into its InstanceStatus.- Parameters:
xtdbConnector
- connectivity to the repositoryordinal
- to convert- Returns:
- InstanceStatus
-
getInstanceStatusFromOrdinal
public static InstanceStatus getInstanceStatusFromOrdinal(Integer ordinal) throws InvalidParameterException Convert the provided ordinal into its InstanceStatus.- Parameters:
ordinal
- to convert- Returns:
- InstanceStatus
- Throws:
InvalidParameterException
- if there is no such enumeration
-
getOrdinalForInstanceStatus
Convert the provided InstanceStatus into its ordinal.- Parameters:
is
- to convert- Returns:
- Integer
-