
Package org.hl7.fhir.dstu3.model
Class PrimitiveType<T>
- java.lang.Object
-
- org.hl7.fhir.dstu3.model.Base
-
- org.hl7.fhir.dstu3.model.Element
-
- org.hl7.fhir.dstu3.model.Type
-
- org.hl7.fhir.dstu3.model.PrimitiveType<T>
-
- All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement
,Externalizable
,Serializable
,org.hl7.fhir.instance.model.api.IBase
,org.hl7.fhir.instance.model.api.IBaseDatatype
,org.hl7.fhir.instance.model.api.IBaseElement
,org.hl7.fhir.instance.model.api.IBaseHasExtensions
,org.hl7.fhir.instance.model.api.IPrimitiveType<T>
- Direct Known Subclasses:
Base64BinaryType
,BaseDateTimeType
,BooleanType
,DecimalType
,Enumeration
,IntegerType
,StringType
,TimeType
,UriType
public abstract class PrimitiveType<T> extends Type implements org.hl7.fhir.instance.model.api.IPrimitiveType<T>, org.hl7.fhir.instance.model.api.IBaseHasExtensions, ca.uhn.fhir.model.api.IElement, Externalizable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PrimitiveType()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
asStringValue()
abstract Type
copy()
protected abstract String
encode(T theValue)
Subclasses must override to convert a "coerced" value into an encoded one.boolean
equalsDeep(Base obj)
boolean
equalsShallow(Base obj)
void
fromStringValue(String theValue)
Base[]
getProperty(int hash, String name, boolean checkValid)
T
getValue()
String
getValueAsString()
int
hashCode()
boolean
hasPrimitiveValue()
boolean
hasValue()
boolean
isEmpty()
boolean
isPrimitive()
protected abstract T
parse(String theValue)
Subclasses must override to convert an encoded representation of this datatype into a "coerced" oneString
primitiveValue()
void
readExternal(ObjectInput theIn)
Base
setProperty(int hash, String name, Base value)
Base
setProperty(String name, Base value)
PrimitiveType<T>
setValue(T theValue)
void
setValueAsString(String theValue)
String
toString()
protected Type
typedCopy()
protected void
updateStringValue()
void
writeExternal(ObjectOutput theOut)
-
Methods inherited from class org.hl7.fhir.dstu3.model.Element
addChild, addExtension, addExtension, addExtension, copyValues, fhirType, getExtension, getExtensionFirstRep, getExtensionsByUrl, getExtensionString, getId, getIdBase, getIdElement, getNamedProperty, getTypesForProperty, hasExtension, hasExtension, hasId, hasIdElement, listChildren, makeProperty, setExtension, setId, setIdBase, setIdElement
-
Methods inherited from class org.hl7.fhir.dstu3.model.Base
castToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCode, castToCodeableConcept, castToCoding, castToContactDetail, castToContactPoint, castToContributor, castToDataRequirement, castToDate, castToDateTime, castToDecimal, castToDosage, castToDuration, castToElementDefinition, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMeta, castToMoney, castToNarrative, castToOid, castToParameterDefinition, castToPeriod, castToPositiveInt, castToQuantity, castToRange, castToRatio, castToReference, castToRelatedArtifact, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToTime, castToTiming, castToTriggerDefinition, castToType, castToUnsignedInt, castToUri, castToUsageContext, castToXhtml, castToXhtmlString, children, clearUserData, compareDeep, compareDeep, compareDeep, compareValues, compareValues, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getUserData, getUserInt, getUserString, hasFormatComment, hasType, hasUserData, isBooleanPrimitive, isMetadataBased, isResource, listChildrenByName, listChildrenByName, setUserData, setUserDataINN
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hl7.fhir.instance.model.api.IBase
fhirType, getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, setUserData
-
-
-
-
Constructor Detail
-
PrimitiveType
public PrimitiveType()
-
-
Method Detail
-
asStringValue
public String asStringValue()
-
encode
protected abstract String encode(T theValue)
Subclasses must override to convert a "coerced" value into an encoded one.- Parameters:
theValue
- Will not be null- Returns:
- May return null if the value does not correspond to anything
-
equalsDeep
public boolean equalsDeep(Base obj)
- Overrides:
equalsDeep
in classElement
-
equalsShallow
public boolean equalsShallow(Base obj)
- Overrides:
equalsShallow
in classElement
-
fromStringValue
public void fromStringValue(String theValue)
-
getValue
public T getValue()
- Specified by:
getValue
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
getValueAsString
public String getValueAsString()
- Specified by:
getValueAsString
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
hasValue
public boolean hasValue()
- Specified by:
hasValue
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
isEmpty
public boolean isEmpty()
-
isPrimitive
public boolean isPrimitive()
- Overrides:
isPrimitive
in classBase
-
parse
protected abstract T parse(String theValue)
Subclasses must override to convert an encoded representation of this datatype into a "coerced" one- Parameters:
theValue
- Will not be null- Returns:
- May return null if the value does not correspond to anything
-
primitiveValue
public String primitiveValue()
- Overrides:
primitiveValue
in classBase
-
readExternal
public void readExternal(ObjectInput theIn) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
setValue
public PrimitiveType<T> setValue(T theValue)
- Specified by:
setValue
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
setValueAsString
public void setValueAsString(String theValue)
- Specified by:
setValueAsString
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
updateStringValue
protected void updateStringValue()
-
writeExternal
public void writeExternal(ObjectOutput theOut) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
setProperty
public Base setProperty(int hash, String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
setProperty
in classElement
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
setProperty
public Base setProperty(String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
setProperty
in classElement
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getProperty
public Base[] getProperty(int hash, String name, boolean checkValid) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
getProperty
in classElement
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
hasPrimitiveValue
public boolean hasPrimitiveValue()
- Overrides:
hasPrimitiveValue
in classBase
-
-