Package org.hl7.fhir.r5.model
Class Base64BinaryType
java.lang.Object
org.hl7.fhir.r5.model.Base
org.hl7.fhir.r5.model.Element
org.hl7.fhir.r5.model.DataType
org.hl7.fhir.r5.model.PrimitiveType<byte[]>
org.hl7.fhir.r5.model.Base64BinaryType
- 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<byte[]>
public class Base64BinaryType
extends PrimitiveType<byte[]>
implements org.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>, org.hl7.fhir.instance.model.api.IBaseHasExtensions, ca.uhn.fhir.model.api.IElement, Externalizable
Primitive type "base64Binary" in FHIR: a sequence of bytes represented in base64
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hl7.fhir.r5.model.Base
Base.ProfileSource, Base.ValidationInfo, Base.ValidationMode, Base.ValidationReason
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructorBase64BinaryType
(byte[] theBytes) Base64BinaryType
(String theValue) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkValidBase64
(String toCheck) Checks if the passed in String is a validBase64
encoded String.copy()
protected String
encode
(byte[] theValue) Subclasses must override to convert a "coerced" value into an encoded one.fhirType()
byte[]
getValue()
boolean
hasValue()
boolean
isEmpty()
protected byte[]
Subclasses must override to convert an encoded representation of this datatype into a "coerced" onevoid
setValue
(byte[] theValue) void
setValueAsString
(String theValue) protected DataType
void
Methods inherited from class org.hl7.fhir.r5.model.PrimitiveType
asStringValue, canHavePrimitiveValue, equalsDeep, equalsShallow, forceStringValue, fpValue, fromStringValue, getProperty, getTypesForProperty, hashCode, hasPrimitiveValue, isPrimitive, makeProperty, matches, removeChild, setProperty, setProperty, toString, updateStringValue
Methods inherited from class org.hl7.fhir.r5.model.DataType
copyValues, getTranslation, isTranslatable
Methods inherited from class org.hl7.fhir.r5.model.Element
addChild, addExtension, addExtension, addExtension, copyExtensions, copyNewExtensions, copyValues, getExtension, getExtensionByUrl, getExtensionFirstRep, getExtensionsByUrl, getExtensionsByUrl, getExtensionString, getExtensionString, getFHIRPublicationVersion, getId, getIdBase, getIdElement, getNamedProperty, getStandardsStatus, hasExtension, hasExtension, hasExtension, hasExtension, hasId, hasIdElement, isDisallowExtensions, listChildren, noExtensions, removeExtension, setDisallowExtensions, setExtension, setId, setIdBase, setIdElement, setStandardsStatus
Methods inherited from class org.hl7.fhir.r5.model.Base
addDefinition, addFormatCommentsPost, addFormatCommentsPre, addValidationMessage, children, clearUserData, compareDeep, compareDeep, compareDeep, compareDeep, compareValues, compareValues, copyFormatComments, copyUserData, copyValues, dateTimeValue, equals, getChildByName, getChildValueByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getUserData, getUserInt, getUserString, getValidationInfo, getValidationMessages, getXhtml, hasFormatComment, hasFormatCommentPost, hasFormatCommentPre, hasType, hasUserData, hasValidated, hasValidationInfo, hasValidationMessages, isBooleanPrimitive, isCopyUserData, isDateTime, isMetadataBased, isResource, listChildrenByName, listChildrenByName, setCopyUserData, 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
getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, setUserData
Methods inherited from interface org.hl7.fhir.instance.model.api.IBaseElement
getUserData, setUserData
Methods inherited from interface org.hl7.fhir.instance.model.api.IBaseHasExtensions
addExtension, getExtension, hasExtension
-
Constructor Details
-
Base64BinaryType
public Base64BinaryType()Constructor -
Base64BinaryType
-
Base64BinaryType
-
-
Method Details
-
parse
Description copied from class:PrimitiveType
Subclasses must override to convert an encoded representation of this datatype into a "coerced" one- Specified by:
parse
in classPrimitiveType<byte[]>
- Parameters:
theValue
- Will not be null- Returns:
- May return null if the value does not correspond to anything
-
encode
Description copied from class:PrimitiveType
Subclasses must override to convert a "coerced" value into an encoded one.- Specified by:
encode
in classPrimitiveType<byte[]>
- Parameters:
theValue
- Will not be null- Returns:
- May return null if the value does not correspond to anything
-
copy
- Specified by:
copy
in classPrimitiveType<byte[]>
-
typedCopy
- Overrides:
typedCopy
in classPrimitiveType<byte[]>
-
fhirType
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classPrimitiveType<byte[]>
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classPrimitiveType<byte[]>
- Throws:
IOException
ClassNotFoundException
-
getValueAsString
- Specified by:
getValueAsString
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>
- Overrides:
getValueAsString
in classPrimitiveType<byte[]>
-
setValueAsString
- Specified by:
setValueAsString
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>
- Overrides:
setValueAsString
in classPrimitiveType<byte[]>
- Throws:
IllegalArgumentException
-
getValue
- Specified by:
getValue
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>
- Overrides:
getValue
in classPrimitiveType<byte[]>
-
setValue
- Specified by:
setValue
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>
- Overrides:
setValue
in classPrimitiveType<byte[]>
- Throws:
IllegalArgumentException
-
hasValue
- Specified by:
hasValue
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>
- Overrides:
hasValue
in classPrimitiveType<byte[]>
-
isEmpty
- Specified by:
isEmpty
in interfaceorg.hl7.fhir.instance.model.api.IBase
- Overrides:
isEmpty
in classPrimitiveType<byte[]>
-
primitiveValue
- Overrides:
primitiveValue
in classPrimitiveType<byte[]>
- Returns:
- the primitive value if there is one, as a string irrespective of the actual type (e.g. dates converted to their FHIR string representation) return null if the value is not a primitive or there is no value (might be extensions instead)
-
checkValidBase64
Checks if the passed in String is a validBase64
encoded String. Will throw aDataFormatException
if not formatted correctly.- Parameters:
toCheck
-String
to check if validBase64
- Throws:
DataFormatException
-