Class EnumPropertyValueMapping
- java.lang.Object
-
- org.odpi.egeria.connectors.juxt.xtdb.mapping.AbstractMapping
-
- org.odpi.egeria.connectors.juxt.xtdb.mapping.InstancePropertyValueMapping
-
- org.odpi.egeria.connectors.juxt.xtdb.mapping.EnumPropertyValueMapping
-
public class EnumPropertyValueMapping extends InstancePropertyValueMapping
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.egeria.connectors.juxt.xtdb.mapping.AbstractMapping
mapper, xtdbConnector
-
-
Constructor Summary
Constructors Constructor Description EnumPropertyValueMapping()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static clojure.lang.IPersistentMapaddEnumPropertyValueToDoc(clojure.lang.IPersistentMap doc, clojure.lang.Keyword propertyKeyword, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue value)Add the provided enum value to the XTDB map.static voidaddEnumPropertyValueToDoc(xtdb.api.XtdbDocument.Builder builder, PropertyKeywords keywords, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue value)Add the provided enum value to the XTDB document.static IntegergetEnumPropertyValueForComparison(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue epv)Convert the provided enumeration property value into a XTDB comparable form.static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceTypegetInstanceProvenanceTypeFromOrdinal(Integer ordinal)Convert the provided ordinal into its InstanceProvenanceType.static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceTypegetInstanceProvenanceTypeFromOrdinal(XtdbOMRSRepositoryConnector xtdbConnector, Integer ordinal)Convert the provided ordinal into its InstanceProvenanceType.static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatusgetInstanceStatusFromOrdinal(Integer ordinal)Convert the provided ordinal into its InstanceStatus.static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatusgetInstanceStatusFromOrdinal(XtdbOMRSRepositoryConnector xtdbConnector, Integer ordinal)Convert the provided ordinal into its InstanceStatus.static IntegergetOrdinalForInstanceProvenanceType(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceType ipt)Convert the provided InstanceProvenanceType into its symbolic name.static IntegergetOrdinalForInstanceStatus(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus is)Convert the provided InstanceStatus into its ordinal.-
Methods inherited from class org.odpi.egeria.connectors.juxt.xtdb.mapping.InstancePropertyValueMapping
addInstancePropertyValueToDoc, getKeywordsForProperty, getValueForComparison, getValueForComparison
-
Methods inherited from class org.odpi.egeria.connectors.juxt.xtdb.mapping.AbstractMapping
getDeserializedValue, getDeserializedValue, getEmbeddedSerializedForm, getEmbeddedSerializedForm, getKeyword, getKeyword
-
-
-
-
Method Detail
-
addEnumPropertyValueToDoc
public static void addEnumPropertyValueToDoc(xtdb.api.XtdbDocument.Builder builder, PropertyKeywords keywords, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.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, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.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
public static Integer getEnumPropertyValueForComparison(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue epv)
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 org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.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 org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceType getInstanceProvenanceTypeFromOrdinal(Integer ordinal) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException
Convert the provided ordinal into its InstanceProvenanceType.- Parameters:
ordinal- to convert- Returns:
- InstanceProvenanceType
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- if there is no such enumeration
-
getOrdinalForInstanceProvenanceType
public static Integer getOrdinalForInstanceProvenanceType(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceType ipt)
Convert the provided InstanceProvenanceType into its symbolic name.- Parameters:
ipt- to convert- Returns:
- Integer
-
getInstanceStatusFromOrdinal
public static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.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 org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus getInstanceStatusFromOrdinal(Integer ordinal) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException
Convert the provided ordinal into its InstanceStatus.- Parameters:
ordinal- to convert- Returns:
- InstanceStatus
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- if there is no such enumeration
-
getOrdinalForInstanceStatus
public static Integer getOrdinalForInstanceStatus(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus is)
Convert the provided InstanceStatus into its ordinal.- Parameters:
is- to convert- Returns:
- Integer
-
-