Class Message.Builder

java.lang.Object
com.hubspot.slack.client.models.Message.Builder
Enclosing class:
Message

@Generated(from="MessageIF", generator="Immutables") @NotThreadSafe public static final class Message.Builder extends Object
Builds instances of type Message. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      public final Message.Builder from(MessageIF instance)
      Fill a builder with attribute values from the provided MessageIF instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • setType

      public final Message.Builder setType(String type)
      Initializes the value for the type attribute.
      Parameters:
      type - The value for type
      Returns:
      this builder for use in a chained invocation
    • setTeam

      public final Message.Builder setTeam(String team)
      Initializes the value for the team attribute.
      Parameters:
      team - The value for team
      Returns:
      this builder for use in a chained invocation
    • setChannel

      public final Message.Builder setChannel(SlackChannel channel)
      Initializes the value for the channel attribute.
      Parameters:
      channel - The value for channel
      Returns:
      this builder for use in a chained invocation
    • setUser

      public final Message.Builder setUser(@Nullable String user)
      Initializes the optional value user to user.
      Parameters:
      user - The value for user, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setUser

      public final Message.Builder setUser(Optional<String> user)
      Initializes the optional value user to user.
      Parameters:
      user - The value for user
      Returns:
      this builder for use in a chained invocation
    • setUsername

      public final Message.Builder setUsername(String username)
      Initializes the value for the username attribute.
      Parameters:
      username - The value for username
      Returns:
      this builder for use in a chained invocation
    • setTimestamp

      public final Message.Builder setTimestamp(String timestamp)
      Initializes the value for the timestamp attribute.
      Parameters:
      timestamp - The value for timestamp
      Returns:
      this builder for use in a chained invocation
    • setText

      public final Message.Builder setText(String text)
      Initializes the value for the text attribute.
      Parameters:
      text - The value for text
      Returns:
      this builder for use in a chained invocation
    • setPermalink

      public final Message.Builder setPermalink(@Nullable String permalink)
      Initializes the optional value permalink to permalink.
      Parameters:
      permalink - The value for permalink, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setPermalink

      public final Message.Builder setPermalink(Optional<String> permalink)
      Initializes the optional value permalink to permalink.
      Parameters:
      permalink - The value for permalink
      Returns:
      this builder for use in a chained invocation
    • addAttachments

      public final Message.Builder addAttachments(Attachment element)
      Adds one element to attachments list.
      Parameters:
      element - A attachments element
      Returns:
      this builder for use in a chained invocation
    • addAttachments

      public final Message.Builder addAttachments(Attachment... elements)
      Adds elements to attachments list.
      Parameters:
      elements - An array of attachments elements
      Returns:
      this builder for use in a chained invocation
    • setAttachments

      public final Message.Builder setAttachments(Iterable<? extends Attachment> elements)
      Sets or replaces all elements for attachments list.
      Parameters:
      elements - An iterable of attachments elements
      Returns:
      this builder for use in a chained invocation
    • addAllAttachments

      public final Message.Builder addAllAttachments(Iterable<? extends Attachment> elements)
      Adds elements to attachments list.
      Parameters:
      elements - An iterable of attachments elements
      Returns:
      this builder for use in a chained invocation
    • setPreviousPrevious

      public final Message.Builder setPreviousPrevious(@Nullable LiteMessage previousPrevious)
      Initializes the optional value previousPrevious to previousPrevious.
      Parameters:
      previousPrevious - The value for previousPrevious, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setPreviousPrevious

      public final Message.Builder setPreviousPrevious(Optional<? extends LiteMessage> previousPrevious)
      Initializes the optional value previousPrevious to previousPrevious.
      Parameters:
      previousPrevious - The value for previousPrevious
      Returns:
      this builder for use in a chained invocation
    • setPrevious

      public final Message.Builder setPrevious(@Nullable LiteMessage previous)
      Initializes the optional value previous to previous.
      Parameters:
      previous - The value for previous, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setPrevious

      public final Message.Builder setPrevious(Optional<? extends LiteMessage> previous)
      Initializes the optional value previous to previous.
      Parameters:
      previous - The value for previous
      Returns:
      this builder for use in a chained invocation
    • setNext

      public final Message.Builder setNext(@Nullable LiteMessage next)
      Initializes the optional value next to next.
      Parameters:
      next - The value for next, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setNext

      public final Message.Builder setNext(Optional<? extends LiteMessage> next)
      Initializes the optional value next to next.
      Parameters:
      next - The value for next
      Returns:
      this builder for use in a chained invocation
    • setNextNext

      public final Message.Builder setNextNext(@Nullable LiteMessage nextNext)
      Initializes the optional value nextNext to nextNext.
      Parameters:
      nextNext - The value for nextNext, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setNextNext

      public final Message.Builder setNextNext(Optional<? extends LiteMessage> nextNext)
      Initializes the optional value nextNext to nextNext.
      Parameters:
      nextNext - The value for nextNext
      Returns:
      this builder for use in a chained invocation
    • build

      public Message build()
      Builds a new Message.
      Returns:
      An immutable instance of Message
      Throws:
      com.hubspot.immutables.validation.InvalidImmutableStateException - if any required attributes are missing