Package ca.uhn.fhir.model.api
Class BasePrimitive<T>
java.lang.Object
ca.uhn.fhir.model.api.BaseElement
ca.uhn.fhir.model.api.BaseIdentifiableElement
ca.uhn.fhir.model.api.BasePrimitive<T>
- All Implemented Interfaces:
IDatatype
,IElement
,IIdentifiableElement
,IPrimitiveDatatype<T>
,ISupportsUndeclaredExtensions
,Externalizable
,Serializable
,IBase
,IBaseDatatype
,IPrimitiveType<T>
- Direct Known Subclasses:
Base64BinaryDt
,BaseDateTimeDt
,BooleanDt
,CodeDt
,DecimalDt
,IntegerDt
,StringDt
,UriDt
,XhtmlDt
public abstract class BasePrimitive<T>
extends BaseIdentifiableElement
implements IPrimitiveDatatype<T>, Externalizable
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
Subclasses must override to convert a "coerced" value into an encoded one.boolean
getValue()
int
hashCode()
boolean
hasValue()
boolean
isEmpty()
protected abstract T
Subclasses must override to convert an encoded representation of this datatype into a "coerced" onevoid
readExternal
(ObjectInput theIn) void
setValueAsString
(String theValue) toString()
protected void
void
writeExternal
(ObjectOutput theOut) 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, 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 Details
-
BasePrimitive
public BasePrimitive()
-
-
Method Details
-
encode
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
-
equals
-
getValue
- Specified by:
getValue
in interfaceIPrimitiveDatatype<T>
- Specified by:
getValue
in interfaceIPrimitiveType<T>
-
getValueAsString
- Specified by:
getValueAsString
in interfaceIPrimitiveDatatype<T>
- Specified by:
getValueAsString
in interfaceIPrimitiveType<T>
- Throws:
DataFormatException
-
hashCode
-
isEmpty
-
parse
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
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
setValue
- Specified by:
setValue
in interfaceIPrimitiveDatatype<T>
- Specified by:
setValue
in interfaceIPrimitiveType<T>
- Throws:
DataFormatException
-
setValueAsString
- Specified by:
setValueAsString
in interfaceIPrimitiveDatatype<T>
- Specified by:
setValueAsString
in interfaceIPrimitiveType<T>
- Throws:
DataFormatException
-
toString
-
updateStringValue
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
hasValue
- Specified by:
hasValue
in interfaceIPrimitiveType<T>
-