public class PropertyHelper extends Object
| Constructor and Description |
|---|
PropertyHelper() |
| Modifier and Type | Method and Description |
|---|---|
ElementProperties |
addBooleanProperty(ElementProperties properties,
String propertyName,
boolean propertyValue)
Add the supplied property to an element properties object.
|
ElementProperties |
addDateProperty(ElementProperties properties,
String propertyName,
Date propertyValue)
Add the supplied property to an element properties object.
|
ElementProperties |
addEnumProperty(ElementProperties properties,
String propertyName,
String propertyType,
String symbolicName)
Add the supplied property to an element properties object.
|
ElementProperties |
addFloatProperty(ElementProperties properties,
String propertyName,
float propertyValue)
Add the supplied property to an element properties object.
|
ElementProperties |
addIntProperty(ElementProperties properties,
String propertyName,
int propertyValue)
Add the supplied property to an element properties object.
|
ElementProperties |
addLongProperty(ElementProperties properties,
String propertyName,
long propertyValue)
Add the supplied property to an element properties object.
|
ElementProperties |
addMapProperty(ElementProperties properties,
String propertyName,
Map<String,Object> mapValues)
Add the supplied map property to an element properties object.
|
ElementProperties |
addPropertyMap(ElementProperties properties,
Map<String,Object> mapValues)
Add the supplied property map to an element properties object.
|
ElementProperties |
addStringArrayProperty(ElementProperties properties,
String propertyName,
List<String> arrayValues)
Add the supplied array property to an element properties object.
|
ElementProperties |
addStringMapProperty(ElementProperties properties,
String propertyName,
Map<String,String> mapValues)
Add the supplied map property to an element properties object.
|
ElementProperties |
addStringProperty(ElementProperties properties,
String propertyName,
String propertyValue)
Add the supplied property to an element properties object.
|
ElementProperties |
addStringPropertyMap(ElementProperties properties,
Map<String,String> mapValues)
Add the supplied property map to an element properties object.
|
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.
|
boolean |
getBooleanProperty(String sourceName,
String propertyName,
ElementProperties properties,
String methodName)
Return the requested property or false if property is not found.
|
Date |
getDateProperty(String sourceName,
String propertyName,
ElementProperties properties,
String methodName)
Return the requested property or null if property is not found.
|
Map<String,Object> |
getElementPropertiesAsMap(ElementProperties properties)
Convert an element properties object into a map.
|
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.
|
int |
getIntProperty(String sourceName,
String propertyName,
ElementProperties properties,
String methodName)
Return the requested property or 0 if property is not found.
|
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.
|
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.
|
SearchProperties |
getSearchProperties(ElementProperties properties,
MatchCriteria matchCriteria)
Convert the provided instance properties and match criteria into an equivalent SearchProperties object.
|
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.
|
String |
getStringProperty(String sourceName,
String propertyName,
ElementProperties properties,
String methodName)
Return the requested property or null if property is not found.
|
void |
validateGUID(String guid,
String guidParameter,
String methodName)
Throw an exception if the supplied GUID is null
|
void |
validateMandatoryName(String name,
String nameParameter,
String methodName)
Throw an exception if the supplied name is null
|
public void validateGUID(String guid, String guidParameter, String methodName) throws InvalidParameterException
guid - unique identifier to validateguidParameter - name of the parameter that passed the guid.methodName - name of the method making the call.InvalidParameterException - the guid is nullpublic void validateMandatoryName(String name, String nameParameter, String methodName) throws InvalidParameterException
name - unique name to validatenameParameter - name of the parameter that passed the name.methodName - name of the method making the call.InvalidParameterException - the name is nullpublic ElementProperties addStringProperty(ElementProperties properties, String propertyName, String propertyValue)
properties - properties object to add property to, may be null.propertyName - name of propertypropertyValue - value of propertypublic ElementProperties addIntProperty(ElementProperties properties, String propertyName, int propertyValue)
properties - properties object to add property to, may be null.propertyName - name of propertypropertyValue - value of propertypublic ElementProperties addLongProperty(ElementProperties properties, String propertyName, long propertyValue)
properties - properties object to add property to may be null.propertyName - name of propertypropertyValue - value of propertypublic ElementProperties addFloatProperty(ElementProperties properties, String propertyName, float propertyValue)
properties - properties object to add property to may be null.propertyName - name of propertypropertyValue - value of propertypublic ElementProperties addDateProperty(ElementProperties properties, String propertyName, Date propertyValue)
properties - properties object to add property to may be null.propertyName - name of propertypropertyValue - value of propertypublic ElementProperties addBooleanProperty(ElementProperties properties, String propertyName, boolean propertyValue)
properties - properties object to add property to, may be null.propertyName - name of propertypropertyValue - value of propertypublic ElementProperties addEnumProperty(ElementProperties properties, String propertyName, String propertyType, String symbolicName)
properties - properties object to add property to, may be null.propertyName - name of propertypropertyType - type of enumsymbolicName - symbol name value of propertypublic ElementProperties addStringArrayProperty(ElementProperties properties, String propertyName, List<String> arrayValues)
properties - properties object to add property to, may be null.propertyName - name of propertyarrayValues - contents of the arraypublic ElementProperties addMapProperty(ElementProperties properties, String propertyName, Map<String,Object> mapValues)
properties - properties object to add property to, may be null.propertyName - name of propertymapValues - contents of the mappublic ElementProperties addPropertyMap(ElementProperties properties, Map<String,Object> mapValues)
properties - properties object to add property to, may be null.mapValues - contents of the mappublic ElementProperties addStringMapProperty(ElementProperties properties, String propertyName, Map<String,String> mapValues)
properties - properties object to add property to, may be null.propertyName - name of propertymapValues - contents of the mappublic ElementProperties addStringPropertyMap(ElementProperties properties, Map<String,String> mapValues)
properties - properties object to add property to, may be null.mapValues - contents of the mappublic Map<String,String> getStringMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName)
sourceName - source of callpropertyName - name of requested map propertyproperties - values of the propertymethodName - method of callerpublic Map<String,Boolean> getBooleanMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName)
sourceName - source of callpropertyName - name of requested map propertyproperties - values of the propertymethodName - method of callerpublic Map<String,Long> getLongMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName)
sourceName - source of callpropertyName - name of requested map propertyproperties - values of the propertymethodName - method of callerpublic Map<String,Integer> getIntegerMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName)
sourceName - source of callpropertyName - name of requested map propertyproperties - values of the propertymethodName - method of callerpublic Map<String,Object> getMapFromProperty(String sourceName, String propertyName, ElementProperties properties, String methodName)
sourceName - source of callpropertyName - name of requested map propertyproperties - all of the properties of the instancemethodName - method of callerpublic Map<String,Object> getElementPropertiesAsMap(ElementProperties properties)
properties - packed propertiespublic String getStringProperty(String sourceName, String propertyName, ElementProperties properties, String methodName)
sourceName - source of callpropertyName - name of requested propertyproperties - properties from the instance.methodName - method of callerpublic int getIntProperty(String sourceName, String propertyName, ElementProperties properties, String methodName)
sourceName - source of callpropertyName - name of requested propertyproperties - properties from the instance.methodName - method of callerpublic Date getDateProperty(String sourceName, String propertyName, ElementProperties properties, String methodName)
sourceName - source of callpropertyName - name of requested propertyproperties - properties from the instance.methodName - method of callerpublic boolean getBooleanProperty(String sourceName, String propertyName, ElementProperties properties, String methodName)
sourceName - source of callpropertyName - name of requested propertyproperties - properties from the instance.methodName - method of callerpublic SearchProperties getSearchProperties(ElementProperties properties, MatchCriteria matchCriteria)
properties - properties object to convertmatchCriteria - match criteria to applyCopyright © 2018–2021 LF AI & Data Foundation. All rights reserved.