Class Message.MessageBuilder
java.lang.Object
com.symphony.bdk.core.service.message.model.Message.MessageBuilder
- Enclosing class:
- Message
Message
class builder. Accessible via Message.builder()
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAttachment
(InputStream attachment, InputStream preview, String filename) Add attachment (with preview) to the message.addAttachment
(InputStream content, String filename) Add attachment to the message.build()
Create aMessage
using the configuration within the builder.Add messageML content to the message.Add data to the message.template
(com.symphony.bdk.template.api.Template template) Add content from a static template to the message.Add content from a template to the message.
-
Constructor Details
-
MessageBuilder
public MessageBuilder()
-
-
Method Details
-
content
Add messageML content to the message.- Parameters:
message
- messageML.- Returns:
- this builder with the content configured.
-
template
public Message.MessageBuilder template(@Nonnull com.symphony.bdk.template.api.Template template, @Nonnull Object parameters) Add content from a template to the message.- Parameters:
template
- a custom or built-in template.parameters
- parameters to be used in the template.- Returns:
- this builder with the content configured.
-
template
Add content from a static template to the message.- Parameters:
template
- a custom or built-in template.- Returns:
- this builder with the content configured.
-
data
Add data to the message.- Parameters:
data
- Serializable data object.- Returns:
- this builder with the data configured.
-
silent
-
addAttachment
Add attachment to the message.- Parameters:
content
- Attachment content.filename
- Filename of the attachment.- Returns:
- this builder with the data configured.
-
addAttachment
public Message.MessageBuilder addAttachment(@Nonnull InputStream attachment, @Nonnull InputStream preview, @Nonnull String filename) Add attachment (with preview) to the message.- Parameters:
attachment
- Input stream of the attachment content.preview
- Optional attachment preview.filename
- Filename of the attachment.- Returns:
- this builder with the data configured.
-
build
Create aMessage
using the configuration within the builder.- Returns:
- constructed
Message
using configuration within this builder. - Throws:
MessageCreationException
- if mandatory content is empty.
-