Package dev.learning.xapi.model
Class Attachment.Builder
java.lang.Object
dev.learning.xapi.model.Attachment.Builder
- Enclosing class:
- Attachment
Builder for Attachment.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDescription(Locale key, String value) Adds a description of the Attachment.addDisplay(Locale key, String value) Adds a display value.content(byte[] content) Sets data of the Attachment.Sets data of the Attachment as a String.Sets SHA-2 hash of the Attachment.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
addDisplay
Adds a display value.- Parameters:
key- The key of the entry.value- The value of the entry.- Returns:
- This builder
- See Also:
-
Attachment.description
-
addDescription
Adds a description of the Attachment.- Parameters:
key- The key of the entry.value- The value of the entry.- Returns:
- This builder
- See Also:
-
Attachment.description
-
sha2
Sets SHA-2 hash of the Attachment.
The sha2 is set ONLY if the content property was not set yet. (otherwise the sha2 is calculated automatically)
- Parameters:
sha2- The SHA-2 hash of the Attachment data.- Returns:
- This builder
-
content
Sets data of the Attachment.
This method also automatically calculates the SHA-2 hash for the data.
- Parameters:
content- The data of the Attachment as a byte array.- Returns:
- This builder
-
content
Sets data of the Attachment as a String.
This is a convenient method for creating text attachments.
- Parameters:
content- The data of the Attachment as a String.- Returns:
- This builder
- See Also:
-