Package com.hubspot.slack.client.models
Class Message.Builder
java.lang.Object
com.hubspot.slack.client.models.Message.Builder
- Enclosing class:
Message
@Generated(from="MessageIF",
generator="Immutables")
@NotThreadSafe
public static final class Message.Builder
extends Object
-
Method Summary
Modifier and TypeMethodDescriptionfinal Message.BuilderaddAllAttachments(Iterable<? extends Attachment> elements) Adds elements toattachmentslist.final Message.BuilderaddAttachments(Attachment element) Adds one element toattachmentslist.final Message.BuilderaddAttachments(Attachment... elements) Adds elements toattachmentslist.build()Builds a newMessage.final Message.BuilderFill a builder with attribute values from the providedMessageIFinstance.final Message.BuildersetAttachments(Iterable<? extends Attachment> elements) Sets or replaces all elements forattachmentslist.final Message.BuildersetChannel(SlackChannel channel) Initializes the value for thechannelattribute.final Message.BuildersetNext(LiteMessage next) Initializes the optional valuenextto next.final Message.BuildersetNext(Optional<? extends LiteMessage> next) Initializes the optional valuenextto next.final Message.BuildersetNextNext(LiteMessage nextNext) Initializes the optional valuenextNextto nextNext.final Message.BuildersetNextNext(Optional<? extends LiteMessage> nextNext) Initializes the optional valuenextNextto nextNext.final Message.BuildersetPermalink(String permalink) Initializes the optional valuepermalinkto permalink.final Message.BuildersetPermalink(Optional<String> permalink) Initializes the optional valuepermalinkto permalink.final Message.BuildersetPrevious(LiteMessage previous) Initializes the optional valuepreviousto previous.final Message.BuildersetPrevious(Optional<? extends LiteMessage> previous) Initializes the optional valuepreviousto previous.final Message.BuildersetPreviousPrevious(LiteMessage previousPrevious) Initializes the optional valuepreviousPreviousto previousPrevious.final Message.BuildersetPreviousPrevious(Optional<? extends LiteMessage> previousPrevious) Initializes the optional valuepreviousPreviousto previousPrevious.final Message.BuilderInitializes the value for theteamattribute.final Message.BuilderInitializes the value for thetextattribute.final Message.BuildersetTimestamp(String timestamp) Initializes the value for thetimestampattribute.final Message.BuilderInitializes the value for thetypeattribute.final Message.BuilderInitializes the optional valueuserto user.final Message.BuilderInitializes the optional valueuserto user.final Message.BuildersetUsername(String username) Initializes the value for theusernameattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedMessageIFinstance. 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
-
setType
Initializes the value for thetypeattribute.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
setTeam
Initializes the value for theteamattribute.- Parameters:
team- The value for team- Returns:
thisbuilder for use in a chained invocation
-
setChannel
Initializes the value for thechannelattribute.- Parameters:
channel- The value for channel- Returns:
thisbuilder for use in a chained invocation
-
setUser
Initializes the optional valueuserto user.- Parameters:
user- The value for user,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setUser
Initializes the optional valueuserto user.- Parameters:
user- The value for user- Returns:
thisbuilder for use in a chained invocation
-
setUsername
Initializes the value for theusernameattribute.- Parameters:
username- The value for username- Returns:
thisbuilder for use in a chained invocation
-
setTimestamp
Initializes the value for thetimestampattribute.- Parameters:
timestamp- The value for timestamp- Returns:
thisbuilder for use in a chained invocation
-
setText
Initializes the value for thetextattribute.- Parameters:
text- The value for text- Returns:
thisbuilder for use in a chained invocation
-
setPermalink
Initializes the optional valuepermalinkto permalink.- Parameters:
permalink- The value for permalink,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setPermalink
Initializes the optional valuepermalinkto permalink.- Parameters:
permalink- The value for permalink- Returns:
thisbuilder for use in a chained invocation
-
addAttachments
Adds one element toattachmentslist.- Parameters:
element- A attachments element- Returns:
thisbuilder for use in a chained invocation
-
addAttachments
Adds elements toattachmentslist.- Parameters:
elements- An array of attachments elements- Returns:
thisbuilder for use in a chained invocation
-
setAttachments
Sets or replaces all elements forattachmentslist.- Parameters:
elements- An iterable of attachments elements- Returns:
thisbuilder for use in a chained invocation
-
addAllAttachments
Adds elements toattachmentslist.- Parameters:
elements- An iterable of attachments elements- Returns:
thisbuilder for use in a chained invocation
-
setPreviousPrevious
Initializes the optional valuepreviousPreviousto previousPrevious.- Parameters:
previousPrevious- The value for previousPrevious,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setPreviousPrevious
Initializes the optional valuepreviousPreviousto previousPrevious.- Parameters:
previousPrevious- The value for previousPrevious- Returns:
thisbuilder for use in a chained invocation
-
setPrevious
Initializes the optional valuepreviousto previous.- Parameters:
previous- The value for previous,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setPrevious
Initializes the optional valuepreviousto previous.- Parameters:
previous- The value for previous- Returns:
thisbuilder for use in a chained invocation
-
setNext
Initializes the optional valuenextto next.- Parameters:
next- The value for next,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setNext
Initializes the optional valuenextto next.- Parameters:
next- The value for next- Returns:
thisbuilder for use in a chained invocation
-
setNextNext
Initializes the optional valuenextNextto nextNext.- Parameters:
nextNext- The value for nextNext,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setNextNext
Initializes the optional valuenextNextto nextNext.- Parameters:
nextNext- The value for nextNext- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newMessage.- Returns:
- An immutable instance of Message
- Throws:
com.hubspot.immutables.validation.InvalidImmutableStateException- if any required attributes are missing
-