Class MapPropertyValue

  • All Implemented Interfaces:
    Serializable

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

      • MapPropertyValue

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

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

      • getMapElementCount

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

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

        public void setMapValue​(String propertyName,
                                InstancePropertyValue 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 - InstancePropertyValue value to store
      • setMapValues

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

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

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