Class MapTypePropertyValue

  • All Implemented Interfaces:
    Serializable

    public class MapTypePropertyValue
    extends PropertyValue
    MapTypePropertyValue stores the values of a map within an entity, struct or relationship properties. The elements of the map are stored in an ElementProperties map.
    See Also:
    Serialized Form
    • Constructor Detail

      • MapTypePropertyValue

        public MapTypePropertyValue()
        Default constructor sets the map to empty.
      • MapTypePropertyValue

        public MapTypePropertyValue​(MapTypePropertyValue template)
        Copy/clone constructor set up the map using the supplied template.
        Parameters:
        template - ArrayTypePropertyValue
    • Method Detail

      • valueAsString

        public String valueAsString()
        Return the string version of the value - used for error logging.
        Specified by:
        valueAsString in class PropertyValue
        Returns:
        string value
      • valueAsObject

        public Object valueAsObject()
        Return the object version of the value - used for comparisons.
        Specified by:
        valueAsObject in class PropertyValue
        Returns:
        object value
      • getMapElementCount

        public int getMapElementCount()
        Return the number of elements in the map.
        Returns:
        int map size
      • getMapValues

        public ElementProperties getMapValues()
        Return a copy of the map elements.
        Returns:
        ElementProperties containing the map elements
      • setMapValue

        public void setMapValue​(String propertyName,
                                PropertyValue propertyValue)
        Add or update an element in the map. If a null is supplied for the property name, an OMRS runtime exception is thrown. If a null is supplied for the property value, the property is removed.
        Parameters:
        propertyName - String name
        propertyValue - PropertyValue value to store
      • setMapValues

        public void setMapValues​(ElementProperties mapValues)
        Set up the map elements in one call.
        Parameters:
        mapValues - ElementProperties containing the array elements
      • toString

        public String toString()
        Standard toString method.
        Overrides:
        toString in class PropertyValue
        Returns:
        JSON style description of variables.
      • equals

        public boolean equals​(Object objectToCompare)
        Validate that an object is equal depending on their stored values.
        Overrides:
        equals in class PropertyValue
        Parameters:
        objectToCompare - object
        Returns:
        boolean result
      • hashCode

        public int hashCode()
        Return a hash code based on the property values
        Overrides:
        hashCode in class PropertyValue
        Returns:
        int hash code