Package org.hl7.fhir.r4.model
Class PrimitiveType<T>
- java.lang.Object
-
- org.hl7.fhir.r4.model.Base
-
- org.hl7.fhir.r4.model.Element
-
- org.hl7.fhir.r4.model.Type
-
- org.hl7.fhir.r4.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 StringasStringValue()abstract Typecopy()protected abstract Stringencode(T theValue)Subclasses must override to convert a "coerced" value into an encoded one.booleanequalsDeep(Base obj)booleanequalsShallow(Base obj)protected voidforceStringValue(String value)voidfromStringValue(String theValue)Base[]getProperty(int hash, String name, boolean checkValid)String[]getTypesForProperty(int hash, String name)TgetValue()StringgetValueAsString()inthashCode()booleanhasPrimitiveValue()booleanhasValue()booleanisEmpty()booleanisPrimitive()BasemakeProperty(int hash, String name)protected abstract Tparse(String theValue)Subclasses must override to convert an encoded representation of this datatype into a "coerced" oneStringprimitiveValue()voidreadExternal(ObjectInput theIn)BasesetProperty(int hash, String name, Base value)BasesetProperty(String name, Base value)PrimitiveType<T>setValue(T theValue)voidsetValueAsString(String theValue)StringtoString()protected TypetypedCopy()protected voidupdateStringValue()voidwriteExternal(ObjectOutput theOut)-
Methods inherited from class org.hl7.fhir.r4.model.Element
addChild, addExtension, addExtension, addExtension, copyValues, fhirType, getExtension, getExtensionByUrl, getExtensionFirstRep, getExtensionsByUrl, getExtensionString, getId, getIdBase, getIdElement, getNamedProperty, hasExtension, hasExtension, hasId, hasIdElement, isDisallowExtensions, listChildren, noExtensions, removeExtension, setDisallowExtensions, setExtension, setId, setIdBase, setIdElement
-
Methods inherited from class org.hl7.fhir.r4.model.Base
castToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCanonical, castToCode, castToCodeableConcept, castToCoding, castToContactDetail, castToContactPoint, castToContributor, castToDataRequirement, castToDate, castToDateTime, castToDecimal, castToDosage, castToDuration, castToElementDefinition, castToExpression, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMarketingStatus, castToMeta, castToMoney, castToNarrative, castToOid, castToParameterDefinition, castToPeriod, castToPopulation, castToPositiveInt, castToProdCharacteristic, castToProductShelfLife, castToQuantity, castToRange, castToRatio, castToReference, castToRelatedArtifact, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToSubstanceAmount, castToTime, castToTiming, castToTriggerDefinition, castToType, castToUnsignedInt, castToUri, castToUrl, castToUsageContext, castToXhtml, castToXhtmlString, children, clearUserData, compareDeep, compareDeep, compareDeep, compareDeep, compareValues, compareValues, dateTimeValue, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getUserData, getUserInt, getUserString, hasFormatComment, hasType, hasUserData, isBooleanPrimitive, isDateTime, 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:
equalsDeepin classElement
-
equalsShallow
public boolean equalsShallow(Base obj)
- Overrides:
equalsShallowin classElement
-
fromStringValue
public void fromStringValue(String theValue)
-
getValue
public T getValue()
- Specified by:
getValuein interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
getValueAsString
public String getValueAsString()
- Specified by:
getValueAsStringin interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
hasValue
public boolean hasValue()
- Specified by:
hasValuein interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
isEmpty
public boolean isEmpty()
-
isPrimitive
public boolean isPrimitive()
- Overrides:
isPrimitivein 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:
primitiveValuein classBase
-
readExternal
public void readExternal(ObjectInput theIn) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
setValue
public PrimitiveType<T> setValue(T theValue)
- Specified by:
setValuein interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
setValueAsString
public void setValueAsString(String theValue)
- Specified by:
setValueAsStringin interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
updateStringValue
protected void updateStringValue()
-
writeExternal
public void writeExternal(ObjectOutput theOut) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
setProperty
public Base setProperty(int hash, String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
setPropertyin classElement- Throws:
org.hl7.fhir.exceptions.FHIRException
-
setProperty
public Base setProperty(String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
setPropertyin classElement- Throws:
org.hl7.fhir.exceptions.FHIRException
-
makeProperty
public Base makeProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
makePropertyin classElement- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getProperty
public Base[] getProperty(int hash, String name, boolean checkValid) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
getPropertyin classElement- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getTypesForProperty
public String[] getTypesForProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
getTypesForPropertyin classElement- Throws:
org.hl7.fhir.exceptions.FHIRException
-
forceStringValue
protected void forceStringValue(String value)
-
hasPrimitiveValue
public boolean hasPrimitiveValue()
- Overrides:
hasPrimitiveValuein classBase
-
-