Class InstanceProperties
- java.lang.Object
-
- org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceElementHeader
-
- org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties
-
- All Implemented Interfaces:
Serializable
public class InstanceProperties extends InstanceElementHeader
The InstanceProperties class provides support for properties to be added to an entity, classification or relationship instances. These properties are maintained by the consumers of metadata (typically the Open Metadata Access Services (OMASs). There are some fixed properties that are available on all instances. These are:- effectiveFromTime: Date/Time when the instance should be used. If this value is null then the instance can be used as soon as it is created.
- effectiveToTime: Date/Time when the instance should not longer be used. If this is null then the instance can be used until it is deleted.
- PrimitivePropertyValue: for primitives such as strings and numbers. The full list of primitives are given in PrimitiveDefCategory.
- EnumPropertyValue: for properties with a type consisting of an enumeration of valid values. Each
- StructPropertyValue: for properties that have a type of a complex structure (aka struct). The Struct can be thought of as a list of related properties.
- MapPropertyValue: 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.
- ArrayPropertyValue: for properties that have a type of Array. This is an ordered list of values of the same type.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InstanceProperties()Typical constructorInstanceProperties(InstanceProperties templateProperties)Copy/clone constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object objectToCompare)Validate that an object is equal depending on their stored values.DategetEffectiveFromTime()Return the date/time that this instance should start to be used (null means it can be used from creationTime).DategetEffectiveToTime()Return the date/time that this instance should no longer be used.Map<String,InstancePropertyValue>getInstanceProperties()Return the instance properties as a map.intgetPropertyCount()Return the number of properties stored.Iterator<String>getPropertyNames()Returns a list of the instance properties for the element.InstancePropertyValuegetPropertyValue(String name)Returns the requested instance property for the element.inthashCode()Return a hash code based on the values of this object.voidsetEffectiveFromTime(Date effectiveFromTime)Set up the date/time that this instance should start to be used (null means it can be used from creationTime).voidsetEffectiveToTime(Date effectiveToTime)Set up the date/time that this instance should no longer be used.voidsetInstanceProperties(Map<String,InstancePropertyValue> instanceProperties)Set up the instance properties map.voidsetProperty(String newPropertyName, InstancePropertyValue newPropertyValue)Adds or updates an instance property.StringtoString()Standard toString method.
-
-
-
Constructor Detail
-
InstanceProperties
public InstanceProperties()
Typical constructor
-
InstanceProperties
public InstanceProperties(InstanceProperties templateProperties)
Copy/clone constructor.- Parameters:
templateProperties- template object to copy.
-
-
Method Detail
-
getEffectiveFromTime
public Date getEffectiveFromTime()
Return the date/time that this instance should start to be used (null means it can be used from creationTime).- Returns:
- Date object
-
setEffectiveFromTime
public void setEffectiveFromTime(Date effectiveFromTime)
Set up the date/time that this instance should start to be used (null means it can be used from creationTime).- Parameters:
effectiveFromTime- Date object
-
getEffectiveToTime
public Date getEffectiveToTime()
Return the date/time that this instance should no longer be used.- Returns:
- Date object
-
setEffectiveToTime
public void setEffectiveToTime(Date effectiveToTime)
Set up the date/time that this instance should no longer be used.- Parameters:
effectiveToTime- Date object
-
getInstanceProperties
public Map<String,InstancePropertyValue> getInstanceProperties()
Return the instance properties as a map.- Returns:
- instance properties map.
-
setInstanceProperties
public void setInstanceProperties(Map<String,InstancePropertyValue> instanceProperties)
Set up the instance properties map.- Parameters:
instanceProperties- map of name valued properties
-
getPropertyNames
public Iterator<String> 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
public InstancePropertyValue getPropertyValue(String name)
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
public void setProperty(String newPropertyName, InstancePropertyValue newPropertyValue)
Adds or updates an instance property. 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:
newPropertyName- namenewPropertyValue- value
-
getPropertyCount
public int getPropertyCount()
Return the number of properties stored.- Returns:
- int property count
-
toString
public String toString()
Standard toString method.
-
equals
public boolean equals(Object objectToCompare)
Validate that an object is equal depending on their stored values.
-
-