
Package org.hl7.fhir.dstu3.model
Class Base64BinaryType
- 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<byte[]>
-
- org.hl7.fhir.dstu3.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Base64BinaryType()
ConstructorBase64BinaryType(byte[] theBytes)
Base64BinaryType(String theValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkValidBase64(String toCheck)
Checks if the passed in String is a validBase64
encoded String.Base64BinaryType
copy()
protected String
encode(byte[] theValue)
Subclasses must override to convert a "coerced" value into an encoded one.String
fhirType()
byte[]
getValue()
String
getValueAsString()
boolean
hasValue()
boolean
isEmpty()
protected byte[]
parse(String theValue)
Subclasses must override to convert an encoded representation of this datatype into a "coerced" onevoid
readExternal(ObjectInput in)
Base64BinaryType
setValue(byte[] theValue)
void
setValueAsString(String theValue)
protected Type
typedCopy()
void
writeExternal(ObjectOutput out)
-
Methods inherited from class org.hl7.fhir.dstu3.model.PrimitiveType
asStringValue, equalsDeep, equalsShallow, fromStringValue, getProperty, hashCode, hasPrimitiveValue, isPrimitive, primitiveValue, setProperty, setProperty, toString, updateStringValue
-
Methods inherited from class org.hl7.fhir.dstu3.model.Element
addChild, addExtension, addExtension, addExtension, copyValues, 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
getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, setUserData
-
-
-
-
Constructor Detail
-
Base64BinaryType
public Base64BinaryType()
Constructor
-
Base64BinaryType
public Base64BinaryType(byte[] theBytes)
-
Base64BinaryType
public Base64BinaryType(String theValue)
-
-
Method Detail
-
parse
protected byte[] parse(String theValue)
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
protected String encode(byte[] theValue)
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
public Base64BinaryType copy()
- Specified by:
copy
in classPrimitiveType<byte[]>
-
typedCopy
protected Type typedCopy()
- Overrides:
typedCopy
in classPrimitiveType<byte[]>
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classPrimitiveType<byte[]>
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classPrimitiveType<byte[]>
- Throws:
IOException
ClassNotFoundException
-
getValueAsString
public String getValueAsString()
- Specified by:
getValueAsString
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>
- Overrides:
getValueAsString
in classPrimitiveType<byte[]>
-
setValueAsString
public void setValueAsString(String theValue) throws IllegalArgumentException
- Specified by:
setValueAsString
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>
- Overrides:
setValueAsString
in classPrimitiveType<byte[]>
- Throws:
IllegalArgumentException
-
getValue
public byte[] getValue()
- Specified by:
getValue
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>
- Overrides:
getValue
in classPrimitiveType<byte[]>
-
setValue
public Base64BinaryType setValue(byte[] theValue) throws IllegalArgumentException
- Specified by:
setValue
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>
- Overrides:
setValue
in classPrimitiveType<byte[]>
- Throws:
IllegalArgumentException
-
hasValue
public boolean hasValue()
- Specified by:
hasValue
in interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>
- Overrides:
hasValue
in classPrimitiveType<byte[]>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceorg.hl7.fhir.instance.model.api.IBase
- Overrides:
isEmpty
in classPrimitiveType<byte[]>
-
checkValidBase64
public void checkValidBase64(String toCheck) throws ca.uhn.fhir.parser.DataFormatException
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:
ca.uhn.fhir.parser.DataFormatException
-
-