Package org.hl7.fhir.r4.model
Class Base64BinaryType
- 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<byte[]>
-
- org.hl7.fhir.r4.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 voidcheckValidBase64(String toCheck)Checks if the passed in String is a validBase64encoded String.Base64BinaryTypecopy()protected Stringencode(byte[] theValue)Subclasses must override to convert a "coerced" value into an encoded one.StringfhirType()byte[]getValue()StringgetValueAsString()booleanhasValue()booleanisEmpty()protected byte[]parse(String theValue)Subclasses must override to convert an encoded representation of this datatype into a "coerced" onevoidreadExternal(ObjectInput in)Base64BinaryTypesetValue(byte[] theValue)voidsetValueAsString(String theValue)protected TypetypedCopy()voidwriteExternal(ObjectOutput out)-
Methods inherited from class org.hl7.fhir.r4.model.PrimitiveType
asStringValue, equalsDeep, equalsShallow, forceStringValue, fromStringValue, getProperty, getTypesForProperty, hashCode, hasPrimitiveValue, isPrimitive, makeProperty, primitiveValue, setProperty, setProperty, toString, updateStringValue
-
Methods inherited from class org.hl7.fhir.r4.model.Element
addChild, addExtension, addExtension, addExtension, copyValues, 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
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:PrimitiveTypeSubclasses must override to convert an encoded representation of this datatype into a "coerced" one- Specified by:
parsein 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:PrimitiveTypeSubclasses must override to convert a "coerced" value into an encoded one.- Specified by:
encodein 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:
copyin classPrimitiveType<byte[]>
-
typedCopy
protected Type typedCopy()
- Overrides:
typedCopyin classPrimitiveType<byte[]>
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classPrimitiveType<byte[]>- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classPrimitiveType<byte[]>- Throws:
IOExceptionClassNotFoundException
-
getValueAsString
public String getValueAsString()
- Specified by:
getValueAsStringin interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>- Overrides:
getValueAsStringin classPrimitiveType<byte[]>
-
setValueAsString
public void setValueAsString(String theValue) throws IllegalArgumentException
- Specified by:
setValueAsStringin interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>- Overrides:
setValueAsStringin classPrimitiveType<byte[]>- Throws:
IllegalArgumentException
-
getValue
public byte[] getValue()
- Specified by:
getValuein interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>- Overrides:
getValuein classPrimitiveType<byte[]>
-
setValue
public Base64BinaryType setValue(byte[] theValue) throws IllegalArgumentException
- Specified by:
setValuein interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>- Overrides:
setValuein classPrimitiveType<byte[]>- Throws:
IllegalArgumentException
-
hasValue
public boolean hasValue()
- Specified by:
hasValuein interfaceorg.hl7.fhir.instance.model.api.IPrimitiveType<byte[]>- Overrides:
hasValuein classPrimitiveType<byte[]>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceorg.hl7.fhir.instance.model.api.IBase- Overrides:
isEmptyin classPrimitiveType<byte[]>
-
checkValidBase64
public void checkValidBase64(String toCheck) throws ca.uhn.fhir.parser.DataFormatException
Checks if the passed in String is a validBase64encoded String. Will throw aDataFormatExceptionif not formatted correctly.- Parameters:
toCheck-Stringto check if validBase64- Throws:
ca.uhn.fhir.parser.DataFormatException
-
-