Package com.hubspot.slack.client.models
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().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Attachment.Builderbuilder()Creates a builder forAttachment.static AttachmentcopyOf(AttachmentIF instance) Creates an immutable copy of aAttachmentIFvalue.booleanThis instance is equal to all instances ofAttachmentthat have equal attribute values.getColor()Slack will only markdown in fields whose names are included in this set.getText()getTitle()inthashCode()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.toString()Prints the immutable valueAttachmentwith attribute values.final AttachmentwithActions(Action... elements) Copy the current immutable object with elements that replace the content ofactions.final AttachmentwithActions(Iterable<? extends Action> elements) Copy the current immutable object with elements that replace the content ofactions.final AttachmentwithAttachmentType(String value) Copy the current immutable object by setting a present value for the optionalattachmentTypeattribute.final AttachmentwithAttachmentType(Optional<String> optional) Copy the current immutable object by setting an optional value for theattachmentTypeattribute.final AttachmentwithAuthorIcon(String value) Copy the current immutable object by setting a present value for the optionalauthorIconattribute.final AttachmentwithAuthorIcon(Optional<String> optional) Copy the current immutable object by setting an optional value for theauthorIconattribute.final AttachmentwithAuthorLink(String value) Copy the current immutable object by setting a present value for the optionalauthorLinkattribute.final AttachmentwithAuthorLink(Optional<String> optional) Copy the current immutable object by setting an optional value for theauthorLinkattribute.final AttachmentwithAuthorName(String value) Copy the current immutable object by setting a present value for the optionalauthorNameattribute.final AttachmentwithAuthorName(Optional<String> optional) Copy the current immutable object by setting an optional value for theauthorNameattribute.final AttachmentwithBlocks(Block... elements) Copy the current immutable object with elements that replace the content ofblocks.final AttachmentwithBlocks(Iterable<? extends Block> elements) Copy the current immutable object with elements that replace the content ofblocks.final AttachmentwithCallbackId(String value) Copy the current immutable object by setting a present value for the optionalcallbackIdattribute.final AttachmentwithCallbackId(Optional<String> optional) Copy the current immutable object by setting an optional value for thecallbackIdattribute.final AttachmentCopy the current immutable object by setting a present value for the optionalcolorattribute.final AttachmentCopy the current immutable object by setting an optional value for thecolorattribute.final AttachmentwithEpochSeconds(String value) Copy the current immutable object by setting a present value for the optionalepochSecondsattribute.final AttachmentwithEpochSeconds(Optional<String> optional) Copy the current immutable object by setting an optional value for theepochSecondsattribute.final AttachmentwithFallback(String value) Copy the current immutable object by setting a present value for the optionalfallbackattribute.final AttachmentwithFallback(Optional<String> optional) Copy the current immutable object by setting an optional value for thefallbackattribute.final AttachmentwithFields(Field... elements) Copy the current immutable object with elements that replace the content offields.final AttachmentwithFields(Iterable<? extends Field> elements) Copy the current immutable object with elements that replace the content offields.final AttachmentwithFooter(String value) Copy the current immutable object by setting a present value for the optionalfooterattribute.final AttachmentwithFooter(Optional<String> optional) Copy the current immutable object by setting an optional value for thefooterattribute.final AttachmentwithFooterIcon(String value) Copy the current immutable object by setting a present value for the optionalfooterIconattribute.final AttachmentwithFooterIcon(Optional<String> optional) Copy the current immutable object by setting an optional value for thefooterIconattribute.final AttachmentwithImageUrl(String value) Copy the current immutable object by setting a present value for the optionalimageUrlattribute.final AttachmentwithImageUrl(Optional<String> optional) Copy the current immutable object by setting an optional value for theimageUrlattribute.final AttachmentwithMrkdwnIn(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofmrkdwnIn.final AttachmentwithMrkdwnIn(String... elements) Copy the current immutable object with elements that replace the content ofmrkdwnIn.final AttachmentwithPretext(String value) Copy the current immutable object by setting a present value for the optionalpretextattribute.final AttachmentwithPretext(Optional<String> optional) Copy the current immutable object by setting an optional value for thepretextattribute.final AttachmentCopy the current immutable object by setting a present value for the optionaltextattribute.final AttachmentCopy the current immutable object by setting an optional value for thetextattribute.final AttachmentwithThumbUrl(String value) Copy the current immutable object by setting a present value for the optionalthumbUrlattribute.final AttachmentwithThumbUrl(Optional<String> optional) Copy the current immutable object by setting an optional value for thethumbUrlattribute.final AttachmentCopy the current immutable object by setting a present value for the optionaltitleattribute.final AttachmentCopy the current immutable object by setting an optional value for thetitleattribute.final AttachmentwithTitleLink(String value) Copy the current immutable object by setting a present value for the optionaltitleLinkattribute.final AttachmentwithTitleLink(Optional<String> optional) Copy the current immutable object by setting an optional value for thetitleLinkattribute.
-
Method Details
-
getFallback
- Specified by:
getFallbackin interfaceAttachmentIF- Returns:
- The value of the
fallbackattribute
-
getColor
- Specified by:
getColorin interfaceAttachmentIF- Returns:
- The value of the
colorattribute
-
getPretext
- Specified by:
getPretextin interfaceAttachmentIF- Returns:
- The value of the
pretextattribute
-
getAuthorName
- Specified by:
getAuthorNamein interfaceAttachmentIF- Returns:
- The value of the
authorNameattribute
-
getAuthorLink
- Specified by:
getAuthorLinkin interfaceAttachmentIF- Returns:
- The value of the
authorLinkattribute
-
getAuthorIcon
- Specified by:
getAuthorIconin interfaceAttachmentIF- Returns:
- The value of the
authorIconattribute
-
getTitle
- Specified by:
getTitlein interfaceAttachmentIF- Returns:
- The value of the
titleattribute
-
getTitleLink
- Specified by:
getTitleLinkin interfaceAttachmentIF- Returns:
- The value of the
titleLinkattribute
-
getText
- Specified by:
getTextin interfaceAttachmentIF- Returns:
- The value of the
textattribute
-
getImageUrl
- Specified by:
getImageUrlin interfaceAttachmentIF- Returns:
- The value of the
imageUrlattribute
-
getAttachmentType
- Specified by:
getAttachmentTypein interfaceAttachmentIF- Returns:
- The value of the
attachmentTypeattribute
-
getFields
- Specified by:
getFieldsin interfaceAttachmentIF- Returns:
- The value of the
fieldsattribute
-
getThumbUrl
- Specified by:
getThumbUrlin interfaceAttachmentIF- Returns:
- The value of the
thumbUrlattribute
-
getEpochSeconds
- Specified by:
getEpochSecondsin interfaceAttachmentIF- Returns:
- The value of the
epochSecondsattribute
-
getCallbackId
- Specified by:
getCallbackIdin interfaceAttachmentIF- Returns:
- The value of the
callbackIdattribute
-
getActions
- Specified by:
getActionsin interfaceAttachmentIF- Returns:
- The value of the
actionsattribute
-
getMrkdwnIn
Slack will only markdown in fields whose names are included in this set. SeeMarkdownSupportedFields- Specified by:
getMrkdwnInin interfaceAttachmentIF
-
getBlocks
- Specified by:
getBlocksin interfaceAttachmentIF- Returns:
- The value of the
blocksattribute
-
withFallback
Copy the current immutable object by setting a present value for the optionalfallbackattribute.- Parameters:
value- The value for fallback,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withFallback
Copy the current immutable object by setting an optional value for thefallbackattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for fallback- Returns:
- A modified copy or
thisif not changed
-
withColor
Copy the current immutable object by setting a present value for the optionalcolorattribute.- Parameters:
value- The value for color,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withColor
Copy the current immutable object by setting an optional value for thecolorattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for color- Returns:
- A modified copy or
thisif not changed
-
withPretext
Copy the current immutable object by setting a present value for the optionalpretextattribute.- Parameters:
value- The value for pretext,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withPretext
Copy the current immutable object by setting an optional value for thepretextattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for pretext- Returns:
- A modified copy or
thisif not changed
-
withAuthorName
Copy the current immutable object by setting a present value for the optionalauthorNameattribute.- Parameters:
value- The value for authorName,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withAuthorName
Copy the current immutable object by setting an optional value for theauthorNameattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for authorName- Returns:
- A modified copy or
thisif not changed
-
withAuthorLink
Copy the current immutable object by setting a present value for the optionalauthorLinkattribute.- Parameters:
value- The value for authorLink,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withAuthorLink
Copy the current immutable object by setting an optional value for theauthorLinkattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for authorLink- Returns:
- A modified copy or
thisif not changed
-
withAuthorIcon
Copy the current immutable object by setting a present value for the optionalauthorIconattribute.- Parameters:
value- The value for authorIcon,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withAuthorIcon
Copy the current immutable object by setting an optional value for theauthorIconattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for authorIcon- Returns:
- A modified copy or
thisif not changed
-
withTitle
Copy the current immutable object by setting a present value for the optionaltitleattribute.- Parameters:
value- The value for title,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withTitle
Copy the current immutable object by setting an optional value for thetitleattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for title- Returns:
- A modified copy or
thisif not changed
-
withTitleLink
Copy the current immutable object by setting a present value for the optionaltitleLinkattribute.- Parameters:
value- The value for titleLink,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withTitleLink
Copy the current immutable object by setting an optional value for thetitleLinkattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for titleLink- Returns:
- A modified copy or
thisif not changed
-
withText
Copy the current immutable object by setting a present value for the optionaltextattribute.- Parameters:
value- The value for text,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withText
Copy the current immutable object by setting an optional value for thetextattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for text- Returns:
- A modified copy or
thisif not changed
-
withImageUrl
Copy the current immutable object by setting a present value for the optionalimageUrlattribute.- Parameters:
value- The value for imageUrl,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withImageUrl
Copy the current immutable object by setting an optional value for theimageUrlattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for imageUrl- Returns:
- A modified copy or
thisif not changed
-
withAttachmentType
Copy the current immutable object by setting a present value for the optionalattachmentTypeattribute.- Parameters:
value- The value for attachmentType,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withAttachmentType
Copy the current immutable object by setting an optional value for theattachmentTypeattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for attachmentType- Returns:
- A modified copy or
thisif not changed
-
withFields
Copy the current immutable object with elements that replace the content offields.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withFields
Copy the current immutable object with elements that replace the content offields. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of fields elements to set- Returns:
- A modified copy or
thisif not changed
-
withThumbUrl
Copy the current immutable object by setting a present value for the optionalthumbUrlattribute.- Parameters:
value- The value for thumbUrl,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withThumbUrl
Copy the current immutable object by setting an optional value for thethumbUrlattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for thumbUrl- Returns:
- A modified copy or
thisif not changed
-
withEpochSeconds
Copy the current immutable object by setting a present value for the optionalepochSecondsattribute.- Parameters:
value- The value for epochSeconds,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withEpochSeconds
Copy the current immutable object by setting an optional value for theepochSecondsattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for epochSeconds- Returns:
- A modified copy or
thisif not changed
-
withCallbackId
Copy the current immutable object by setting a present value for the optionalcallbackIdattribute.- Parameters:
value- The value for callbackId,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withCallbackId
Copy the current immutable object by setting an optional value for thecallbackIdattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for callbackId- Returns:
- A modified copy or
thisif not changed
-
withActions
Copy the current immutable object with elements that replace the content ofactions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withActions
Copy the current immutable object with elements that replace the content ofactions. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of actions elements to set- Returns:
- A modified copy or
thisif not changed
-
withMrkdwnIn
Copy the current immutable object with elements that replace the content ofmrkdwnIn.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withMrkdwnIn
Copy the current immutable object with elements that replace the content ofmrkdwnIn. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of mrkdwnIn elements to set- Returns:
- A modified copy or
thisif not changed
-
withBlocks
Copy the current immutable object with elements that replace the content ofblocks.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withBlocks
Copy the current immutable object with elements that replace the content ofblocks. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of blocks elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofAttachmentthat have equal attribute values. -
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. -
toString
Prints the immutable valueAttachmentwith attribute values. -
copyOf
Creates an immutable copy of aAttachmentIFvalue. 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
Creates a builder forAttachment.Attachment.builder() .setFallback(Optional<String>) // optionalfallback.setColor(Optional<String>) // optionalcolor.setPretext(Optional<String>) // optionalpretext.setAuthorName(Optional<String>) // optionalauthorName.setAuthorLink(Optional<String>) // optionalauthorLink.setAuthorIcon(Optional<String>) // optionalauthorIcon.setTitle(Optional<String>) // optionaltitle.setTitleLink(Optional<String>) // optionaltitleLink.setText(Optional<String>) // optionaltext.setImageUrl(Optional<String>) // optionalimageUrl.setAttachmentType(Optional<String>) // optionalattachmentType.addFields|addAllFields(Field) //fieldselements .setFooter(Optional<String>) // optionalfooter.setFooterIcon(Optional<String>) // optionalfooterIcon.setThumbUrl(Optional<String>) // optionalthumbUrl.setEpochSeconds(Optional<String>) // optionalepochSeconds.setCallbackId(Optional<String>) // optionalcallbackId.addActions|addAllActions(com.hubspot.slack.client.models.actions.Action) //actionselements .addMrkdwnIn|addAllMrkdwnIn(String) //mrkdwnInelements .addBlocks|addAllBlocks(com.hubspot.slack.client.models.blocks.Block) //blockselements .build();- Returns:
- A new Attachment builder
-