Package ca.uhn.fhir.util
Class PropertyModifyingHelper
java.lang.Object
ca.uhn.fhir.util.PropertyModifyingHelper
Helper class for handling updates of the instances that support property modification via
setProperty
and getProperty
methods.-
Field Summary
-
Constructor Summary
ConstructorDescriptionPropertyModifyingHelper
(FhirContext theFhirContext, IBase theBase) Creates a new instance initializing the dependencies. -
Method Summary
Modifier and TypeMethodDescriptionGets property with the specified name from the provided base class.getBase()
Gets the base instance that this helper operates onGets the delimiter used when concatenating multiple field valuesGets all non-blank fields as a single string joined with the delimiter provided bygetDelimiter()
protected Method
Gets the method with the specified name and parameter types.getMultiple
(String thePropertyName) Gets property values with the specified name from the provided base class.void
Sets property or adds to a collection of properties with the specified name from the provided base class.void
setDelimiter
(String theDelimiter) Sets the delimiter used when concatenating multiple field values
-
Field Details
-
GET_PROPERTY_METHOD_NAME
- See Also:
-
SET_PROPERTY_METHOD_NAME
- See Also:
-
DEFAULT_DELIMITER
- See Also:
-
-
Constructor Details
-
PropertyModifyingHelper
Creates a new instance initializing the dependencies.- Parameters:
theFhirContext
- FHIR context holding the resource definitionstheBase
- The base class to set properties on
-
-
Method Details
-
getMethod
Gets the method with the specified name and parameter types.- Parameters:
theObject
- Non-null instance to get the method fromtheMethodName
- Name of the method to gettheParamClasses
- Parameters types that method parameters should be assignable as- Returns:
- Returns the method with the given name and parameters or null if it can't be found
-
getFields
Gets all non-blank fields as a single string joined with the delimiter provided bygetDelimiter()
- Parameters:
theFiledNames
- Field names to retrieve values for- Returns:
- Returns all specified non-blank fileds as a single string.
-
get
Gets property with the specified name from the provided base class.- Parameters:
thePropertyName
- Name of the property to get- Returns:
- Returns property value converted to string. In case of multiple values, they are joined with the specified delimiter.
-
set
Sets property or adds to a collection of properties with the specified name from the provided base class.- Parameters:
thePropertyName
- Name of the property to set or add element to in case property is a collection
-
getMultiple
Gets property values with the specified name from the provided base class.- Parameters:
thePropertyName
- Name of the property to get- Returns:
- Returns property values converted to string.
-
getDelimiter
Gets the delimiter used when concatenating multiple field values- Returns:
- Returns the delimiter
-
setDelimiter
Sets the delimiter used when concatenating multiple field values- Parameters:
theDelimiter
- The delimiter to set
-
getBase
Gets the base instance that this helper operates on- Returns:
- Returns the base instance
-