Class MapPropertyValue
- java.lang.Object
-
- org.odpi.openmetadata.frameworks.governanceaction.search.PropertyValue
-
- org.odpi.openmetadata.frameworks.governanceaction.search.MapPropertyValue
-
- All Implemented Interfaces:
Serializable
public class MapPropertyValue extends PropertyValue
MapPropertyValue 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 Summary
Constructors Constructor Description MapPropertyValue()Default constructor sets the map to empty.MapPropertyValue(MapPropertyValue template)Copy/clone constructor set up the map using the supplied template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyValuecloneFromSubclass()Delegate the process of cloning to the subclass.booleanequals(Object objectToCompare)Validate that an object is equal depending on their stored values.intgetMapElementCount()Return the number of elements in the map.ElementPropertiesgetMapValues()Return a copy of the map elements.inthashCode()Return a hash code based on the property valuesvoidsetMapValue(String propertyName, PropertyValue propertyValue)Add or update an element in the map.voidsetMapValues(ElementProperties mapValues)Set up the map elements in one call.StringtoString()Standard toString method.ObjectvalueAsObject()Return the object version of the value - used for comparisons.StringvalueAsString()Return the string version of the value - used for error logging.-
Methods inherited from class org.odpi.openmetadata.frameworks.governanceaction.search.PropertyValue
getTypeName, mapValuesAsObject, mapValuesAsString, setTypeName
-
-
-
-
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
-
cloneFromSubclass
public PropertyValue cloneFromSubclass()
Delegate the process of cloning to the subclass.- Specified by:
cloneFromSubclassin classPropertyValue- Returns:
- subclass of PropertyValue
-
valueAsString
public String valueAsString()
Return the string version of the value - used for error logging.- Specified by:
valueAsStringin classPropertyValue- Returns:
- string value
-
valueAsObject
public Object valueAsObject()
Return the object version of the value - used for comparisons.- Specified by:
valueAsObjectin classPropertyValue- 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 namepropertyValue- 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:
toStringin classPropertyValue- Returns:
- JSON style description of variables.
-
equals
public boolean equals(Object objectToCompare)
Validate that an object is equal depending on their stored values.- Overrides:
equalsin classPropertyValue- Parameters:
objectToCompare- object- Returns:
- boolean result
-
hashCode
public int hashCode()
Return a hash code based on the property values- Overrides:
hashCodein classPropertyValue- Returns:
- int hash code
-
-