@NotThreadSafe public static final class Attachment.Builder extends Object
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.
| Modifier and Type | Method and Description |
|---|---|
Attachment.Builder |
addActions(Action... elements)
Adds elements to
actions list. |
Attachment.Builder |
addActions(Action element)
Adds one element to
actions list. |
Attachment.Builder |
addAllActions(Iterable<? extends Action> elements)
Adds elements to
actions list. |
Attachment.Builder |
addAllFields(Iterable<? extends Field> elements)
Adds elements to
fields list. |
Attachment.Builder |
addAllMrkdwnIn(Iterable<String> elements)
Adds elements to
mrkdwnIn set. |
Attachment.Builder |
addFields(Field... elements)
Adds elements to
fields list. |
Attachment.Builder |
addFields(Field element)
Adds one element to
fields list. |
Attachment.Builder |
addMrkdwnIn(String... elements)
Adds elements to
mrkdwnIn set. |
Attachment.Builder |
addMrkdwnIn(String element)
Adds one element to
mrkdwnIn set. |
Attachment |
build()
Builds a new
Attachment. |
Attachment.Builder |
from(AttachmentIF instance)
Fill a builder with attribute values from the provided
AttachmentIF instance. |
Attachment.Builder |
setActions(Iterable<? extends Action> elements)
Sets or replaces all elements for
actions list. |
Attachment.Builder |
setAttachmentType(Optional<String> attachmentType)
Initializes the optional value
attachmentType to attachmentType. |
Attachment.Builder |
setAttachmentType(String attachmentType)
Initializes the optional value
attachmentType to attachmentType. |
Attachment.Builder |
setAuthorIcon(Optional<String> authorIcon)
Initializes the optional value
authorIcon to authorIcon. |
Attachment.Builder |
setAuthorIcon(String authorIcon)
Initializes the optional value
authorIcon to authorIcon. |
Attachment.Builder |
setAuthorLink(Optional<String> authorLink)
Initializes the optional value
authorLink to authorLink. |
Attachment.Builder |
setAuthorLink(String authorLink)
Initializes the optional value
authorLink to authorLink. |
Attachment.Builder |
setAuthorName(Optional<String> authorName)
Initializes the optional value
authorName to authorName. |
Attachment.Builder |
setAuthorName(String authorName)
Initializes the optional value
authorName to authorName. |
Attachment.Builder |
setCallbackId(Optional<String> callbackId)
Initializes the optional value
callbackId to callbackId. |
Attachment.Builder |
setCallbackId(String callbackId)
Initializes the optional value
callbackId to callbackId. |
Attachment.Builder |
setColor(Optional<String> color)
Initializes the optional value
color to color. |
Attachment.Builder |
setColor(String color)
Initializes the optional value
color to color. |
Attachment.Builder |
setEpochSeconds(Optional<String> epochSeconds)
Initializes the optional value
epochSeconds to epochSeconds. |
Attachment.Builder |
setEpochSeconds(String epochSeconds)
Initializes the optional value
epochSeconds to epochSeconds. |
Attachment.Builder |
setFallback(Optional<String> fallback)
Initializes the optional value
fallback to fallback. |
Attachment.Builder |
setFallback(String fallback)
Initializes the optional value
fallback to fallback. |
Attachment.Builder |
setFields(Iterable<? extends Field> elements)
Sets or replaces all elements for
fields list. |
Attachment.Builder |
setFooter(Optional<String> footer)
Initializes the optional value
footer to footer. |
Attachment.Builder |
setFooter(String footer)
Initializes the optional value
footer to footer. |
Attachment.Builder |
setFooterIcon(Optional<String> footerIcon)
Initializes the optional value
footerIcon to footerIcon. |
Attachment.Builder |
setFooterIcon(String footerIcon)
Initializes the optional value
footerIcon to footerIcon. |
Attachment.Builder |
setImageUrl(Optional<String> imageUrl)
Initializes the optional value
imageUrl to imageUrl. |
Attachment.Builder |
setImageUrl(String imageUrl)
Initializes the optional value
imageUrl to imageUrl. |
Attachment.Builder |
setMrkdwnIn(Iterable<String> elements)
Sets or replaces all elements for
mrkdwnIn set. |
Attachment.Builder |
setPretext(Optional<String> pretext)
Initializes the optional value
pretext to pretext. |
Attachment.Builder |
setPretext(String pretext)
Initializes the optional value
pretext to pretext. |
Attachment.Builder |
setText(Optional<String> text)
Initializes the optional value
text to text. |
Attachment.Builder |
setText(String text)
Initializes the optional value
text to text. |
Attachment.Builder |
setThumbUrl(Optional<String> thumbUrl)
Initializes the optional value
thumbUrl to thumbUrl. |
Attachment.Builder |
setThumbUrl(String thumbUrl)
Initializes the optional value
thumbUrl to thumbUrl. |
Attachment.Builder |
setTitle(Optional<String> title)
Initializes the optional value
title to title. |
Attachment.Builder |
setTitle(String title)
Initializes the optional value
title to title. |
Attachment.Builder |
setTitleLink(Optional<String> titleLink)
Initializes the optional value
titleLink to titleLink. |
Attachment.Builder |
setTitleLink(String titleLink)
Initializes the optional value
titleLink to titleLink. |
public final Attachment.Builder from(AttachmentIF instance)
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.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final Attachment.Builder setFallback(@Nullable String fallback)
fallback to fallback.fallback - The value for fallback, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setFallback(Optional<String> fallback)
fallback to fallback.fallback - The value for fallbackthis builder for use in a chained invocationpublic final Attachment.Builder setColor(@Nullable String color)
color to color.color - The value for color, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setColor(Optional<String> color)
color to color.color - The value for colorthis builder for use in a chained invocationpublic final Attachment.Builder setPretext(@Nullable String pretext)
pretext to pretext.pretext - The value for pretext, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setPretext(Optional<String> pretext)
pretext to pretext.pretext - The value for pretextthis builder for use in a chained invocationpublic final Attachment.Builder setAuthorName(@Nullable String authorName)
authorName to authorName.authorName - The value for authorName, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setAuthorName(Optional<String> authorName)
authorName to authorName.authorName - The value for authorNamethis builder for use in a chained invocationpublic final Attachment.Builder setAuthorLink(@Nullable String authorLink)
authorLink to authorLink.authorLink - The value for authorLink, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setAuthorLink(Optional<String> authorLink)
authorLink to authorLink.authorLink - The value for authorLinkthis builder for use in a chained invocationpublic final Attachment.Builder setAuthorIcon(@Nullable String authorIcon)
authorIcon to authorIcon.authorIcon - The value for authorIcon, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setAuthorIcon(Optional<String> authorIcon)
authorIcon to authorIcon.authorIcon - The value for authorIconthis builder for use in a chained invocationpublic final Attachment.Builder setTitle(@Nullable String title)
title to title.title - The value for title, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setTitle(Optional<String> title)
title to title.title - The value for titlethis builder for use in a chained invocationpublic final Attachment.Builder setTitleLink(@Nullable String titleLink)
titleLink to titleLink.titleLink - The value for titleLink, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setTitleLink(Optional<String> titleLink)
titleLink to titleLink.titleLink - The value for titleLinkthis builder for use in a chained invocationpublic final Attachment.Builder setText(@Nullable String text)
text to text.text - The value for text, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setText(Optional<String> text)
text to text.text - The value for textthis builder for use in a chained invocationpublic final Attachment.Builder setImageUrl(@Nullable String imageUrl)
imageUrl to imageUrl.imageUrl - The value for imageUrl, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setImageUrl(Optional<String> imageUrl)
imageUrl to imageUrl.imageUrl - The value for imageUrlthis builder for use in a chained invocationpublic final Attachment.Builder setAttachmentType(@Nullable String attachmentType)
attachmentType to attachmentType.attachmentType - The value for attachmentType, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setAttachmentType(Optional<String> attachmentType)
attachmentType to attachmentType.attachmentType - The value for attachmentTypethis builder for use in a chained invocationpublic final Attachment.Builder addFields(Field element)
fields list.element - A fields elementthis builder for use in a chained invocationpublic final Attachment.Builder addFields(Field... elements)
fields list.elements - An array of fields elementsthis builder for use in a chained invocationpublic final Attachment.Builder setFields(Iterable<? extends Field> elements)
fields list.elements - An iterable of fields elementsthis builder for use in a chained invocationpublic final Attachment.Builder addAllFields(Iterable<? extends Field> elements)
fields list.elements - An iterable of fields elementsthis builder for use in a chained invocationpublic final Attachment.Builder setFooter(@Nullable String footer)
footer to footer.footer - The value for footer, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setFooter(Optional<String> footer)
footer to footer.footer - The value for footerthis builder for use in a chained invocationpublic final Attachment.Builder setFooterIcon(@Nullable String footerIcon)
footerIcon to footerIcon.footerIcon - The value for footerIcon, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setFooterIcon(Optional<String> footerIcon)
footerIcon to footerIcon.footerIcon - The value for footerIconthis builder for use in a chained invocationpublic final Attachment.Builder setThumbUrl(@Nullable String thumbUrl)
thumbUrl to thumbUrl.thumbUrl - The value for thumbUrl, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setThumbUrl(Optional<String> thumbUrl)
thumbUrl to thumbUrl.thumbUrl - The value for thumbUrlthis builder for use in a chained invocationpublic final Attachment.Builder setEpochSeconds(@Nullable String epochSeconds)
epochSeconds to epochSeconds.epochSeconds - The value for epochSeconds, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setEpochSeconds(Optional<String> epochSeconds)
epochSeconds to epochSeconds.epochSeconds - The value for epochSecondsthis builder for use in a chained invocationpublic final Attachment.Builder setCallbackId(@Nullable String callbackId)
callbackId to callbackId.callbackId - The value for callbackId, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final Attachment.Builder setCallbackId(Optional<String> callbackId)
callbackId to callbackId.callbackId - The value for callbackIdthis builder for use in a chained invocationpublic final Attachment.Builder addActions(Action element)
actions list.element - A actions elementthis builder for use in a chained invocationpublic final Attachment.Builder addActions(Action... elements)
actions list.elements - An array of actions elementsthis builder for use in a chained invocationpublic final Attachment.Builder setActions(Iterable<? extends Action> elements)
actions list.elements - An iterable of actions elementsthis builder for use in a chained invocationpublic final Attachment.Builder addAllActions(Iterable<? extends Action> elements)
actions list.elements - An iterable of actions elementsthis builder for use in a chained invocationpublic final Attachment.Builder addMrkdwnIn(String element)
mrkdwnIn set.element - A mrkdwnIn elementthis builder for use in a chained invocationpublic final Attachment.Builder addMrkdwnIn(String... elements)
mrkdwnIn set.elements - An array of mrkdwnIn elementsthis builder for use in a chained invocationpublic final Attachment.Builder setMrkdwnIn(Iterable<String> elements)
mrkdwnIn set.elements - An iterable of mrkdwnIn elementsthis builder for use in a chained invocationpublic final Attachment.Builder addAllMrkdwnIn(Iterable<String> elements)
mrkdwnIn set.elements - An iterable of mrkdwnIn elementsthis builder for use in a chained invocationpublic Attachment build() throws com.hubspot.immutables.validation.InvalidImmutableStateException
Attachment.com.hubspot.immutables.validation.InvalidImmutableStateException - if any required attributes are missingCopyright © 2019. All rights reserved.