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
public abstract class EntityDetailMapper<N extends Node> extends Object implements INodeMapper<N>
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
Fields Modifier and Type Field Description protected OpenMetadataAPIGenericHandlergenericHandlerprotected OMRSRepositoryHelperrepositoryHelper
-
Constructor Summary
Constructors Constructor Description EntityDetailMapper(OpenMetadataAPIGenericHandler genericHandler)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetTypeDefGuid()get the EntityTypeDef Guid This method should be overridden to provide the appropriate guid for the type.abstract StringgetTypeName()Get the type nameprotected voidmapEntityDetailToNode(N node, EntityDetail omrsEntityDetail)map the EntityDetail to the Nodeprotected booleanmapEnumToNode(N node, String propertyName, EnumPropertyValue enumPropertyValue)Map an omrs entityDetail enum property to a Subject Area Node property.protected booleanmapMapToNode(N node, String propertyName, MapPropertyValue mapPropertyValue)Map an omrs entityDetail map property to a Subject Area Node property.protected voidmapNodeToInstanceProperties(N node, InstanceProperties instanceProperties)Map the supplied Node to omrs InstanceProperties.protected booleanmapPrimitiveToNode(N node, String propertyName, Object value)Map an omrs entityDetail primitive property to a Subject Area Node property.protected voidpopulateAdditionalProperties(N node, InstanceProperties instanceProperties)protected StringremovePropertyByNameFromInstanceProperties(InstanceProperties instanceProperties, String propertyName)Extract and delete the qualifiedName property from the supplied instance properties.EntityDetailtoEntityDetail(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 Detail
-
repositoryHelper
protected final OMRSRepositoryHelper repositoryHelper
-
genericHandler
protected final OpenMetadataAPIGenericHandler genericHandler
-
-
Constructor Detail
-
EntityDetailMapper
public EntityDetailMapper(OpenMetadataAPIGenericHandler genericHandler)
-
-
Method Detail
-
mapEntityDetailToNode
protected void mapEntityDetailToNode(N node, EntityDetail omrsEntityDetail)
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
protected boolean mapPrimitiveToNode(N node, String propertyName, Object value)
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
protected boolean mapEnumToNode(N node, String propertyName, EnumPropertyValue enumPropertyValue)
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
protected boolean mapMapToNode(N node, String propertyName, MapPropertyValue mapPropertyValue)
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
public EntityDetail 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. 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
public abstract String getTypeName()
Description copied from interface:MapperGet the type name- Specified by:
getTypeNamein interfaceMapper<EntityDetail,N extends Node>- Returns:
- type name
-
getTypeDefGuid
public String getTypeDefGuid()
get the EntityTypeDef Guid This method should be overridden to provide the appropriate guid for the type.- Specified by:
getTypeDefGuidin interfaceMapper<EntityDetail,N extends Node>- Returns:
- the guid of the entity typedef
-
populateAdditionalProperties
protected void populateAdditionalProperties(N node, InstanceProperties instanceProperties)
-
mapNodeToInstanceProperties
protected void mapNodeToInstanceProperties(N node, InstanceProperties instanceProperties)
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
-
-