Class Message.MessageBuilder

java.lang.Object
com.symphony.bdk.core.service.message.model.Message.MessageBuilder
Enclosing class:
Message

@API(status=STABLE) public static class Message.MessageBuilder extends Object
Message class builder. Accessible via Message.builder().
  • Constructor Details

    • MessageBuilder

      public MessageBuilder()
  • Method Details

    • content

      public Message.MessageBuilder content(@Nonnull String message)
      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

      public Message.MessageBuilder template(@Nonnull com.symphony.bdk.template.api.Template 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

      public Message.MessageBuilder data(@Nonnull Object data)
      Add data to the message.
      Parameters:
      data - Serializable data object.
      Returns:
      this builder with the data configured.
    • silent

      public Message.MessageBuilder silent(@Nonnull Boolean silent)
    • addAttachment

      public Message.MessageBuilder addAttachment(@Nonnull InputStream content, @Nonnull String filename)
      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

      public Message build()
      Create a Message using the configuration within the builder.
      Returns:
      constructed Message using configuration within this builder.
      Throws:
      MessageCreationException - if mandatory content is empty.