Package org.hl7.fhir.dstu2.model
Class PrimitiveType<T>
- java.lang.Object
-
- org.hl7.fhir.dstu2.model.Base
-
- org.hl7.fhir.dstu2.model.Element
-
- org.hl7.fhir.dstu2.model.Type
-
- org.hl7.fhir.dstu2.model.PrimitiveType<T>
-
- All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement,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
- 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)voidfromStringValue(String theValue)TgetValue()StringgetValueAsString()inthashCode()booleanhasValue()booleanisEmpty()booleanisPrimitive()protected abstract Tparse(String theValue)Subclasses must override to convert an encoded representation of this datatype into a "coerced" oneStringprimitiveValue()PrimitiveType<T>setValue(T theValue)voidsetValueAsString(String theValue)StringtoString()protected TypetypedCopy()protected voidupdateStringValue()-
Methods inherited from class org.hl7.fhir.dstu2.model.Element
addChild, addExtension, addExtension, copyValues, fhirType, getExtension, getExtensionsByUrl, getExtensionString, getId, getIdElement, hasExtension, hasExtension, hasId, hasIdElement, listChildren, setId, setIdElement, setProperty
-
Methods inherited from class org.hl7.fhir.dstu2.model.Base
castToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCode, castToCodeableConcept, castToCoding, castToContactPoint, castToDate, castToDateTime, castToDecimal, castToDuration, castToElementDefinition, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMeta, castToMoney, castToNarrative, castToOid, castToPeriod, castToPositiveInt, castToQuantity, castToRange, castToRatio, castToReference, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToTime, castToTiming, castToUnsignedInt, castToUri, children, compareDeep, compareDeep, compareDeep, compareValues, compareValues, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getUserData, getUserInt, getUserString, hasFormatComment, hasType, hasUserData, isMetadataBased, 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
-
getValue
public T getValue()
- Specified by:
getValuein interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
asStringValue
public String asStringValue()
-
setValue
public PrimitiveType<T> setValue(T theValue)
- Specified by:
setValuein interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
updateStringValue
protected void updateStringValue()
-
isEmpty
public boolean isEmpty()
-
fromStringValue
public void fromStringValue(String theValue)
-
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
-
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
-
isPrimitive
public boolean isPrimitive()
- Overrides:
isPrimitivein classBase
-
primitiveValue
public String primitiveValue()
- Overrides:
primitiveValuein classBase
-
hasValue
public boolean hasValue()
- Specified by:
hasValuein interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<T>
-
getValueAsString
public String getValueAsString()
- Specified by:
getValueAsStringin 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>
-
equalsDeep
public boolean equalsDeep(Base obj)
- Overrides:
equalsDeepin classElement
-
equalsShallow
public boolean equalsShallow(Base obj)
- Overrides:
equalsShallowin classElement
-
-