Class EntityDetailMapper<N extends Node>

    • 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 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
      • 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