Package com.ibm.fhir.model.type
Class Element
- java.lang.Object
-
- com.ibm.fhir.model.visitor.AbstractVisitable
-
- com.ibm.fhir.model.type.Element
-
- All Implemented Interfaces:
Visitable
- Direct Known Subclasses:
Address,Annotation,Attachment,BackboneElement,Base64Binary,Boolean,CodeableConcept,Coding,ContactDetail,ContactPoint,Contributor,DataRequirement,Date,DateTime,Decimal,Expression,Extension,HumanName,Identifier,Instant,Integer,Meta,Money,Narrative,ParameterDefinition,Period,Quantity,Range,Ratio,Reference,RelatedArtifact,SampledData,Signature,String,Time,TriggerDefinition,Uri,UsageContext,Xhtml
@Generated("com.ibm.fhir.tools.CodeGenerator") public abstract class Element extends AbstractVisitable
Base definition for all elements in a resource.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classElement.Builder
-
Constructor Summary
Constructors Modifier Constructor Description protectedElement(Element.Builder builder)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T extends Element>
Tas(Class<T> elementType)List<Extension>getExtension()May be used to represent additional information that is not part of the basic definition of the element.StringgetId()Unique id for the element within a resource (for internal references).booleanhasChildren()booleanhasValue()<T extends Element>
booleanis(Class<T> elementType)abstract Element.BuildertoBuilder()Create a new Builder from the contents of this Element-
Methods inherited from class com.ibm.fhir.model.visitor.AbstractVisitable
accept, accept, accept, accept, accept, accept, accept, accept, accept, accept, accept, accept, accept, accept, toString
-
-
-
-
Constructor Detail
-
Element
protected Element(Element.Builder builder)
-
-
Method Detail
-
getId
public String getId()
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.- Returns:
- An immutable object of type
Stringthat may be null.
-
getExtension
public List<Extension> getExtension()
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.- Returns:
- An unmodifiable list containing immutable objects of type
Extensionthat may be empty.
-
is
public <T extends Element> boolean is(Class<T> elementType)
- Returns:
- true if the element can be cast to the requested elementType
-
as
public <T extends Element> T as(Class<T> elementType)
- Throws:
ClassCastException- when this element cannot be cast to the requested elementType
-
hasValue
public boolean hasValue()
- Returns:
- true if the element is a FHIR primitive type and has a primitive value (as opposed to not having a value and just having extensions), otherwise false
-
hasChildren
public boolean hasChildren()
-
toBuilder
public abstract Element.Builder toBuilder()
Create a new Builder from the contents of this Element
-
-