Class PropertyHelper
java.lang.Object
org.odpi.openmetadata.frameworks.governanceaction.search.PropertyHelper
PropertyHelper is used by the governance actions services to manage the contents of the ElementProperties structure.
It is a stateless object and so there are no threading concerns with declaring it as a static variable.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddBooleanMapProperty
(ElementProperties properties, String propertyName, Map<String, Boolean> mapValues) Add the supplied map property to an element properties object.addBooleanProperty
(ElementProperties properties, String propertyName, boolean propertyValue) Add the supplied property to an element properties object.addBooleanPropertyMap
(ElementProperties properties, Map<String, Boolean> mapValues) Add the supplied property map to an element properties object.addDateMapProperty
(ElementProperties properties, String propertyName, Map<String, Date> mapValues) Add the supplied map property to an element properties object.addDateProperty
(ElementProperties properties, String propertyName, Date propertyValue) Add the supplied property to an element properties object.addDatePropertyMap
(ElementProperties properties, Map<String, Date> mapValues) Add the supplied property map to an element properties object.addDoubleMapProperty
(ElementProperties properties, String propertyName, Map<String, Double> mapValues) Add the supplied map property to an element properties object.addDoublePropertyMap
(ElementProperties properties, Map<String, Double> mapValues) Add the supplied property map to an element properties object.addEnumProperty
(ElementProperties properties, String propertyName, String propertyType, String symbolicName) Add the supplied property to an element properties object.addFloatProperty
(ElementProperties properties, String propertyName, float propertyValue) Add the supplied property to an element properties object.addIntMapProperty
(ElementProperties properties, String propertyName, Map<String, Integer> mapValues) Add the supplied map property to an element properties object.addIntProperty
(ElementProperties properties, String propertyName, int propertyValue) Add the supplied property to an element properties object.addIntPropertyMap
(ElementProperties properties, Map<String, Integer> mapValues) Add the supplied property map to an element properties object.addLongMapProperty
(ElementProperties properties, String propertyName, Map<String, Long> mapValues) Add the supplied map property to an element properties object.addLongProperty
(ElementProperties properties, String propertyName, long propertyValue) Add the supplied property to an element properties object.addLongPropertyMap
(ElementProperties properties, Map<String, Long> mapValues) Add the supplied property map to an element properties object.addMapProperty
(ElementProperties properties, String propertyName, Map<String, Object> mapValues) Add the supplied map property to an element properties object.addPropertyMap
(ElementProperties properties, Map<String, Object> mapValues) Add the supplied property map to an element properties object.addStringArrayProperty
(ElementProperties properties, String propertyName, List<String> arrayValues) Add the supplied array property to an element properties object.addStringMapProperty
(ElementProperties properties, String propertyName, Map<String, String> mapValues) Add the supplied map property to an element properties object.addStringProperty
(ElementProperties properties, String propertyName, String propertyValue) Add the supplied property to an element properties object.addStringPropertyMap
(ElementProperties properties, Map<String, String> mapValues) Add the supplied property map to an element properties object.getAnchorGUID
(ElementHeader elementHeader) Return the anchorGUID for an element.getBooleanMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.boolean
getBooleanProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or false if property is not found.getClassification
(OpenMetadataElement openMetadataElement, String classificationName) Extract a particular classification from an open metadata element.getDateMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.getDateProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or null if property is not found.getDomainName
(ElementControlHeader elementControlHeader) Extract the domain name from an element's header.getDoubleMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.getElementPropertiesAsMap
(ElementProperties properties) Convert an element properties object into a map.getEnumPropertySymbolicName
(String sourceName, String propertyName, ElementProperties properties, String methodName) Retrieve the ordinal value from an enum property.getIntegerMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.int
getIntProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or 0 if property is not found.getLongMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.long
getLongProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or 0 if property is not found.getMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.getResolvedStringPropertyFromTemplate
(String sourceName, OpenMetadataElement templateElement, String propertyName, Map<String, String> placeholderProperties) Return the property name from the template entity that has its placeholder variables resolved.getSearchProperties
(ElementProperties properties, MatchCriteria matchCriteria) Convert the provided instance properties and match criteria into an equivalent SearchProperties object.getSearchPropertiesByName
(List<String> propertyNames, String value, PropertyComparisonOperator propertyComparisonOperator) Return the search properties that requests elements with an exactly matching name in any of the listed property names.getSearchPropertiesForMetadataCollectionName
(String metadataCollectionQualifiedName) Build up property parameters for a search that returns the metadata collection name.getStringArrayProperty
(String sourceName, String propertyName, ElementProperties properties, String callingMethodName) Locates and extracts a string array property and extracts its values.getStringMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.getStringProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or null if property is not found.getStringPropertyFromClassification
(OpenMetadataElement openMetadataElement, String classificationName, String propertyName, String methodName) Extract a particular property from a classification if found attached to an open metadata element.boolean
isClassified
(ElementHeader elementHeader, String classificationName) boolean
isTypeOf
(ElementControlHeader elementControlHeader, String expectedType) Test the type of the element to determine if it matches the desired type.removeBooleanMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.boolean
removeBooleanProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or false if property is not found.removeDateMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.removeDateProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or null if property is not found.removeDoubleMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.removeEnumProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Retrieve the ordinal value from an enum property.removeIntegerMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.int
removeIntProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or 0 if property is not found.removeLongMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.long
removeLongProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or 0 if property is not found.removeMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.protected void
removeProperty
(String propertyName, ElementProperties properties) Remove the named property from the instance properties object.removeStringArrayProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a string array property and extracts its values.removeStringMapFromProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.removeStringProperty
(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or null if property is not found.replacePrimitiveStringWithPlaceholders
(String propertyValue, Map<String, String> placeholderProperties) Replace any placeholders found in the string property with the supplied values.void
validateGUID
(String guid, String guidParameter, String methodName) Throw an exception if the supplied GUID is nullvoid
validateMandatoryName
(String name, String nameParameter, String methodName) Throw an exception if the supplied name is null
-
Constructor Details
-
PropertyHelper
public PropertyHelper()
-
-
Method Details
-
validateGUID
public void validateGUID(String guid, String guidParameter, String methodName) throws InvalidParameterException Throw an exception if the supplied GUID is null- Parameters:
guid
- unique identifier to validateguidParameter
- name of the parameter that passed the guid.methodName
- name of the method making the call.- Throws:
InvalidParameterException
- the guid is null
-
validateMandatoryName
public void validateMandatoryName(String name, String nameParameter, String methodName) throws InvalidParameterException Throw an exception if the supplied name is null- Parameters:
name
- unique name to validatenameParameter
- name of the parameter that passed the name.methodName
- name of the method making the call.- Throws:
InvalidParameterException
- the name is null
-
isTypeOf
Test the type of the element to determine if it matches the desired type. This method works for all categories of elements, ie entities, relationships and classifications.- Parameters:
elementControlHeader
- header of the element to testexpectedType
- expected type - nul means any type- Returns:
- boolean result
-
getDomainName
Extract the domain name from an element's header.- Parameters:
elementControlHeader
- header of an open metadata element- Returns:
- string type name
-
getAnchorGUID
Return the anchorGUID for an element.- Parameters:
elementHeader
- header of the element- Returns:
- unique identifier or null;
-
getSearchPropertiesByName
public SearchProperties getSearchPropertiesByName(List<String> propertyNames, String value, PropertyComparisonOperator propertyComparisonOperator) Return the search properties that requests elements with an exactly matching name in any of the listed property names.- Parameters:
propertyNames
- list of property namesvalue
- name to match onpropertyComparisonOperator
- set to EQ for exact match and LIKE for fuzzy match- Returns:
- search properties
-
addStringProperty
public ElementProperties addStringProperty(ElementProperties properties, String propertyName, String propertyValue) Add the supplied property to an element properties object. If the element property object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertypropertyValue
- value of property- Returns:
- element properties object.
-
addIntProperty
public ElementProperties addIntProperty(ElementProperties properties, String propertyName, int propertyValue) Add the supplied property to an element properties object. If the element property object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertypropertyValue
- value of property- Returns:
- resulting element properties object
-
addLongProperty
public ElementProperties addLongProperty(ElementProperties properties, String propertyName, long propertyValue) Add the supplied property to an element properties object. If the element property object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add. Property may be null.propertyName
- name of propertypropertyValue
- value of property- Returns:
- resulting element properties object
-
addFloatProperty
public ElementProperties addFloatProperty(ElementProperties properties, String propertyName, float propertyValue) Add the supplied property to an element properties object. If the element property object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add. Property may be null.propertyName
- name of propertypropertyValue
- value of property- Returns:
- resulting element properties object
-
addDateProperty
public ElementProperties addDateProperty(ElementProperties properties, String propertyName, Date propertyValue) Add the supplied property to an element properties object. If the element property object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add. Property may be null.propertyName
- name of propertypropertyValue
- value of property- Returns:
- resulting element properties object
-
addBooleanProperty
public ElementProperties addBooleanProperty(ElementProperties properties, String propertyName, boolean propertyValue) Add the supplied property to an element properties object. If the element property object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertypropertyValue
- value of property- Returns:
- resulting element properties object
-
addEnumProperty
public ElementProperties addEnumProperty(ElementProperties properties, String propertyName, String propertyType, String symbolicName) Add the supplied property to an element properties object. If the element property object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertypropertyType
- type of enumsymbolicName
- symbol name value of property- Returns:
- resulting element properties object
-
addStringArrayProperty
public ElementProperties addStringArrayProperty(ElementProperties properties, String propertyName, List<String> arrayValues) Add the supplied array property to an element properties object. The supplied array is stored as a single property in the instances properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertyarrayValues
- contents of the array- Returns:
- resulting element properties object
-
addMapProperty
public ElementProperties addMapProperty(ElementProperties properties, String propertyName, Map<String, Object> mapValues) Add the supplied map property to an element properties object. The supplied map is stored as a single property in the instances properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertymapValues
- contents of the map- Returns:
- resulting element properties object
-
addPropertyMap
Add the supplied property map to an element properties object. Each of the entries in the map is added as a separate property in element properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.mapValues
- contents of the map- Returns:
- instance properties object.
-
addStringMapProperty
public ElementProperties addStringMapProperty(ElementProperties properties, String propertyName, Map<String, String> mapValues) Add the supplied map property to an element properties object. The supplied map is stored as a single property in the instances properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertymapValues
- contents of the map- Returns:
- resulting element properties object
-
addBooleanMapProperty
public ElementProperties addBooleanMapProperty(ElementProperties properties, String propertyName, Map<String, Boolean> mapValues) Add the supplied map property to an element properties object. The supplied map is stored as a single property in the instances properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertymapValues
- contents of the map- Returns:
- resulting element properties object
-
addIntMapProperty
public ElementProperties addIntMapProperty(ElementProperties properties, String propertyName, Map<String, Integer> mapValues) Add the supplied map property to an element properties object. The supplied map is stored as a single property in the instances properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertymapValues
- contents of the map- Returns:
- resulting element properties object
-
addLongMapProperty
public ElementProperties addLongMapProperty(ElementProperties properties, String propertyName, Map<String, Long> mapValues) Add the supplied map property to an element properties object. The supplied map is stored as a single property in the instances properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertymapValues
- contents of the map- Returns:
- resulting element properties object
-
addDateMapProperty
public ElementProperties addDateMapProperty(ElementProperties properties, String propertyName, Map<String, Date> mapValues) Add the supplied map property to an element properties object. The supplied map is stored as a single property in the instances properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertymapValues
- contents of the map- Returns:
- resulting element properties object
-
addDoubleMapProperty
public ElementProperties addDoubleMapProperty(ElementProperties properties, String propertyName, Map<String, Double> mapValues) Add the supplied map property to an element properties object. The supplied map is stored as a single property in the instances properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.propertyName
- name of propertymapValues
- contents of the map- Returns:
- resulting element properties object
-
addStringPropertyMap
public ElementProperties addStringPropertyMap(ElementProperties properties, Map<String, String> mapValues) Add the supplied property map to an element properties object. Each of the entries in the map is added as a separate property in element properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.mapValues
- contents of the map- Returns:
- resulting element properties object
-
addIntPropertyMap
public ElementProperties addIntPropertyMap(ElementProperties properties, Map<String, Integer> mapValues) Add the supplied property map to an element properties object. Each of the entries in the map is added as a separate property in element properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.mapValues
- contents of the map- Returns:
- resulting element properties object
-
addLongPropertyMap
public ElementProperties addLongPropertyMap(ElementProperties properties, Map<String, Long> mapValues) Add the supplied property map to an element properties object. Each of the entries in the map is added as a separate property in element properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.mapValues
- contents of the map- Returns:
- resulting element properties object
-
addDatePropertyMap
public ElementProperties addDatePropertyMap(ElementProperties properties, Map<String, Date> mapValues) Add the supplied property map to an element properties object. Each of the entries in the map is added as a separate property in element properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.mapValues
- contents of the map- Returns:
- resulting element properties object
-
addDoublePropertyMap
public ElementProperties addDoublePropertyMap(ElementProperties properties, Map<String, Double> mapValues) Add the supplied property map to an element properties object. Each of the entries in the map is added as a separate property in element properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.mapValues
- contents of the map- Returns:
- resulting element properties object
-
addBooleanPropertyMap
public ElementProperties addBooleanPropertyMap(ElementProperties properties, Map<String, Boolean> mapValues) Add the supplied property map to an element properties object. Each of the entries in the map is added as a separate property in element properties. If the element properties object supplied is null, a new element properties object is created.- Parameters:
properties
- properties object to add property to, may be null.mapValues
- contents of the map- Returns:
- resulting element properties object
-
removeStringProperty
public String removeStringProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or null if property is not found. If the property is found, it is removed from the InstanceProperties structure. If the property is not a string property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- string property value or null
-
removeEnumProperty
public String removeEnumProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Retrieve the ordinal value from an enum property.- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- symbolic name
-
removeStringMapFromProperty
public Map<String,String> removeStringMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map. If the property is found, it is removed from the InstanceProperties structure. If the property is not a map property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
removeIntProperty
public int removeIntProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or 0 if property is not found. If the property is found, it is removed from the InstanceProperties structure. If the property is not an int property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- string property value or null
-
removeDateProperty
public Date removeDateProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or null if property is not found. If the property is found, it is removed from the InstanceProperties structure. If the property is not a date property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- string property value or null
-
removeBooleanProperty
public boolean removeBooleanProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or false if property is not found. If the property is found, it is removed from the InstanceProperties structure. If the property is not a boolean property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- string property value or null
-
removeLongProperty
public long removeLongProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or 0 if property is not found. If the property is found, it is removed from the InstanceProperties structure. If the property is not a long property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- string property value or null
-
removeStringArrayProperty
public List<String> removeStringArrayProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a string array property and extracts its values. If the property is found, it is removed from the InstanceProperties structure. If the property is not an array property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- all the properties of the instancemethodName
- method of caller- Returns:
- array property value or null
-
removeMapFromProperty
public Map<String,Object> removeMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map. If the property is found, it is removed from the InstanceProperties structure. If the property is not a map property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
removeLongMapFromProperty
public Map<String,Long> removeLongMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map. If the property is found, it is removed from the InstanceProperties structure. If the property is not a map property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
removeDoubleMapFromProperty
public Map<String,Double> removeDoubleMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map. If the property is found, it is removed from the InstanceProperties structure. If the property is not a map property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
removeIntegerMapFromProperty
public Map<String,Integer> removeIntegerMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map. If the property is found, it is removed from the InstanceProperties structure. If the property is not a map property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
removeBooleanMapFromProperty
public Map<String,Boolean> removeBooleanMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map. If the property is found, it is removed from the InstanceProperties structure. If the property is not a map property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
removeDateMapFromProperty
public Map<String,Date> removeDateMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map. If the property is found, it is removed from the InstanceProperties structure. If the property is not a map property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
removeProperty
Remove the named property from the instance properties object.- Parameters:
propertyName
- name of property to removeproperties
- instance properties object to work on
-
getStringMapFromProperty
public Map<String,String> getStringMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
getBooleanMapFromProperty
public Map<String,Boolean> getBooleanMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
getDateMapFromProperty
public Map<String,Date> getDateMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
getLongMapFromProperty
public Map<String,Long> getLongMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
getDoubleMapFromProperty
public Map<String,Double> getDoubleMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
getIntegerMapFromProperty
public Map<String,Integer> getIntegerMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- values of the propertymethodName
- method of caller- Returns:
- map property value or null
-
getMapFromProperty
public Map<String,Object> getMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Locates and extracts a property from an instance that is of type map and then converts its values into a Java map.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- all the properties of the instancemethodName
- method of caller- Returns:
- map property value or null
-
getEnumPropertySymbolicName
public String getEnumPropertySymbolicName(String sourceName, String propertyName, ElementProperties properties, String methodName) Retrieve the ordinal value from an enum property.- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- int ordinal or -1 if not found
-
getElementPropertiesAsMap
Convert an element properties object into a map.- Parameters:
properties
- packed properties- Returns:
- properties stored in Java map
-
replacePrimitiveStringWithPlaceholders
public String replacePrimitiveStringWithPlaceholders(String propertyValue, Map<String, String> placeholderProperties) Replace any placeholders found in the string property with the supplied values.- Parameters:
propertyValue
- string property from the templateplaceholderProperties
- map of placeholder names to placeholder values to substitute into the template properties- Returns:
- updated property
-
getResolvedStringPropertyFromTemplate
public String getResolvedStringPropertyFromTemplate(String sourceName, OpenMetadataElement templateElement, String propertyName, Map<String, String> placeholderProperties) Return the property name from the template entity that has its placeholder variables resolved.- Parameters:
sourceName
- name of calling sourcetemplateElement
- template element which has properties that include placeholder values.propertyName
- name of the property to extractplaceholderProperties
- placeholder properties to use to resolve the property- Returns:
- resolved property value
-
getStringProperty
public String getStringProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or null if property is not found. If the property is not a string property then a logic exception is thrown- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- string property value or null
-
getStringArrayProperty
public List<String> getStringArrayProperty(String sourceName, String propertyName, ElementProperties properties, String callingMethodName) Locates and extracts a string array property and extracts its values.- Parameters:
sourceName
- source of callpropertyName
- name of requested map propertyproperties
- all the properties of the instancecallingMethodName
- method of caller- Returns:
- array property value or null
-
getIntProperty
public int getIntProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or 0 if property is not found. If the property is not an int property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- string property value or null
-
getLongProperty
public long getLongProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or 0 if property is not found. If the property is not a long property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- string property value or null
-
getDateProperty
public Date getDateProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or null if property is not found. If the property is not a date property then a logic exception is thrown.- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- string property value or null
-
getBooleanProperty
public boolean getBooleanProperty(String sourceName, String propertyName, ElementProperties properties, String methodName) Return the requested property or false if property is not found. If the property is not a boolean property then a logic exception is thrown- Parameters:
sourceName
- source of callpropertyName
- name of requested propertyproperties
- properties from the instance.methodName
- method of caller- Returns:
- string property value or null
-
getSearchPropertiesForMetadataCollectionName
public SearchProperties getSearchPropertiesForMetadataCollectionName(String metadataCollectionQualifiedName) Build up property parameters for a search that returns the metadata collection name.- Returns:
- search properties
-
getSearchProperties
public SearchProperties getSearchProperties(ElementProperties properties, MatchCriteria matchCriteria) Convert the provided instance properties and match criteria into an equivalent SearchProperties object.- Parameters:
properties
- properties object to convertmatchCriteria
- match criteria to apply- Returns:
- SearchProperties object.
-
getClassification
public AttachedClassification getClassification(OpenMetadataElement openMetadataElement, String classificationName) Extract a particular classification from an open metadata element.- Parameters:
openMetadataElement
- source elementclassificationName
- name of the classification to extract- Returns:
- requested classification, or null
-
isClassified
-
getStringPropertyFromClassification
public String getStringPropertyFromClassification(OpenMetadataElement openMetadataElement, String classificationName, String propertyName, String methodName) Extract a particular property from a classification if found attached to an open metadata element.- Parameters:
openMetadataElement
- source elementclassificationName
- name of the classification to extractpropertyName
- name of property to extractmethodName
- calling method- Returns:
- string property or null
-