@NotThreadSafe public static final class LiteMessage.Builder extends Object
LiteMessage.
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 |
|---|---|
LiteMessage.Builder |
addAllAttachments(Iterable<? extends Attachment> elements)
Adds elements to
attachments list. |
LiteMessage.Builder |
addAllFiles(Iterable<? extends SlackFile> elements)
Adds elements to
files list. |
LiteMessage.Builder |
addAllReplies(Iterable<? extends ReplySkeleton> elements)
Deprecated.
|
LiteMessage.Builder |
addAttachments(Attachment... elements)
Adds elements to
attachments list. |
LiteMessage.Builder |
addAttachments(Attachment element)
Adds one element to
attachments list. |
LiteMessage.Builder |
addFiles(SlackFile... elements)
Adds elements to
files list. |
LiteMessage.Builder |
addFiles(SlackFile element)
Adds one element to
files list. |
LiteMessage.Builder |
addReplies(ReplySkeleton... elements)
Deprecated.
|
LiteMessage.Builder |
addReplies(ReplySkeleton element)
Deprecated.
|
LiteMessage |
build()
Builds a new
LiteMessage. |
LiteMessage.Builder |
from(LiteMessageIF instance)
Fill a builder with attribute values from the provided
LiteMessageIF instance. |
LiteMessage.Builder |
setAttachments(Iterable<? extends Attachment> elements)
Sets or replaces all elements for
attachments list. |
LiteMessage.Builder |
setBotId(Optional<String> botId)
Initializes the optional value
botId to botId. |
LiteMessage.Builder |
setBotId(String botId)
Initializes the optional value
botId to botId. |
LiteMessage.Builder |
setFiles(Iterable<? extends SlackFile> elements)
Sets or replaces all elements for
files list. |
LiteMessage.Builder |
setLatestReplyTimestamp(Optional<String> latestReplyTimestamp)
Initializes the optional value
latestReplyTimestamp to latestReplyTimestamp. |
LiteMessage.Builder |
setLatestReplyTimestamp(String latestReplyTimestamp)
Initializes the optional value
latestReplyTimestamp to latestReplyTimestamp. |
LiteMessage.Builder |
setReplies(Iterable<? extends ReplySkeleton> elements)
Deprecated.
|
LiteMessage.Builder |
setReplyCount(Integer replyCount)
Initializes the optional value
replyCount to replyCount. |
LiteMessage.Builder |
setReplyCount(Optional<Integer> replyCount)
Initializes the optional value
replyCount to replyCount. |
LiteMessage.Builder |
setReplyUserIds(List<String> replyUserIds)
Initializes the optional value
replyUserIds to replyUserIds. |
LiteMessage.Builder |
setReplyUserIds(Optional<List<String>> replyUserIds)
Initializes the optional value
replyUserIds to replyUserIds. |
LiteMessage.Builder |
setReplyUsersCount(Integer replyUsersCount)
Initializes the optional value
replyUsersCount to replyUsersCount. |
LiteMessage.Builder |
setReplyUsersCount(Optional<Integer> replyUsersCount)
Initializes the optional value
replyUsersCount to replyUsersCount. |
LiteMessage.Builder |
setSubtype(Optional<String> subtype)
Initializes the optional value
subtype to subtype. |
LiteMessage.Builder |
setSubtype(String subtype)
Initializes the optional value
subtype to subtype. |
LiteMessage.Builder |
setText(String text)
Initializes the value for the
text attribute. |
LiteMessage.Builder |
setThreadTimestamp(Optional<String> threadTimestamp)
Initializes the optional value
threadTimestamp to threadTimestamp. |
LiteMessage.Builder |
setThreadTimestamp(String threadTimestamp)
Initializes the optional value
threadTimestamp to threadTimestamp. |
LiteMessage.Builder |
setTimestamp(String timestamp)
Initializes the value for the
timestamp attribute. |
LiteMessage.Builder |
setType(String type)
Initializes the value for the
type attribute. |
LiteMessage.Builder |
setUser(Optional<String> user)
Initializes the optional value
user to user. |
LiteMessage.Builder |
setUser(String user)
Initializes the optional value
user to user. |
LiteMessage.Builder |
setUsername(Optional<String> username)
Initializes the optional value
username to username. |
LiteMessage.Builder |
setUsername(String username)
Initializes the optional value
username to username. |
public final LiteMessage.Builder from(LiteMessageIF instance)
LiteMessageIF 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 LiteMessage.Builder setType(String type)
type attribute.type - The value for typethis builder for use in a chained invocationpublic final LiteMessage.Builder setSubtype(@Nullable String subtype)
subtype to subtype.subtype - The value for subtype, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final LiteMessage.Builder setSubtype(Optional<String> subtype)
subtype to subtype.subtype - The value for subtypethis builder for use in a chained invocationpublic final LiteMessage.Builder setUser(@Nullable String user)
user to user.user - The value for user, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final LiteMessage.Builder setUser(Optional<String> user)
user to user.user - The value for userthis builder for use in a chained invocationpublic final LiteMessage.Builder setBotId(@Nullable String botId)
botId to botId.botId - The value for botId, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final LiteMessage.Builder setBotId(Optional<String> botId)
botId to botId.botId - The value for botIdthis builder for use in a chained invocationpublic final LiteMessage.Builder setUsername(@Nullable String username)
username to username.username - The value for username, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final LiteMessage.Builder setUsername(Optional<String> username)
username to username.username - The value for usernamethis builder for use in a chained invocationpublic final LiteMessage.Builder setText(String text)
text attribute.text - The value for textthis builder for use in a chained invocationpublic final LiteMessage.Builder addAttachments(Attachment element)
attachments list.element - A attachments elementthis builder for use in a chained invocationpublic final LiteMessage.Builder addAttachments(Attachment... elements)
attachments list.elements - An array of attachments elementsthis builder for use in a chained invocationpublic final LiteMessage.Builder setAttachments(Iterable<? extends Attachment> elements)
attachments list.elements - An iterable of attachments elementsthis builder for use in a chained invocationpublic final LiteMessage.Builder addAllAttachments(Iterable<? extends Attachment> elements)
attachments list.elements - An iterable of attachments elementsthis builder for use in a chained invocationpublic final LiteMessage.Builder addFiles(SlackFile element)
files list.element - A files elementthis builder for use in a chained invocationpublic final LiteMessage.Builder addFiles(SlackFile... elements)
files list.elements - An array of files elementsthis builder for use in a chained invocationpublic final LiteMessage.Builder setFiles(Iterable<? extends SlackFile> elements)
files list.elements - An iterable of files elementsthis builder for use in a chained invocationpublic final LiteMessage.Builder addAllFiles(Iterable<? extends SlackFile> elements)
files list.elements - An iterable of files elementsthis builder for use in a chained invocationpublic final LiteMessage.Builder setTimestamp(String timestamp)
timestamp attribute.timestamp - The value for timestampthis builder for use in a chained invocationpublic final LiteMessage.Builder setThreadTimestamp(@Nullable String threadTimestamp)
threadTimestamp to threadTimestamp.threadTimestamp - The value for threadTimestamp, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final LiteMessage.Builder setThreadTimestamp(Optional<String> threadTimestamp)
threadTimestamp to threadTimestamp.threadTimestamp - The value for threadTimestampthis builder for use in a chained invocationpublic final LiteMessage.Builder setReplyCount(@Nullable Integer replyCount)
replyCount to replyCount.replyCount - The value for replyCount, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final LiteMessage.Builder setReplyCount(Optional<Integer> replyCount)
replyCount to replyCount.replyCount - The value for replyCountthis builder for use in a chained invocationpublic final LiteMessage.Builder setReplyUserIds(@Nullable List<String> replyUserIds)
replyUserIds to replyUserIds.replyUserIds - The value for replyUserIds, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final LiteMessage.Builder setReplyUserIds(Optional<List<String>> replyUserIds)
replyUserIds to replyUserIds.replyUserIds - The value for replyUserIdsthis builder for use in a chained invocationpublic final LiteMessage.Builder setReplyUsersCount(@Nullable Integer replyUsersCount)
replyUsersCount to replyUsersCount.replyUsersCount - The value for replyUsersCount, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final LiteMessage.Builder setReplyUsersCount(Optional<Integer> replyUsersCount)
replyUsersCount to replyUsersCount.replyUsersCount - The value for replyUsersCountthis builder for use in a chained invocationpublic final LiteMessage.Builder setLatestReplyTimestamp(@Nullable String latestReplyTimestamp)
latestReplyTimestamp to latestReplyTimestamp.latestReplyTimestamp - The value for latestReplyTimestamp, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final LiteMessage.Builder setLatestReplyTimestamp(Optional<String> latestReplyTimestamp)
latestReplyTimestamp to latestReplyTimestamp.latestReplyTimestamp - The value for latestReplyTimestampthis builder for use in a chained invocation@Deprecated public final LiteMessage.Builder addReplies(ReplySkeleton element)
replies list.element - A replies elementthis builder for use in a chained invocation@Deprecated public final LiteMessage.Builder addReplies(ReplySkeleton... elements)
replies list.elements - An array of replies elementsthis builder for use in a chained invocation@Deprecated public final LiteMessage.Builder setReplies(Iterable<? extends ReplySkeleton> elements)
replies list.elements - An iterable of replies elementsthis builder for use in a chained invocation@Deprecated public final LiteMessage.Builder addAllReplies(Iterable<? extends ReplySkeleton> elements)
replies list.elements - An iterable of replies elementsthis builder for use in a chained invocationpublic LiteMessage build() throws com.hubspot.immutables.validation.InvalidImmutableStateException
LiteMessage.com.hubspot.immutables.validation.InvalidImmutableStateException - if any required attributes are missingCopyright © 2019. All rights reserved.