Package ca.uhn.fhir.model.api
Class Include
- java.lang.Object
-
- ca.uhn.fhir.model.api.Include
-
- All Implemented Interfaces:
Serializable
public class Include extends Object implements Serializable
Represents a FHIR resource path specification, e.g.Patient:nameNote on equality: This class uses
valueand therecurseproperties to test equality. Prior to HAPI 1.2 (and FHIR DSTU2) the recurse property did not exist, so this may merit consideration when upgrading servers.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IncludeasNonRecursive()Creates a copy of this include with non-recurse behaviourIncludeasRecursive()Creates a copy of this include with recurse behaviourbooleanequals(Object obj)See the note on equality on theclass documentationStringgetParamName()Returns the portion of the value after the first colon but before the second colonStringgetParamTargetType()Returns the portion of the string after the second colon, or null if there are not two colons in the value.StringgetParamType()Returns the portion of the value before the first colonStringgetValue()inthashCode()See the note on equality on theclass documentationbooleanisLocked()Is this objectlocked?booleanisRecurse()IncludesetRecurse(boolean theRecurse)Should this include recursevoidsetValue(String theValue)IncludetoLocked()Return a newStringtoString()IncludewithType(String theResourceType)Creates and returns a new copy of this Include with the given type.
-
-
-
Constructor Detail
-
Include
public Include(String theValue)
Constructor for non-recursive include- Parameters:
theValue- The_includevalue, e.g. "Patient:name"
-
Include
public Include(String theValue, boolean theIterate)
Constructor for an include- Parameters:
theValue- The_includevalue, e.g. "Patient:name"theIterate- Should the include recurse
-
-
Method Detail
-
asNonRecursive
public Include asNonRecursive()
Creates a copy of this include with non-recurse behaviour
-
asRecursive
public Include asRecursive()
Creates a copy of this include with recurse behaviour
-
equals
public boolean equals(Object obj)
See the note on equality on theclass documentation
-
getParamType
public String getParamType()
Returns the portion of the value before the first colon
-
getParamName
public String getParamName()
Returns the portion of the value after the first colon but before the second colon
-
getParamTargetType
public String getParamTargetType()
Returns the portion of the string after the second colon, or null if there are not two colons in the value.
-
hashCode
public int hashCode()
See the note on equality on theclass documentation
-
isRecurse
public boolean isRecurse()
-
setRecurse
public Include setRecurse(boolean theRecurse)
Should this include recurse- Returns:
- Returns a reference to
thisfor easy method chaining
-
withType
public Include withType(String theResourceType)
Creates and returns a new copy of this Include with the given type. The following table shows what will be returned:Initial Contents theResourceType Output Patient:careProvider Organization Patient:careProvider:Organization Patient:careProvider:Practitioner Organization Patient:careProvider:Organization Patient (any) IllegalStateException- Parameters:
theResourceType- The resource type (e.g. "Organization")- Returns:
- A new copy of the include. Note that if this include is
locked, the returned include will be too
-
-