Class PrimitiveTypePropertyValue
- java.lang.Object
-
- org.odpi.openmetadata.frameworks.governanceaction.search.PropertyValue
-
- org.odpi.openmetadata.frameworks.governanceaction.search.PrimitiveTypePropertyValue
-
- All Implemented Interfaces:
Serializable
public class PrimitiveTypePropertyValue extends PropertyValue
PrimitiveTypePropertyValue 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
-
-
Constructor Summary
Constructors Constructor Description PrimitiveTypePropertyValue()Default constructor sets the primitive property value to null.PrimitiveTypePropertyValue(PrimitiveTypePropertyValue template)Copy/clone constructor copies the values from 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.PrimitiveTypeCategorygetPrimitiveTypeCategory()Return the category of the primitive's type.ObjectgetPrimitiveValue()Return the primitive value.inthashCode()Return a hash code based on the property valuesvoidsetPrimitiveTypeCategory(PrimitiveTypeCategory primitiveTypeCategory)Set up the category of the primitive type.voidsetPrimitiveValue(Object primitiveValue)Set up the primitive value.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
-
PrimitiveTypePropertyValue
public PrimitiveTypePropertyValue()
Default constructor sets the primitive property value to null.
-
PrimitiveTypePropertyValue
public PrimitiveTypePropertyValue(PrimitiveTypePropertyValue template)
Copy/clone constructor copies the values from the supplied template.- Parameters:
template- PrimitiveTypePropertyValue
-
-
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
-
getPrimitiveTypeCategory
public PrimitiveTypeCategory getPrimitiveTypeCategory()
Return the category of the primitive's type. This sets the name and Java Class used for the primitive value.- Returns:
- PrimitiveTypeCategory
-
setPrimitiveTypeCategory
public void setPrimitiveTypeCategory(PrimitiveTypeCategory primitiveTypeCategory)
Set up the category of the primitive type. This sets the name and Java Class used for the primitive value.- Parameters:
primitiveTypeCategory- PrimitiveTypeCategory 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 PrimitiveTypeCategory.- 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 PrimitiveTypeCategory.- Parameters:
primitiveValue- object contain the primitive value
-
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
-
-