Class PrimitivePropertyValue
- java.lang.Object
-
- org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.RepositoryElementHeader
-
- 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.PrimitivePropertyValue
-
- All Implemented Interfaces:
Serializable
public class PrimitivePropertyValue extends InstancePropertyValue
PrimitivePropertyValue stores a single primitive property. This is stored in the specific Java class for the property value's type although it is stored as an object.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceElementHeader
CURRENT_INSTANCE_HEADER_VERSION
-
-
Constructor Summary
Constructors Constructor Description PrimitivePropertyValue()
Default constructor sets the primitive property value to null.PrimitivePropertyValue(PrimitivePropertyValue template)
Copy/clone constructor copies the values from the supplied template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InstancePropertyValue
cloneFromSubclass()
Delegate the process of cloning to the subclass.boolean
equals(Object objectToCompare)
Validate that an object is equal depending on their stored values.PrimitiveDefCategory
getPrimitiveDefCategory()
Return the the category of the primitive's type.Object
getPrimitiveValue()
Return the primitive value.int
hashCode()
Return a hash code based on the property valuesvoid
setPrimitiveDefCategory(PrimitiveDefCategory primitiveDefCategory)
Set up the category of the primitive type.void
setPrimitiveValue(Object primitiveValue)
Set up the primitive value.String
toString()
Standard toString method.Object
valueAsObject()
Return the object version of the value - used for comparisons.String
valueAsString()
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
-
Methods inherited from class org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.RepositoryElementHeader
getHeaderVersion, setHeaderVersion
-
-
-
-
Constructor Detail
-
PrimitivePropertyValue
public PrimitivePropertyValue()
Default constructor sets the primitive property value to null.
-
PrimitivePropertyValue
public PrimitivePropertyValue(PrimitivePropertyValue template)
Copy/clone constructor copies the values from the supplied template.- Parameters:
template
- PrimitivePropertyValue
-
-
Method Detail
-
cloneFromSubclass
public InstancePropertyValue cloneFromSubclass()
Delegate the process of cloning to the subclass.- Specified by:
cloneFromSubclass
in classInstancePropertyValue
- Returns:
- subclass of InstancePropertyValue
-
valueAsString
public String valueAsString()
Return the string version of the value - used for error logging.- Specified by:
valueAsString
in classInstancePropertyValue
- Returns:
- string value
-
valueAsObject
public Object valueAsObject()
Return the object version of the value - used for comparisons.- Specified by:
valueAsObject
in classInstancePropertyValue
- Returns:
- object value
-
getPrimitiveDefCategory
public PrimitiveDefCategory getPrimitiveDefCategory()
Return the the category of the primitive's type. This sets the name and Java Class used for the primitive value.- Returns:
- PrimitiveDefCategory
-
setPrimitiveDefCategory
public void setPrimitiveDefCategory(PrimitiveDefCategory primitiveDefCategory)
Set up the category of the primitive type. This sets the name and Java Class used for the primitive value.- Parameters:
primitiveDefCategory
- PrimitiveDefCategory enum
-
getPrimitiveValue
public Object getPrimitiveValue()
Return the primitive value. It is already set up to be the appropriate type for the primitive as defined in the PrimitiveDefCategory.- Returns:
- Object containing the primitive value.
-
setPrimitiveValue
public void setPrimitiveValue(Object primitiveValue)
Set up the primitive value. Although it is passed in as a java.lang.Object, it should be the correct type as defined by the PrimitiveDefCategory.- Parameters:
primitiveValue
- object contain the primitive value
-
toString
public String toString()
Standard toString method.- Overrides:
toString
in 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:
equals
in classInstancePropertyValue
- Parameters:
objectToCompare
- object- Returns:
- boolean result
-
hashCode
public int hashCode()
Return a hash code based on the property values- Overrides:
hashCode
in classInstancePropertyValue
- Returns:
- int hash code
-
-