Class RelationshipMapper<R extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship>

java.lang.Object
org.odpi.openmetadata.accessservices.subjectarea.server.mappers.relationships.RelationshipMapper<R>
All Implemented Interfaces:
IRelationshipMapper<R>, Mapper<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship,R>
Direct Known Subclasses:
AntonymMapper, CategoryAnchorMapper, CategoryHierarchyLinkMapper, IsARelationshipMapper, IsATypeOfMapper, PreferredTermMapper, ProjectScopeMapper, RelatedTermMapper, ReplacementTermMapper, SemanticAssignmentMapper, SynonymMapper, TermAnchorMapper, TermCategorizationMapper, TermHasARelationshipMapper, TermIsATypeOfRelationshipDeprecatedMapper, TermTypedByRelationshipMapper, TranslationMapper, UsedInContextMapper, ValidValueMapper

public abstract class RelationshipMapper<R extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship> extends Object implements IRelationshipMapper<R>
Static mapping methods to map between the relationship and the equivalent generated OMRSRelationshipBean
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler
     
    protected final org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RelationshipMapper(org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler genericHandler)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    get the relationshipTypeDef Guid This method should be overridden to provide the appropriate guid for the type.
    abstract String
    get type name
    map(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship omrsRelationship)
    Map from an OMRS Relationship to a Subject Area OMAS relationship
    org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship
    map(R omasRelationship)
    Map omasRelationship to the omrs relationship equivalent
    protected boolean
    mapEnumToRelationship(R relationship, String propertyName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue enumPropertyValue)
    Map an omrs enum property to a Subject Area relationship property.
    protected void
    mapInstancePropertiesToRelationship(R relationship, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties instanceProperties)
    Map the instance properties to the relationship This method should be overridden by subclasses to map the properties to the relationship.
    protected boolean
    mapMapToRelationship(R omasRelationship, String propertyName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties instancePropertyForMap)
    Map an omrs map property to a Subject Area relationship property.
    protected boolean
    mapPrimitiveToRelationship(R relationship, String propertyName, Object value)
    Map an omrs primitive property to a Subject Area relationship property.
    protected void
    mapRelationshipToInstanceProperties(R omasRelationship, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties instanceProperties)
    Map the supplied relationship to omrs InstanceProperties.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • genericHandler

      protected final org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler genericHandler
    • repositoryHelper

      protected final org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper repositoryHelper
  • Constructor Details

    • RelationshipMapper

      public RelationshipMapper(org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler genericHandler)
  • Method Details

    • map

      public R map(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship omrsRelationship)
      Description copied from interface: IRelationshipMapper
      Map from an OMRS Relationship to a Subject Area OMAS relationship
      Specified by:
      map in interface IRelationshipMapper<R extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship>
      Specified by:
      map in interface Mapper<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship,R extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship>
      Parameters:
      omrsRelationship - OMRS relationships
      Returns:
      Subject Area OMAS relationship
    • mapInstancePropertiesToRelationship

      protected void mapInstancePropertiesToRelationship(R relationship, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties instanceProperties)
      Map the instance properties to the relationship This method should be overridden by subclasses to map the properties to the relationship.
      Parameters:
      relationship - relationship to be updated
      instanceProperties - properties to use for the update
    • map

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship map(R omasRelationship) throws org.odpi.openmetadata.commonservices.ffdc.exceptions.InvalidParameterException
      Map omasRelationship to the omrs relationship equivalent
      Specified by:
      map in interface IRelationshipMapper<R extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship>
      Specified by:
      map in interface Mapper<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship,R extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship>
      Parameters:
      omasRelationship - supplied omasRelationship
      Returns:
      omrs relationship equivalent
      Throws:
      org.odpi.openmetadata.commonservices.ffdc.exceptions.InvalidParameterException
    • getTypeName

      public abstract String getTypeName()
      get type name
      Specified by:
      getTypeName in interface Mapper<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship,R extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship>
      Returns:
      the omrs type name.
    • getTypeDefGuid

      public String getTypeDefGuid()
      get the relationshipTypeDef Guid This method should be overridden to provide the appropriate guid for the type.
      Specified by:
      getTypeDefGuid in interface Mapper<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship,R extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship>
      Returns:
      the guid of the relationship typedef
    • mapPrimitiveToRelationship

      protected boolean mapPrimitiveToRelationship(R relationship, String propertyName, Object value)
      Map an omrs primitive property to a Subject Area relationship property. The child class is expected to override this method if the type has primitive properties
      Parameters:
      relationship - the relationship 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;
    • mapEnumToRelationship

      protected boolean mapEnumToRelationship(R relationship, String propertyName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue enumPropertyValue)
      Map an omrs enum property to a Subject Area relationship property. The child class is expected to override this method if the type has enum properties
      Parameters:
      relationship - the relationship 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;
    • mapMapToRelationship

      protected boolean mapMapToRelationship(R omasRelationship, String propertyName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties instancePropertyForMap)
      Map an omrs map property to a Subject Area relationship property. The child class is expected to override this method if the type has map properties
      Parameters:
      omasRelationship - the relationship to be updated
      propertyName - the omrs property name
      instancePropertyForMap - the omrs map property value
      Returns:
      true if it was a property we were expecting , otherwise false;
    • mapRelationshipToInstanceProperties

      protected void mapRelationshipToInstanceProperties(R omasRelationship, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties instanceProperties)
      Map the supplied relationship to omrs InstanceProperties. This method should be overridden to populate the instance properties
      Parameters:
      omasRelationship - supplied relationship
      instanceProperties - equivalent instance properties to the relationship