Package com.ibm.fhir.model.type
Class Attachment.Builder
- java.lang.Object
-
- com.ibm.fhir.model.builder.AbstractBuilder<Element>
-
- com.ibm.fhir.model.type.Element.Builder
-
- com.ibm.fhir.model.type.Attachment.Builder
-
- Enclosing class:
- Attachment
public static class Attachment.Builder extends Element.Builder
-
-
Field Summary
-
Fields inherited from class com.ibm.fhir.model.type.Element.Builder
extension, id
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Attachmentbuild()Build theAttachmentAttachment.BuildercontentType(Code contentType)Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data.Attachment.Buildercreation(DateTime creation)The date that the attachment was first created.Attachment.Builderdata(Base64Binary data)The actual data of the attachment - a sequence of bytes, base64 encoded.Attachment.Builderextension(Extension... extension)May be used to represent additional information that is not part of the basic definition of the element.Attachment.Builderextension(Collection<Extension> extension)May be used to represent additional information that is not part of the basic definition of the element.protected Attachment.Builderfrom(Attachment attachment)Attachment.Builderhash(Base64Binary hash)The calculated hash of the data using SHA-1.Attachment.Builderid(String id)Unique id for the element within a resource (for internal references).Attachment.Builderlanguage(Code language)The human language of the content.Attachment.Buildersize(UnsignedInt size)The number of bytes of data that make up this attachment (before base64 encoding, if that is done).Attachment.Buildertitle(String title)A label or set of text to display in place of the data.Attachment.Builderurl(Url url)A location where the data can be accessed.-
Methods inherited from class com.ibm.fhir.model.type.Element.Builder
from
-
-
-
-
Method Detail
-
id
public Attachment.Builder id(String id)
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.- Overrides:
idin classElement.Builder- Parameters:
id- Unique id for inter-element referencing- Returns:
- A reference to this Builder instance
-
extension
public Attachment.Builder extension(Extension... extension)
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.Adds new element(s) to the existing list
- Overrides:
extensionin classElement.Builder- Parameters:
extension- Additional content defined by implementations- Returns:
- A reference to this Builder instance
-
extension
public Attachment.Builder extension(Collection<Extension> extension)
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.Replaces the existing list with a new one containing elements from the Collection
- Overrides:
extensionin classElement.Builder- Parameters:
extension- Additional content defined by implementations- Returns:
- A reference to this Builder instance
-
contentType
public Attachment.Builder contentType(Code contentType)
Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.- Parameters:
contentType- Mime type of the content, with charset etc.- Returns:
- A reference to this Builder instance
-
language
public Attachment.Builder language(Code language)
The human language of the content. The value can be any valid value according to BCP 47.- Parameters:
language- Human language of the content (BCP-47)- Returns:
- A reference to this Builder instance
-
data
public Attachment.Builder data(Base64Binary data)
The actual data of the attachment - a sequence of bytes, base64 encoded.- Parameters:
data- Data inline, base64ed- Returns:
- A reference to this Builder instance
-
url
public Attachment.Builder url(Url url)
A location where the data can be accessed.- Parameters:
url- Uri where the data can be found- Returns:
- A reference to this Builder instance
-
size
public Attachment.Builder size(UnsignedInt size)
The number of bytes of data that make up this attachment (before base64 encoding, if that is done).- Parameters:
size- Number of bytes of content (if url provided)- Returns:
- A reference to this Builder instance
-
hash
public Attachment.Builder hash(Base64Binary hash)
The calculated hash of the data using SHA-1. Represented using base64.- Parameters:
hash- Hash of the data (sha-1, base64ed)- Returns:
- A reference to this Builder instance
-
title
public Attachment.Builder title(String title)
A label or set of text to display in place of the data.- Parameters:
title- Label to display in place of the data- Returns:
- A reference to this Builder instance
-
creation
public Attachment.Builder creation(DateTime creation)
The date that the attachment was first created.- Parameters:
creation- Date attachment was first created- Returns:
- A reference to this Builder instance
-
build
public Attachment build()
Build theAttachment- Specified by:
buildin interfaceBuilder<Element>- Specified by:
buildin classElement.Builder- Returns:
- An immutable object of type
Attachment - Throws:
IllegalStateException- if the current state cannot be built into a valid Attachment per the base specification
-
from
protected Attachment.Builder from(Attachment attachment)
-
-