Class Attachment

java.lang.Object
com.hubspot.slack.client.models.Attachment
All Implemented Interfaces:
AttachmentIF, BlockOrAttachment, ChatUnfurlBlocksOrAttachment

@Generated(from="AttachmentIF", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class Attachment extends Object implements AttachmentIF
Immutable implementation of AttachmentIF.

Use the builder to create immutable instances: Attachment.builder().

  • Method Details

    • getFallback

      public Optional<String> getFallback()
      Specified by:
      getFallback in interface AttachmentIF
      Returns:
      The value of the fallback attribute
    • getColor

      public Optional<String> getColor()
      Specified by:
      getColor in interface AttachmentIF
      Returns:
      The value of the color attribute
    • getPretext

      public Optional<String> getPretext()
      Specified by:
      getPretext in interface AttachmentIF
      Returns:
      The value of the pretext attribute
    • getAuthorName

      public Optional<String> getAuthorName()
      Specified by:
      getAuthorName in interface AttachmentIF
      Returns:
      The value of the authorName attribute
    • getAuthorLink

      public Optional<String> getAuthorLink()
      Specified by:
      getAuthorLink in interface AttachmentIF
      Returns:
      The value of the authorLink attribute
    • getAuthorIcon

      public Optional<String> getAuthorIcon()
      Specified by:
      getAuthorIcon in interface AttachmentIF
      Returns:
      The value of the authorIcon attribute
    • getTitle

      public Optional<String> getTitle()
      Specified by:
      getTitle in interface AttachmentIF
      Returns:
      The value of the title attribute
    • getTitleLink

      public Optional<String> getTitleLink()
      Specified by:
      getTitleLink in interface AttachmentIF
      Returns:
      The value of the titleLink attribute
    • getText

      public Optional<String> getText()
      Specified by:
      getText in interface AttachmentIF
      Returns:
      The value of the text attribute
    • getImageUrl

      public Optional<String> getImageUrl()
      Specified by:
      getImageUrl in interface AttachmentIF
      Returns:
      The value of the imageUrl attribute
    • getAttachmentType

      public Optional<String> getAttachmentType()
      Specified by:
      getAttachmentType in interface AttachmentIF
      Returns:
      The value of the attachmentType attribute
    • getFields

      public List<Field> getFields()
      Specified by:
      getFields in interface AttachmentIF
      Returns:
      The value of the fields attribute
    • getFooter

      public Optional<String> getFooter()
      Specified by:
      getFooter in interface AttachmentIF
      Returns:
      The value of the footer attribute
    • getFooterIcon

      public Optional<String> getFooterIcon()
      Specified by:
      getFooterIcon in interface AttachmentIF
      Returns:
      The value of the footerIcon attribute
    • getThumbUrl

      public Optional<String> getThumbUrl()
      Specified by:
      getThumbUrl in interface AttachmentIF
      Returns:
      The value of the thumbUrl attribute
    • getEpochSeconds

      public Optional<String> getEpochSeconds()
      Specified by:
      getEpochSeconds in interface AttachmentIF
      Returns:
      The value of the epochSeconds attribute
    • getCallbackId

      public Optional<String> getCallbackId()
      Specified by:
      getCallbackId in interface AttachmentIF
      Returns:
      The value of the callbackId attribute
    • getActions

      public List<Action> getActions()
      Specified by:
      getActions in interface AttachmentIF
      Returns:
      The value of the actions attribute
    • getMrkdwnIn

      public Set<String> getMrkdwnIn()
      Slack will only markdown in fields whose names are included in this set. See MarkdownSupportedFields
      Specified by:
      getMrkdwnIn in interface AttachmentIF
    • getBlocks

      public List<Block> getBlocks()
      Specified by:
      getBlocks in interface AttachmentIF
      Returns:
      The value of the blocks attribute
    • withFallback

      public final Attachment withFallback(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional fallback attribute.
      Parameters:
      value - The value for fallback, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withFallback

      public final Attachment withFallback(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the fallback attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for fallback
      Returns:
      A modified copy or this if not changed
    • withColor

      public final Attachment withColor(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional color attribute.
      Parameters:
      value - The value for color, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withColor

      public final Attachment withColor(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the color attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for color
      Returns:
      A modified copy or this if not changed
    • withPretext

      public final Attachment withPretext(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional pretext attribute.
      Parameters:
      value - The value for pretext, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withPretext

      public final Attachment withPretext(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the pretext attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for pretext
      Returns:
      A modified copy or this if not changed
    • withAuthorName

      public final Attachment withAuthorName(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional authorName attribute.
      Parameters:
      value - The value for authorName, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withAuthorName

      public final Attachment withAuthorName(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the authorName attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for authorName
      Returns:
      A modified copy or this if not changed
    • withAuthorLink

      public final Attachment withAuthorLink(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional authorLink attribute.
      Parameters:
      value - The value for authorLink, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withAuthorLink

      public final Attachment withAuthorLink(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the authorLink attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for authorLink
      Returns:
      A modified copy or this if not changed
    • withAuthorIcon

      public final Attachment withAuthorIcon(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional authorIcon attribute.
      Parameters:
      value - The value for authorIcon, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withAuthorIcon

      public final Attachment withAuthorIcon(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the authorIcon attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for authorIcon
      Returns:
      A modified copy or this if not changed
    • withTitle

      public final Attachment withTitle(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional title attribute.
      Parameters:
      value - The value for title, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withTitle

      public final Attachment withTitle(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the title attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for title
      Returns:
      A modified copy or this if not changed
    • withTitleLink

      public final Attachment withTitleLink(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional titleLink attribute.
      Parameters:
      value - The value for titleLink, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withTitleLink

      public final Attachment withTitleLink(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the titleLink attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for titleLink
      Returns:
      A modified copy or this if not changed
    • withText

      public final Attachment withText(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional text attribute.
      Parameters:
      value - The value for text, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withText

      public final Attachment withText(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the text attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for text
      Returns:
      A modified copy or this if not changed
    • withImageUrl

      public final Attachment withImageUrl(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional imageUrl attribute.
      Parameters:
      value - The value for imageUrl, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withImageUrl

      public final Attachment withImageUrl(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the imageUrl attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for imageUrl
      Returns:
      A modified copy or this if not changed
    • withAttachmentType

      public final Attachment withAttachmentType(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional attachmentType attribute.
      Parameters:
      value - The value for attachmentType, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withAttachmentType

      public final Attachment withAttachmentType(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the attachmentType attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for attachmentType
      Returns:
      A modified copy or this if not changed
    • withFields

      public final Attachment withFields(Field... elements)
      Copy the current immutable object with elements that replace the content of fields.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withFields

      public final Attachment withFields(Iterable<? extends Field> elements)
      Copy the current immutable object with elements that replace the content of fields. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of fields elements to set
      Returns:
      A modified copy or this if not changed
    • withFooter

      public final Attachment withFooter(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional footer attribute.
      Parameters:
      value - The value for footer, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withFooter

      public final Attachment withFooter(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the footer attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for footer
      Returns:
      A modified copy or this if not changed
    • withFooterIcon

      public final Attachment withFooterIcon(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional footerIcon attribute.
      Parameters:
      value - The value for footerIcon, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withFooterIcon

      public final Attachment withFooterIcon(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the footerIcon attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for footerIcon
      Returns:
      A modified copy or this if not changed
    • withThumbUrl

      public final Attachment withThumbUrl(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional thumbUrl attribute.
      Parameters:
      value - The value for thumbUrl, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withThumbUrl

      public final Attachment withThumbUrl(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the thumbUrl attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for thumbUrl
      Returns:
      A modified copy or this if not changed
    • withEpochSeconds

      public final Attachment withEpochSeconds(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional epochSeconds attribute.
      Parameters:
      value - The value for epochSeconds, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withEpochSeconds

      public final Attachment withEpochSeconds(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the epochSeconds attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for epochSeconds
      Returns:
      A modified copy or this if not changed
    • withCallbackId

      public final Attachment withCallbackId(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional callbackId attribute.
      Parameters:
      value - The value for callbackId, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withCallbackId

      public final Attachment withCallbackId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the callbackId attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for callbackId
      Returns:
      A modified copy or this if not changed
    • withActions

      public final Attachment withActions(Action... elements)
      Copy the current immutable object with elements that replace the content of actions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withActions

      public final Attachment withActions(Iterable<? extends Action> elements)
      Copy the current immutable object with elements that replace the content of actions. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of actions elements to set
      Returns:
      A modified copy or this if not changed
    • withMrkdwnIn

      public final Attachment withMrkdwnIn(String... elements)
      Copy the current immutable object with elements that replace the content of mrkdwnIn.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withMrkdwnIn

      public final Attachment withMrkdwnIn(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of mrkdwnIn. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of mrkdwnIn elements to set
      Returns:
      A modified copy or this if not changed
    • withBlocks

      public final Attachment withBlocks(Block... elements)
      Copy the current immutable object with elements that replace the content of blocks.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withBlocks

      public final Attachment withBlocks(Iterable<? extends Block> elements)
      Copy the current immutable object with elements that replace the content of blocks. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of blocks elements to set
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of Attachment that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: fallback, color, pretext, authorName, authorLink, authorIcon, title, titleLink, text, imageUrl, attachmentType, fields, footer, footerIcon, thumbUrl, epochSeconds, callbackId, actions, mrkdwnIn, blocks.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Attachment with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static Attachment copyOf(AttachmentIF instance)
      Creates an immutable copy of a AttachmentIF value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable Attachment instance
    • builder

      public static Attachment.Builder builder()
      Creates a builder for Attachment.
       Attachment.builder()
          .setFallback(Optional<String>) // optional fallback
          .setColor(Optional<String>) // optional color
          .setPretext(Optional<String>) // optional pretext
          .setAuthorName(Optional<String>) // optional authorName
          .setAuthorLink(Optional<String>) // optional authorLink
          .setAuthorIcon(Optional<String>) // optional authorIcon
          .setTitle(Optional<String>) // optional title
          .setTitleLink(Optional<String>) // optional titleLink
          .setText(Optional<String>) // optional text
          .setImageUrl(Optional<String>) // optional imageUrl
          .setAttachmentType(Optional<String>) // optional attachmentType
          .addFields|addAllFields(Field) // fields elements
          .setFooter(Optional<String>) // optional footer
          .setFooterIcon(Optional<String>) // optional footerIcon
          .setThumbUrl(Optional<String>) // optional thumbUrl
          .setEpochSeconds(Optional<String>) // optional epochSeconds
          .setCallbackId(Optional<String>) // optional callbackId
          .addActions|addAllActions(com.hubspot.slack.client.models.actions.Action) // actions elements
          .addMrkdwnIn|addAllMrkdwnIn(String) // mrkdwnIn elements
          .addBlocks|addAllBlocks(com.hubspot.slack.client.models.blocks.Block) // blocks elements
          .build();
       
      Returns:
      A new Attachment builder