Naming convention for get and set property value methods
For each resource type, the HCL Compass CM API provides specific methods to get and possibly set the values of properties defined by the interface.
For example, the Compass CqRecord
interface
defines the PropertyNames
HAS_DUPLICATES
, FIELDS_UPDATED_THIS_SET_VALUE
,
and ALL_FIELD_VALUES
. Corresponding to these, it
defines the methods getHasDuplicates
, getFieldsUpdatedThisSetValue
,
and getAllFieldValues
.
The API uses the following naming convention for
PropertyNames
fields
and the corresponding get
and set
methods
for the property value. For a given PropertyName
XXXXX_YYY_ZZZZZ (for
example, DISPLAY_NAME
):- The
get
method for the property isgetXxxxxYyyZzzzz
(for example,getDisplayName
orgetComment
). - The
set
method for the property issetXxxxxYyyZzzzz
(for example,setDisplayName
orsetComment
).
String DisplayName = my_resource.getDisplayName();
String DisplayFields = my_resource.getComment();
If a set
method is not defined, the property cannot
be set directly with the HCL Compass CM
API.
You can also get and set property values with the
getProperty
and setProperty
methods.getXxxxxYyyZzzzz
() is equivalent togetProperty(XXXXX_YYY_ZZZZZ
). For example,getDisplayName
is equivalent togetProperty
(DISPLAY_NAME)
.setXxxxxYyyZzzzz(val
) is equivalent tosetProperty(XXXXX_YYY_ZZZZZ
, val). For example,setDisplayName(val)
is equivalent tosetProperty(DISPLAY_NAME, val)
See Additional information about properties for more information.