Class RelationshipMapper<R extends Relationship>

    • Method Detail

      • mapInstancePropertiesToRelationship

        protected void mapInstancePropertiesToRelationship​(R relationship,
                                                           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
      • 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<Relationship,​R extends 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,
                                                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,
                                               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,
                                                           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