Class EntityDetailMapper<N extends Node>
java.lang.Object
org.odpi.openmetadata.accessservices.subjectarea.server.mappers.entities.EntityDetailMapper<N>
- All Implemented Interfaces:
INodeMapper<N>
,Mapper<EntityDetail,
N>
- Direct Known Subclasses:
CategoryMapper
,GlossaryMapper
,ProjectMapper
,TermMapper
This class provides a mapping between OMRS object EntityDetail and Subject Area OMAS object Node.
Sub-classes of Node are expected to provide a mapper that extends this class, to provide the mappings for the properties that
they support.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final OpenMetadataAPIGenericHandler
protected final OMRSRepositoryHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget the EntityTypeDef Guid This method should be overridden to provide the appropriate guid for the type.abstract String
Get the type nameprotected void
mapEntityDetailToNode
(N node, EntityDetail omrsEntityDetail) map the EntityDetail to the Nodeprotected boolean
mapEnumToNode
(N node, String propertyName, EnumPropertyValue enumPropertyValue) Map an omrs entityDetail enum property to a Subject Area Node property.protected boolean
mapMapToNode
(N node, String propertyName, MapPropertyValue mapPropertyValue) Map an omrs entityDetail map property to a Subject Area Node property.protected void
mapNodeToInstanceProperties
(N node, InstanceProperties instanceProperties) Map the supplied Node to omrs InstanceProperties.protected boolean
mapPrimitiveToNode
(N node, String propertyName, Object value) Map an omrs entityDetail primitive property to a Subject Area Node property.protected void
populateAdditionalProperties
(N node, InstanceProperties instanceProperties) protected String
removePropertyByNameFromInstanceProperties
(InstanceProperties instanceProperties, String propertyName) Extract and delete the qualifiedName property from the supplied instance properties.toEntityDetail
(N node) Map a Node (a Subject Area OMAS) concept to an EntityDetail (an OMRS concept) Note that this does not map the readonly flag to the provenance, the caller needs to handle this if required.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.odpi.openmetadata.accessservices.subjectarea.server.mappers.INodeMapper
map, map
-
Field Details
-
repositoryHelper
-
genericHandler
-
-
Constructor Details
-
EntityDetailMapper
-
-
Method Details
-
mapEntityDetailToNode
map the EntityDetail to the Node- Parameters:
node
- to be mapped to (the target of the map)omrsEntityDetail
- entityDetail to be mapped from (the source of the mapping)
-
removePropertyByNameFromInstanceProperties
protected String removePropertyByNameFromInstanceProperties(InstanceProperties instanceProperties, String propertyName) Extract and delete the qualifiedName property from the supplied instance properties.- Parameters:
instanceProperties
- properties from entitypropertyName
- name of the property to remove from the instanceProperties- Returns:
- string name or null
-
mapPrimitiveToNode
Map an omrs entityDetail primitive property to a Subject Area Node property. The child class is expected to override this method if the type has primitive properties- Parameters:
node
- the node to be updatedpropertyName
- the omrs property namevalue
- the omrs primitive property value- Returns:
- true if it was a property we were expecting , otherwise false;
-
mapEnumToNode
Map an omrs entityDetail enum property to a Subject Area Node property. The child class is expected to override this method if the type has enum properties- Parameters:
node
- the node to be updatedpropertyName
- the omrs property nameenumPropertyValue
- the omrs enum property value- Returns:
- true if it was a property we were expecting , otherwise false;
-
mapMapToNode
Map an omrs entityDetail map property to a Subject Area Node property. The child class is expected to override this method if the type has map properties- Parameters:
node
- the node to be updatedpropertyName
- the omrs property namemapPropertyValue
- the omrs map property value- Returns:
- true if it was a property we were expecting , otherwise false;
-
toEntityDetail
Map a Node (a Subject Area OMAS) concept to an EntityDetail (an OMRS concept) Note that this does not map the readonly flag to the provenance, the caller needs to handle this if required. Readonly flag is only for update / delete and restore processing can proceed, in these cases the omrs entity should be looked up first, so this mapping would not be called.- Parameters:
node
- supplied node, which is a Subject Area Concept- Returns:
- EntityDetail, which is an OMRS concept
-
getTypeName
Description copied from interface:Mapper
Get the type name- Specified by:
getTypeName
in interfaceMapper<EntityDetail,
N extends Node> - Returns:
- type name
-
getTypeDefGuid
get the EntityTypeDef Guid This method should be overridden to provide the appropriate guid for the type.- Specified by:
getTypeDefGuid
in interfaceMapper<EntityDetail,
N extends Node> - Returns:
- the guid of the entity typedef
-
populateAdditionalProperties
-
mapNodeToInstanceProperties
Map the supplied Node to omrs InstanceProperties. Subclasses are expected to override this method to provide logic to map their Node properties to instanceProperties- Parameters:
node
- supplied nodeinstanceProperties
- equivalent instance properties to the Node
-