Package com.hubspot.slack.client.models
Class Message
java.lang.Object
com.hubspot.slack.client.models.Message
- All Implemented Interfaces:
MessageIF
@Generated(from="MessageIF",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class Message
extends Object
implements MessageIF
Immutable implementation of
MessageIF.
Use the builder to create immutable instances:
Message.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Message.Builderbuilder()Creates a builder forMessage.static MessageCreates an immutable copy of aMessageIFvalue.booleanThis instance is equal to all instances ofMessagethat have equal attribute values.getNext()getTeam()getText()getType()getUser()inthashCode()Computes a hash code from attributes:type,team,channel,user,username,timestamp,text,permalink,attachments,previousPrevious,previous,next,nextNext,slackLink.toString()Prints the immutable valueMessagewith attribute values.final MessagewithAttachments(Attachment... elements) Copy the current immutable object with elements that replace the content ofattachments.final MessagewithAttachments(Iterable<? extends Attachment> elements) Copy the current immutable object with elements that replace the content ofattachments.final MessagewithChannel(SlackChannel value) Copy the current immutable object by setting a value for thechannelattribute.final MessagewithNext(LiteMessage value) Copy the current immutable object by setting a present value for the optionalnextattribute.final MessagewithNext(Optional<? extends LiteMessage> optional) Copy the current immutable object by setting an optional value for thenextattribute.final MessagewithNextNext(LiteMessage value) Copy the current immutable object by setting a present value for the optionalnextNextattribute.final MessagewithNextNext(Optional<? extends LiteMessage> optional) Copy the current immutable object by setting an optional value for thenextNextattribute.final MessagewithPermalink(String value) Copy the current immutable object by setting a present value for the optionalpermalinkattribute.final MessagewithPermalink(Optional<String> optional) Copy the current immutable object by setting an optional value for thepermalinkattribute.final MessagewithPrevious(LiteMessage value) Copy the current immutable object by setting a present value for the optionalpreviousattribute.final MessagewithPrevious(Optional<? extends LiteMessage> optional) Copy the current immutable object by setting an optional value for thepreviousattribute.final MessagewithPreviousPrevious(LiteMessage value) Copy the current immutable object by setting a present value for the optionalpreviousPreviousattribute.final MessagewithPreviousPrevious(Optional<? extends LiteMessage> optional) Copy the current immutable object by setting an optional value for thepreviousPreviousattribute.final MessageCopy the current immutable object by setting a value for theteamattribute.final MessageCopy the current immutable object by setting a value for thetextattribute.final MessagewithTimestamp(String value) Copy the current immutable object by setting a value for thetimestampattribute.final MessageCopy the current immutable object by setting a value for thetypeattribute.final MessageCopy the current immutable object by setting a present value for the optionaluserattribute.final MessageCopy the current immutable object by setting an optional value for theuserattribute.final MessagewithUsername(String value) Copy the current immutable object by setting a value for theusernameattribute.
-
Method Details
-
getType
-
getTeam
-
getChannel
- Specified by:
getChannelin interfaceMessageIF- Returns:
- The value of the
channelattribute
-
getUser
-
getUsername
- Specified by:
getUsernamein interfaceMessageIF- Returns:
- The value of the
usernameattribute
-
getTimestamp
- Specified by:
getTimestampin interfaceMessageIF- Returns:
- The value of the
timestampattribute
-
getText
-
getPermalink
- Specified by:
getPermalinkin interfaceMessageIF- Returns:
- The value of the
permalinkattribute
-
getAttachments
- Specified by:
getAttachmentsin interfaceMessageIF- Returns:
- The value of the
attachmentsattribute
-
getPreviousPrevious
- Specified by:
getPreviousPreviousin interfaceMessageIF- Returns:
- The value of the
previousPreviousattribute
-
getPrevious
- Specified by:
getPreviousin interfaceMessageIF- Returns:
- The value of the
previousattribute
-
getNext
-
getNextNext
- Specified by:
getNextNextin interfaceMessageIF- Returns:
- The value of the
nextNextattribute
-
getSlackLink
- Specified by:
getSlackLinkin interfaceMessageIF- Returns:
- The computed-at-construction value of the
slackLinkattribute
-
withType
Copy the current immutable object by setting a value for thetypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type- Returns:
- A modified copy or the
thisobject
-
withTeam
Copy the current immutable object by setting a value for theteamattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for team- Returns:
- A modified copy or the
thisobject
-
withChannel
Copy the current immutable object by setting a value for thechannelattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for channel- Returns:
- A modified copy or the
thisobject
-
withUser
Copy the current immutable object by setting a present value for the optionaluserattribute.- Parameters:
value- The value for user,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withUser
Copy the current immutable object by setting an optional value for theuserattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for user- Returns:
- A modified copy or
thisif not changed
-
withUsername
Copy the current immutable object by setting a value for theusernameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for username- Returns:
- A modified copy or the
thisobject
-
withTimestamp
Copy the current immutable object by setting a value for thetimestampattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for timestamp- Returns:
- A modified copy or the
thisobject
-
withText
Copy the current immutable object by setting a value for thetextattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for text- Returns:
- A modified copy or the
thisobject
-
withPermalink
Copy the current immutable object by setting a present value for the optionalpermalinkattribute.- Parameters:
value- The value for permalink,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withPermalink
Copy the current immutable object by setting an optional value for thepermalinkattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for permalink- Returns:
- A modified copy or
thisif not changed
-
withAttachments
Copy the current immutable object with elements that replace the content ofattachments.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withAttachments
Copy the current immutable object with elements that replace the content ofattachments. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of attachments elements to set- Returns:
- A modified copy or
thisif not changed
-
withPreviousPrevious
Copy the current immutable object by setting a present value for the optionalpreviousPreviousattribute.- Parameters:
value- The value for previousPrevious,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withPreviousPrevious
Copy the current immutable object by setting an optional value for thepreviousPreviousattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for previousPrevious- Returns:
- A modified copy or
thisif not changed
-
withPrevious
Copy the current immutable object by setting a present value for the optionalpreviousattribute.- Parameters:
value- The value for previous,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withPrevious
Copy the current immutable object by setting an optional value for thepreviousattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for previous- Returns:
- A modified copy or
thisif not changed
-
withNext
Copy the current immutable object by setting a present value for the optionalnextattribute.- Parameters:
value- The value for next,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withNext
Copy the current immutable object by setting an optional value for thenextattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for next- Returns:
- A modified copy or
thisif not changed
-
withNextNext
Copy the current immutable object by setting a present value for the optionalnextNextattribute.- Parameters:
value- The value for nextNext,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withNextNext
Copy the current immutable object by setting an optional value for thenextNextattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for nextNext- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofMessagethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:type,team,channel,user,username,timestamp,text,permalink,attachments,previousPrevious,previous,next,nextNext,slackLink. -
toString
Prints the immutable valueMessagewith attribute values. -
copyOf
Creates an immutable copy of aMessageIFvalue. 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 Message instance
-
builder
Creates a builder forMessage.Message.builder() .setType(String) // requiredtype.setTeam(String) // requiredteam.setChannel(com.hubspot.slack.client.models.SlackChannel) // requiredchannel.setUser(Optional<String>) // optionaluser.setUsername(String) // requiredusername.setTimestamp(String) // requiredtimestamp.setText(String) // requiredtext.setPermalink(Optional<String>) // optionalpermalink.addAttachments|addAllAttachments(Attachment) //attachmentselements .setPreviousPrevious(Optional<LiteMessage>) // optionalpreviousPrevious.setPrevious(Optional<LiteMessage>) // optionalprevious.setNext(Optional<LiteMessage>) // optionalnext.setNextNext(Optional<LiteMessage>) // optionalnextNext.build();- Returns:
- A new Message builder
-