Class LiteMessage.Builder

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

@Generated(from="LiteMessageIF", generator="Immutables") @NotThreadSafe public static final class LiteMessage.Builder extends Object
Builds instances of type LiteMessage. 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 LiteMessage.Builder from(LiteMessageIF instance)
      Fill a builder with attribute values from the provided LiteMessageIF 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 LiteMessage.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
    • setSubtype

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

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

      public final LiteMessage.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 LiteMessage.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
    • setBotId

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

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

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

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

      public final LiteMessage.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
    • addAttachments

      public final LiteMessage.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 LiteMessage.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 LiteMessage.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 LiteMessage.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
    • addFiles

      public final LiteMessage.Builder addFiles(SlackFile element)
      Adds one element to files list.
      Parameters:
      element - A files element
      Returns:
      this builder for use in a chained invocation
    • addFiles

      public final LiteMessage.Builder addFiles(SlackFile... elements)
      Adds elements to files list.
      Parameters:
      elements - An array of files elements
      Returns:
      this builder for use in a chained invocation
    • setFiles

      public final LiteMessage.Builder setFiles(Iterable<? extends SlackFile> elements)
      Sets or replaces all elements for files list.
      Parameters:
      elements - An iterable of files elements
      Returns:
      this builder for use in a chained invocation
    • addAllFiles

      public final LiteMessage.Builder addAllFiles(Iterable<? extends SlackFile> elements)
      Adds elements to files list.
      Parameters:
      elements - An iterable of files elements
      Returns:
      this builder for use in a chained invocation
    • addBlocks

      public final LiteMessage.Builder addBlocks(Block element)
      Adds one element to blocks list.
      Parameters:
      element - A blocks element
      Returns:
      this builder for use in a chained invocation
    • addBlocks

      public final LiteMessage.Builder addBlocks(Block... elements)
      Adds elements to blocks list.
      Parameters:
      elements - An array of blocks elements
      Returns:
      this builder for use in a chained invocation
    • setBlocks

      public final LiteMessage.Builder setBlocks(Iterable<? extends Block> elements)
      Sets or replaces all elements for blocks list.
      Parameters:
      elements - An iterable of blocks elements
      Returns:
      this builder for use in a chained invocation
    • addAllBlocks

      public final LiteMessage.Builder addAllBlocks(Iterable<? extends Block> elements)
      Adds elements to blocks list.
      Parameters:
      elements - An iterable of blocks elements
      Returns:
      this builder for use in a chained invocation
    • addReactions

      public final LiteMessage.Builder addReactions(Reaction element)
      Adds one element to reactions list.
      Parameters:
      element - A reactions element
      Returns:
      this builder for use in a chained invocation
    • addReactions

      public final LiteMessage.Builder addReactions(Reaction... elements)
      Adds elements to reactions list.
      Parameters:
      elements - An array of reactions elements
      Returns:
      this builder for use in a chained invocation
    • setReactions

      public final LiteMessage.Builder setReactions(Iterable<? extends Reaction> elements)
      Sets or replaces all elements for reactions list.
      Parameters:
      elements - An iterable of reactions elements
      Returns:
      this builder for use in a chained invocation
    • addAllReactions

      public final LiteMessage.Builder addAllReactions(Iterable<? extends Reaction> elements)
      Adds elements to reactions list.
      Parameters:
      elements - An iterable of reactions elements
      Returns:
      this builder for use in a chained invocation
    • setTimestamp

      public final LiteMessage.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
    • setThreadTimestamp

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

      public final LiteMessage.Builder setThreadTimestamp(Optional<String> threadTimestamp)
      Initializes the optional value threadTimestamp to threadTimestamp.
      Parameters:
      threadTimestamp - The value for threadTimestamp
      Returns:
      this builder for use in a chained invocation
    • setReplyCount

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

      public final LiteMessage.Builder setReplyCount(Optional<Integer> replyCount)
      Initializes the optional value replyCount to replyCount.
      Parameters:
      replyCount - The value for replyCount
      Returns:
      this builder for use in a chained invocation
    • setReplyUserIds

      public final LiteMessage.Builder setReplyUserIds(@Nullable List<String> replyUserIds)
      Initializes the optional value replyUserIds to replyUserIds.
      Parameters:
      replyUserIds - The value for replyUserIds, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setReplyUserIds

      public final LiteMessage.Builder setReplyUserIds(Optional<? extends List<String>> replyUserIds)
      Initializes the optional value replyUserIds to replyUserIds.
      Parameters:
      replyUserIds - The value for replyUserIds
      Returns:
      this builder for use in a chained invocation
    • setReplyUsersCount

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

      public final LiteMessage.Builder setReplyUsersCount(Optional<Integer> replyUsersCount)
      Initializes the optional value replyUsersCount to replyUsersCount.
      Parameters:
      replyUsersCount - The value for replyUsersCount
      Returns:
      this builder for use in a chained invocation
    • setLatestReplyTimestamp

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

      public final LiteMessage.Builder setLatestReplyTimestamp(Optional<String> latestReplyTimestamp)
      Initializes the optional value latestReplyTimestamp to latestReplyTimestamp.
      Parameters:
      latestReplyTimestamp - The value for latestReplyTimestamp
      Returns:
      this builder for use in a chained invocation
    • build

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