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 Details

  • Constructor Details

  • Method Details

    • 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 entity
      propertyName - 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 updated
      propertyName - the omrs property name
      value - 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 updated
      propertyName - the omrs property name
      enumPropertyValue - 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 updated
      propertyName - the omrs property name
      mapPropertyValue - 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: Mapper
      Get the type name
      Specified by:
      getTypeName in interface Mapper<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:
      getTypeDefGuid in interface Mapper<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 node
      instanceProperties - equivalent instance properties to the Node