Class PropertyModifyingHelper

java.lang.Object
ca.uhn.fhir.util.PropertyModifyingHelper

public class PropertyModifyingHelper
extends Object
Helper class for handling updates of the instances that support property modification via setProperty and getProperty methods.
  • Field Details

  • Constructor Details

    • PropertyModifyingHelper

      public PropertyModifyingHelper​(FhirContext theFhirContext, IBase theBase)
      Creates a new instance initializing the dependencies.
      Parameters:
      theFhirContext - FHIR context holding the resource definitions
      theBase - The base class to set properties on
  • Method Details

    • getMethod

      protected Method getMethod​(Object theObject, String theMethodName, Class... theParamClasses)
      Gets the method with the specified name and parameter types.
      Parameters:
      theObject - Non-null instance to get the method from
      theMethodName - Name of the method to get
      theParamClasses - 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

      public String getFields​(String... theFiledNames)
      Gets all non-blank fields as a single string joined with the delimiter provided by getDelimiter()
      Parameters:
      theFiledNames - Field names to retrieve values for
      Returns:
      Returns all specified non-blank fileds as a single string.
    • get

      public String get​(String thePropertyName)
      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

      public void set​(String thePropertyName, String theValue)
      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

      public List<String> getMultiple​(String thePropertyName)
      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

      public String getDelimiter()
      Gets the delimiter used when concatenating multiple field values
      Returns:
      Returns the delimiter
    • setDelimiter

      public void setDelimiter​(String theDelimiter)
      Sets the delimiter used when concatenating multiple field values
      Parameters:
      theDelimiter - The delimiter to set
    • getBase

      public IBase getBase()
      Gets the base instance that this helper operates on
      Returns:
      Returns the base instance