Class ArrayPropertyValue
- java.lang.Object
-
- org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceElementHeader
-
- org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstancePropertyValue
-
- org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ArrayPropertyValue
-
- All Implemented Interfaces:
Serializable
public class ArrayPropertyValue extends InstancePropertyValue
ArrayPropertyValue stores the values of an array within an entity or relationship properties. The elements of the array are stored in an InstanceProperties map where the property name is set to the element number and the property value is set to the value of the element in the array.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ArrayPropertyValue()Default constructor sets the array to empty.ArrayPropertyValue(ArrayPropertyValue template)Copy/clone constructor set up the array using the supplied template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InstancePropertyValuecloneFromSubclass()Delegate the process of cloning to the subclass.booleanequals(Object objectToCompare)Validate that an object is equal depending on their stored values.intgetArrayCount()Return the number of elements in the array.InstancePropertiesgetArrayValues()Return a copy of the array elements.inthashCode()Return a hash code based on the property valuesvoidsetArrayCount(int arrayCount)Set up the number of elements in the array.voidsetArrayValue(int elementNumber, InstancePropertyValue propertyValue)Add or update an element in the array.voidsetArrayValues(InstanceProperties arrayValues)Set up the array 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.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstancePropertyValue
getInstancePropertyCategory, getTypeGUID, getTypeName, mapValuesAsObject, mapValuesAsString, setInstancePropertyCategory, setTypeGUID, setTypeName
-
-
-
-
Constructor Detail
-
ArrayPropertyValue
public ArrayPropertyValue()
Default constructor sets the array to empty.
-
ArrayPropertyValue
public ArrayPropertyValue(ArrayPropertyValue template)
Copy/clone constructor set up the array using the supplied template.- Parameters:
template- ArrayPropertyValue
-
-
Method Detail
-
cloneFromSubclass
public InstancePropertyValue cloneFromSubclass()
Delegate the process of cloning to the subclass.- Specified by:
cloneFromSubclassin classInstancePropertyValue- Returns:
- subclass of InstancePropertyValue
-
valueAsString
public String valueAsString()
Return the string version of the value - used for error logging.- Specified by:
valueAsStringin classInstancePropertyValue- Returns:
- string value
-
valueAsObject
public Object valueAsObject()
Return the object version of the value - used for comparisons.- Specified by:
valueAsObjectin classInstancePropertyValue- Returns:
- object value
-
getArrayCount
public int getArrayCount()
Return the number of elements in the array.- Returns:
- int array size
-
setArrayCount
public void setArrayCount(int arrayCount)
Set up the number of elements in the array.- Parameters:
arrayCount- int array size
-
getArrayValues
public InstanceProperties getArrayValues()
Return a copy of the array elements.- Returns:
- InstanceProperties containing the array elements
-
setArrayValue
public void setArrayValue(int elementNumber, InstancePropertyValue propertyValue)Add or update an element in the array.- Parameters:
elementNumber- index number of the element in the arraypropertyValue- value to store
-
setArrayValues
public void setArrayValues(InstanceProperties arrayValues)
Set up the array elements in one call.- Parameters:
arrayValues- InstanceProperties containing the array elements
-
toString
public String toString()
Standard toString method.- Overrides:
toStringin classInstancePropertyValue- 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 classInstancePropertyValue- Parameters:
objectToCompare- object- Returns:
- boolean result
-
hashCode
public int hashCode()
Return a hash code based on the property values- Overrides:
hashCodein classInstancePropertyValue- Returns:
- int hash code
-
-