Class Attachment.Builder

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

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

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

      public final Attachment.Builder setFallback(Optional<String> fallback)
      Initializes the optional value fallback to fallback.
      Parameters:
      fallback - The value for fallback
      Returns:
      this builder for use in a chained invocation
    • setColor

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

      public final Attachment.Builder setColor(Optional<String> color)
      Initializes the optional value color to color.
      Parameters:
      color - The value for color
      Returns:
      this builder for use in a chained invocation
    • setPretext

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

      public final Attachment.Builder setPretext(Optional<String> pretext)
      Initializes the optional value pretext to pretext.
      Parameters:
      pretext - The value for pretext
      Returns:
      this builder for use in a chained invocation
    • setAuthorName

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

      public final Attachment.Builder setAuthorName(Optional<String> authorName)
      Initializes the optional value authorName to authorName.
      Parameters:
      authorName - The value for authorName
      Returns:
      this builder for use in a chained invocation
    • setAuthorLink

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

      public final Attachment.Builder setAuthorLink(Optional<String> authorLink)
      Initializes the optional value authorLink to authorLink.
      Parameters:
      authorLink - The value for authorLink
      Returns:
      this builder for use in a chained invocation
    • setAuthorIcon

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

      public final Attachment.Builder setAuthorIcon(Optional<String> authorIcon)
      Initializes the optional value authorIcon to authorIcon.
      Parameters:
      authorIcon - The value for authorIcon
      Returns:
      this builder for use in a chained invocation
    • setTitle

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

      public final Attachment.Builder setTitle(Optional<String> title)
      Initializes the optional value title to title.
      Parameters:
      title - The value for title
      Returns:
      this builder for use in a chained invocation
    • setTitleLink

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

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

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

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

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

      public final Attachment.Builder setImageUrl(Optional<String> imageUrl)
      Initializes the optional value imageUrl to imageUrl.
      Parameters:
      imageUrl - The value for imageUrl
      Returns:
      this builder for use in a chained invocation
    • setAttachmentType

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

      public final Attachment.Builder setAttachmentType(Optional<String> attachmentType)
      Initializes the optional value attachmentType to attachmentType.
      Parameters:
      attachmentType - The value for attachmentType
      Returns:
      this builder for use in a chained invocation
    • addFields

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

      public final Attachment.Builder addFields(Field... elements)
      Adds elements to fields list.
      Parameters:
      elements - An array of fields elements
      Returns:
      this builder for use in a chained invocation
    • setFields

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

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

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

      public final Attachment.Builder setFooter(Optional<String> footer)
      Initializes the optional value footer to footer.
      Parameters:
      footer - The value for footer
      Returns:
      this builder for use in a chained invocation
    • setFooterIcon

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

      public final Attachment.Builder setFooterIcon(Optional<String> footerIcon)
      Initializes the optional value footerIcon to footerIcon.
      Parameters:
      footerIcon - The value for footerIcon
      Returns:
      this builder for use in a chained invocation
    • setThumbUrl

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

      public final Attachment.Builder setThumbUrl(Optional<String> thumbUrl)
      Initializes the optional value thumbUrl to thumbUrl.
      Parameters:
      thumbUrl - The value for thumbUrl
      Returns:
      this builder for use in a chained invocation
    • setEpochSeconds

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

      public final Attachment.Builder setEpochSeconds(Optional<String> epochSeconds)
      Initializes the optional value epochSeconds to epochSeconds.
      Parameters:
      epochSeconds - The value for epochSeconds
      Returns:
      this builder for use in a chained invocation
    • setCallbackId

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

      public final Attachment.Builder setCallbackId(Optional<String> callbackId)
      Initializes the optional value callbackId to callbackId.
      Parameters:
      callbackId - The value for callbackId
      Returns:
      this builder for use in a chained invocation
    • addActions

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

      public final Attachment.Builder addActions(Action... elements)
      Adds elements to actions list.
      Parameters:
      elements - An array of actions elements
      Returns:
      this builder for use in a chained invocation
    • setActions

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

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

      public final Attachment.Builder addMrkdwnIn(String element)
      Adds one element to mrkdwnIn set.
      Parameters:
      element - A mrkdwnIn element
      Returns:
      this builder for use in a chained invocation
    • addMrkdwnIn

      public final Attachment.Builder addMrkdwnIn(String... elements)
      Adds elements to mrkdwnIn set.
      Parameters:
      elements - An array of mrkdwnIn elements
      Returns:
      this builder for use in a chained invocation
    • setMrkdwnIn

      public final Attachment.Builder setMrkdwnIn(Iterable<String> elements)
      Sets or replaces all elements for mrkdwnIn set.
      Parameters:
      elements - An iterable of mrkdwnIn elements
      Returns:
      this builder for use in a chained invocation
    • addAllMrkdwnIn

      public final Attachment.Builder addAllMrkdwnIn(Iterable<String> elements)
      Adds elements to mrkdwnIn set.
      Parameters:
      elements - An iterable of mrkdwnIn elements
      Returns:
      this builder for use in a chained invocation
    • addBlocks

      public final Attachment.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 Attachment.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 Attachment.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 Attachment.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
    • build

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