Package com.hubspot.slack.client.models
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 Summary
Modifier and TypeMethodDescriptionfinal Attachment.BuilderaddActions(Action element) Adds one element toactionslist.final Attachment.BuilderaddActions(Action... elements) Adds elements toactionslist.final Attachment.BuilderaddAllActions(Iterable<? extends Action> elements) Adds elements toactionslist.final Attachment.BuilderaddAllBlocks(Iterable<? extends Block> elements) Adds elements toblockslist.final Attachment.BuilderaddAllFields(Iterable<? extends Field> elements) Adds elements tofieldslist.final Attachment.BuilderaddAllMrkdwnIn(Iterable<String> elements) Adds elements tomrkdwnInset.final Attachment.BuilderAdds one element toblockslist.final Attachment.BuilderAdds elements toblockslist.final Attachment.BuilderAdds one element tofieldslist.final Attachment.BuilderAdds elements tofieldslist.final Attachment.BuilderaddMrkdwnIn(String element) Adds one element tomrkdwnInset.final Attachment.BuilderaddMrkdwnIn(String... elements) Adds elements tomrkdwnInset.build()Builds a newAttachment.final Attachment.Builderfrom(AttachmentIF instance) Fill a builder with attribute values from the providedAttachmentIFinstance.final Attachment.BuildersetActions(Iterable<? extends Action> elements) Sets or replaces all elements foractionslist.final Attachment.BuildersetAttachmentType(String attachmentType) Initializes the optional valueattachmentTypeto attachmentType.final Attachment.BuildersetAttachmentType(Optional<String> attachmentType) Initializes the optional valueattachmentTypeto attachmentType.final Attachment.BuildersetAuthorIcon(String authorIcon) Initializes the optional valueauthorIconto authorIcon.final Attachment.BuildersetAuthorIcon(Optional<String> authorIcon) Initializes the optional valueauthorIconto authorIcon.final Attachment.BuildersetAuthorLink(String authorLink) Initializes the optional valueauthorLinkto authorLink.final Attachment.BuildersetAuthorLink(Optional<String> authorLink) Initializes the optional valueauthorLinkto authorLink.final Attachment.BuildersetAuthorName(String authorName) Initializes the optional valueauthorNameto authorName.final Attachment.BuildersetAuthorName(Optional<String> authorName) Initializes the optional valueauthorNameto authorName.final Attachment.BuilderSets or replaces all elements forblockslist.final Attachment.BuildersetCallbackId(String callbackId) Initializes the optional valuecallbackIdto callbackId.final Attachment.BuildersetCallbackId(Optional<String> callbackId) Initializes the optional valuecallbackIdto callbackId.final Attachment.BuilderInitializes the optional valuecolorto color.final Attachment.BuilderInitializes the optional valuecolorto color.final Attachment.BuildersetEpochSeconds(String epochSeconds) Initializes the optional valueepochSecondsto epochSeconds.final Attachment.BuildersetEpochSeconds(Optional<String> epochSeconds) Initializes the optional valueepochSecondsto epochSeconds.final Attachment.BuildersetFallback(String fallback) Initializes the optional valuefallbackto fallback.final Attachment.BuildersetFallback(Optional<String> fallback) Initializes the optional valuefallbackto fallback.final Attachment.BuilderSets or replaces all elements forfieldslist.final Attachment.BuilderInitializes the optional valuefooterto footer.final Attachment.BuilderInitializes the optional valuefooterto footer.final Attachment.BuildersetFooterIcon(String footerIcon) Initializes the optional valuefooterIconto footerIcon.final Attachment.BuildersetFooterIcon(Optional<String> footerIcon) Initializes the optional valuefooterIconto footerIcon.final Attachment.BuildersetImageUrl(String imageUrl) Initializes the optional valueimageUrlto imageUrl.final Attachment.BuildersetImageUrl(Optional<String> imageUrl) Initializes the optional valueimageUrlto imageUrl.final Attachment.BuildersetMrkdwnIn(Iterable<String> elements) Sets or replaces all elements formrkdwnInset.final Attachment.BuildersetPretext(String pretext) Initializes the optional valuepretextto pretext.final Attachment.BuildersetPretext(Optional<String> pretext) Initializes the optional valuepretextto pretext.final Attachment.BuilderInitializes the optional valuetextto text.final Attachment.BuilderInitializes the optional valuetextto text.final Attachment.BuildersetThumbUrl(String thumbUrl) Initializes the optional valuethumbUrlto thumbUrl.final Attachment.BuildersetThumbUrl(Optional<String> thumbUrl) Initializes the optional valuethumbUrlto thumbUrl.final Attachment.BuilderInitializes the optional valuetitleto title.final Attachment.BuilderInitializes the optional valuetitleto title.final Attachment.BuildersetTitleLink(String titleLink) Initializes the optional valuetitleLinkto titleLink.final Attachment.BuildersetTitleLink(Optional<String> titleLink) Initializes the optional valuetitleLinkto titleLink.
-
Method Details
-
from
Fill a builder with attribute values from the providedAttachmentIFinstance. 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:
thisbuilder for use in a chained invocation
-
setFallback
Initializes the optional valuefallbackto fallback.- Parameters:
fallback- The value for fallback,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setFallback
Initializes the optional valuefallbackto fallback.- Parameters:
fallback- The value for fallback- Returns:
thisbuilder for use in a chained invocation
-
setColor
Initializes the optional valuecolorto color.- Parameters:
color- The value for color,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setColor
Initializes the optional valuecolorto color.- Parameters:
color- The value for color- Returns:
thisbuilder for use in a chained invocation
-
setPretext
Initializes the optional valuepretextto pretext.- Parameters:
pretext- The value for pretext,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setPretext
Initializes the optional valuepretextto pretext.- Parameters:
pretext- The value for pretext- Returns:
thisbuilder for use in a chained invocation
-
setAuthorName
Initializes the optional valueauthorNameto authorName.- Parameters:
authorName- The value for authorName,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setAuthorName
Initializes the optional valueauthorNameto authorName.- Parameters:
authorName- The value for authorName- Returns:
thisbuilder for use in a chained invocation
-
setAuthorLink
Initializes the optional valueauthorLinkto authorLink.- Parameters:
authorLink- The value for authorLink,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setAuthorLink
Initializes the optional valueauthorLinkto authorLink.- Parameters:
authorLink- The value for authorLink- Returns:
thisbuilder for use in a chained invocation
-
setAuthorIcon
Initializes the optional valueauthorIconto authorIcon.- Parameters:
authorIcon- The value for authorIcon,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setAuthorIcon
Initializes the optional valueauthorIconto authorIcon.- Parameters:
authorIcon- The value for authorIcon- Returns:
thisbuilder for use in a chained invocation
-
setTitle
Initializes the optional valuetitleto title.- Parameters:
title- The value for title,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setTitle
Initializes the optional valuetitleto title.- Parameters:
title- The value for title- Returns:
thisbuilder for use in a chained invocation
-
setTitleLink
Initializes the optional valuetitleLinkto titleLink.- Parameters:
titleLink- The value for titleLink,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setTitleLink
Initializes the optional valuetitleLinkto titleLink.- Parameters:
titleLink- The value for titleLink- Returns:
thisbuilder for use in a chained invocation
-
setText
Initializes the optional valuetextto text.- Parameters:
text- The value for text,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setText
Initializes the optional valuetextto text.- Parameters:
text- The value for text- Returns:
thisbuilder for use in a chained invocation
-
setImageUrl
Initializes the optional valueimageUrlto imageUrl.- Parameters:
imageUrl- The value for imageUrl,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setImageUrl
Initializes the optional valueimageUrlto imageUrl.- Parameters:
imageUrl- The value for imageUrl- Returns:
thisbuilder for use in a chained invocation
-
setAttachmentType
Initializes the optional valueattachmentTypeto attachmentType.- Parameters:
attachmentType- The value for attachmentType,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setAttachmentType
Initializes the optional valueattachmentTypeto attachmentType.- Parameters:
attachmentType- The value for attachmentType- Returns:
thisbuilder for use in a chained invocation
-
addFields
Adds one element tofieldslist.- Parameters:
element- A fields element- Returns:
thisbuilder for use in a chained invocation
-
addFields
Adds elements tofieldslist.- Parameters:
elements- An array of fields elements- Returns:
thisbuilder for use in a chained invocation
-
setFields
Sets or replaces all elements forfieldslist.- Parameters:
elements- An iterable of fields elements- Returns:
thisbuilder for use in a chained invocation
-
addAllFields
Adds elements tofieldslist.- Parameters:
elements- An iterable of fields elements- Returns:
thisbuilder for use in a chained invocation
-
setThumbUrl
Initializes the optional valuethumbUrlto thumbUrl.- Parameters:
thumbUrl- The value for thumbUrl,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setThumbUrl
Initializes the optional valuethumbUrlto thumbUrl.- Parameters:
thumbUrl- The value for thumbUrl- Returns:
thisbuilder for use in a chained invocation
-
setEpochSeconds
Initializes the optional valueepochSecondsto epochSeconds.- Parameters:
epochSeconds- The value for epochSeconds,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setEpochSeconds
Initializes the optional valueepochSecondsto epochSeconds.- Parameters:
epochSeconds- The value for epochSeconds- Returns:
thisbuilder for use in a chained invocation
-
setCallbackId
Initializes the optional valuecallbackIdto callbackId.- Parameters:
callbackId- The value for callbackId,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setCallbackId
Initializes the optional valuecallbackIdto callbackId.- Parameters:
callbackId- The value for callbackId- Returns:
thisbuilder for use in a chained invocation
-
addActions
Adds one element toactionslist.- Parameters:
element- A actions element- Returns:
thisbuilder for use in a chained invocation
-
addActions
Adds elements toactionslist.- Parameters:
elements- An array of actions elements- Returns:
thisbuilder for use in a chained invocation
-
setActions
Sets or replaces all elements foractionslist.- Parameters:
elements- An iterable of actions elements- Returns:
thisbuilder for use in a chained invocation
-
addAllActions
Adds elements toactionslist.- Parameters:
elements- An iterable of actions elements- Returns:
thisbuilder for use in a chained invocation
-
addMrkdwnIn
Adds one element tomrkdwnInset.- Parameters:
element- A mrkdwnIn element- Returns:
thisbuilder for use in a chained invocation
-
addMrkdwnIn
Adds elements tomrkdwnInset.- Parameters:
elements- An array of mrkdwnIn elements- Returns:
thisbuilder for use in a chained invocation
-
setMrkdwnIn
Sets or replaces all elements formrkdwnInset.- Parameters:
elements- An iterable of mrkdwnIn elements- Returns:
thisbuilder for use in a chained invocation
-
addAllMrkdwnIn
Adds elements tomrkdwnInset.- Parameters:
elements- An iterable of mrkdwnIn elements- Returns:
thisbuilder for use in a chained invocation
-
addBlocks
Adds one element toblockslist.- Parameters:
element- A blocks element- Returns:
thisbuilder for use in a chained invocation
-
addBlocks
Adds elements toblockslist.- Parameters:
elements- An array of blocks elements- Returns:
thisbuilder for use in a chained invocation
-
setBlocks
Sets or replaces all elements forblockslist.- Parameters:
elements- An iterable of blocks elements- Returns:
thisbuilder for use in a chained invocation
-
addAllBlocks
Adds elements toblockslist.- Parameters:
elements- An iterable of blocks elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newAttachment.- Returns:
- An immutable instance of Attachment
- Throws:
com.hubspot.immutables.validation.InvalidImmutableStateException- if any required attributes are missing
-