Class ElementProperties
java.lang.Object
org.odpi.openmetadata.frameworks.governanceaction.search.ElementProperties
The ElementProperties class provides support for properties to be added to a metadata element,
classification or relationship instances.
There are variable properties that are defined in the TypeDefs. They are managed in a java.util.Map map object built around HashMap. The property name (or domain) of the map is the name of the property. The property value (or range) of the map is a subclass of PropertyValue depending on the type of the property:
There are variable properties that are defined in the TypeDefs. They are managed in a java.util.Map map object built around HashMap. The property name (or domain) of the map is the name of the property. The property value (or range) of the map is a subclass of PropertyValue depending on the type of the property:
- PrimitiveTypePropertyValue: for primitives such as strings and numbers. The full list of primitives are given in PrimitiveTypeCategory.
- EnumTypePropertyValue: for properties with a type consisting of an enumeration of valid values. Each
- StructTypePropertyValue: for properties that have a type of a complex structure (aka struct). The Struct can be thought of as a list of related properties.
- MapTypePropertyValue: for properties that have a type of map. The map holds an unordered list of name-value pairs. The pairs are of the same type and the name for the pair is unique within the map.
- ArrayTypePropertyValue: for properties that have a type of Array. This is an ordered list of values of the same type.
-
Constructor Summary
ConstructorDescriptionTypical constructorElementProperties
(ElementProperties templateProperties) Copy/clone constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Validate that an object is equal depending on their stored values.Return all the properties as a string map.int
Return the number of properties stored.Returns a list of the instance properties for the element.getPropertyValue
(String name) Returns the requested instance property for the element.Return the instance properties as a map.int
hashCode()
Return a hash code based on the values of this object.void
setProperty
(String newPropertyName, PropertyValue newPropertyValue) Adds or updates an instance property.void
setPropertyValueMap
(Map<String, PropertyValue> propertyValueMap) Set up the instance properties map.toString()
Standard toString method.
-
Constructor Details
-
ElementProperties
public ElementProperties()Typical constructor -
ElementProperties
Copy/clone constructor.- Parameters:
templateProperties
- template object to copy.
-
-
Method Details
-
getPropertyValueMap
Return the instance properties as a map.- Returns:
- instance properties map.
-
setPropertyValueMap
Set up the instance properties map.- Parameters:
propertyValueMap
- map of name valued properties
-
getPropertyNames
Returns a list of the instance properties for the element. If no stored properties are present then null is returned.- Returns:
- list of properties
-
getPropertyValue
Returns the requested instance property for the element. If no stored property with that name is present then null is returned.- Parameters:
name
- String name of the property to return.- Returns:
- requested property value.
-
setProperty
Adds or updates an instance property. If a null is supplied for the property name, the property name "null" is used. If a null is supplied for the property value, the property is removed.- Parameters:
newPropertyName
- namenewPropertyValue
- value
-
getPropertyCount
public int getPropertyCount()Return the number of properties stored.- Returns:
- int property count
-
getPropertiesAsStrings
Return all the properties as a string map.- Returns:
- map of property name to property value as string.
-
toString
Standard toString method. -
equals
Validate that an object is equal depending on their stored values. -
hashCode
public int hashCode()Return a hash code based on the values of this object.
-