Class ExtensionDt
- java.lang.Object
-
- ca.uhn.fhir.model.api.BaseElement
-
- ca.uhn.fhir.model.api.BaseIdentifiableElement
-
- ca.uhn.fhir.model.api.ExtensionDt
-
- All Implemented Interfaces:
ICompositeDatatype,ICompositeElement,IDatatype,IElement,IIdentifiableElement,ISupportsUndeclaredExtensions,Serializable,IBase,IBaseDatatype,IBaseExtension<ExtensionDt,IDatatype>,ICompositeType
public class ExtensionDt extends BaseIdentifiableElement implements ICompositeDatatype, IBaseExtension<ExtensionDt,IDatatype>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ExtensionDt()ExtensionDt(boolean theIsModifier)ExtensionDt(boolean theIsModifier, String theUrl)ExtensionDt(boolean theIsModifier, String theUrl, IBaseDatatype theValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <T extends IElement>
List<T>getAllPopulatedChildElementsOfType(Class<T> theType)Deprecated.List<ExtensionDt>getExtension()StringgetUrl()Returns the URL for this extension.StringgetUrlAsString()Retained for backward compatibilityIBaseDatatypegetValue()Returns the value of this extension, if one exists.IPrimitiveDatatype<?>getValueAsPrimitive()Returns the value of this extension, casted to a primitive datatype.booleanisEmpty()booleanisModifier()voidsetModifier(boolean theModifier)ExtensionDtsetUrl(StringDt theUrl)ExtensionDtsetUrl(String theUrl)ExtensionDtsetValue(IBaseDatatype theValue)StringtoString()-
Methods inherited from class ca.uhn.fhir.model.api.BaseIdentifiableElement
getElementSpecificId, getId, setElementSpecificId, setId, setId
-
Methods inherited from class ca.uhn.fhir.model.api.BaseElement
addUndeclaredExtension, addUndeclaredExtension, addUndeclaredExtension, getAllUndeclaredExtensions, getFormatCommentsPost, getFormatCommentsPre, getUndeclaredExtensions, getUndeclaredExtensionsByUrl, getUndeclaredModifierExtensions, getUserData, hasFormatComment, isBaseEmpty, setUserData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hl7.fhir.instance.model.api.IBase
fhirType, getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, setUserData
-
-
-
-
Constructor Detail
-
ExtensionDt
public ExtensionDt()
-
ExtensionDt
public ExtensionDt(boolean theIsModifier)
-
ExtensionDt
public ExtensionDt(boolean theIsModifier, String theUrl)
-
ExtensionDt
public ExtensionDt(boolean theIsModifier, String theUrl, IBaseDatatype theValue)
-
-
Method Detail
-
getUrl
public String getUrl()
Returns the URL for this extension.Note that before HAPI 0.9 this method returned a
StringDtbut as of HAPI 0.9 this method returns a plain string. This was changed because it does not make sense to use a StringDt here since the URL itself can not contain extensions and it was therefore misleading.- Specified by:
getUrlin interfaceIBaseExtension<ExtensionDt,IDatatype>
-
getUrlAsString
public String getUrlAsString()
Retained for backward compatibility- See Also:
getUrl()
-
getValue
public IBaseDatatype getValue()
Returns the value of this extension, if one exists.Note that if this extension contains extensions (instead of a datatype) then this method will return null. In that case, you must use
BaseElement.getUndeclaredExtensions()andBaseElement.getUndeclaredModifierExtensions()to retrieve the child extensions.- Specified by:
getValuein interfaceIBaseExtension<ExtensionDt,IDatatype>
-
getValueAsPrimitive
public IPrimitiveDatatype<?> getValueAsPrimitive()
Returns the value of this extension, casted to a primitive datatype. This is a convenience method which should only be called if you are sure that the value for this particular extension will be a primitive.Note that if this extension contains extensions (instead of a datatype) then this method will return null. In that case, you must use
BaseElement.getUndeclaredExtensions()andBaseElement.getUndeclaredModifierExtensions()to retrieve the child extensions.- Throws:
ClassCastException- If the value of this extension is not a primitive datatype
-
isModifier
public boolean isModifier()
-
setModifier
public void setModifier(boolean theModifier)
-
setUrl
public ExtensionDt setUrl(String theUrl)
- Specified by:
setUrlin interfaceIBaseExtension<ExtensionDt,IDatatype>
-
setUrl
public ExtensionDt setUrl(StringDt theUrl)
-
setValue
public ExtensionDt setValue(IBaseDatatype theValue)
- Specified by:
setValuein interfaceIBaseExtension<ExtensionDt,IDatatype>
-
getAllPopulatedChildElementsOfType
@Deprecated public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType)
Deprecated.Description copied from interface:ICompositeElementReturns a list containing all child elements matching a given type- Specified by:
getAllPopulatedChildElementsOfTypein interfaceICompositeElement- Parameters:
theType- The type to match. If set to null, all child elements will be returned
-
getExtension
public List<ExtensionDt> getExtension()
- Specified by:
getExtensionin interfaceIBaseExtension<ExtensionDt,IDatatype>
-
-