Class SlackReplyMessage

All Implemented Interfaces:
HasChannel, HasUser, SlackEvent

@Generated(from="AbstractSlackReplyMessage", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class SlackReplyMessage extends AbstractSlackReplyMessage
Immutable implementation of AbstractSlackReplyMessage.

Use the builder to create immutable instances: SlackReplyMessage.builder().

  • Method Details

    • getType

      public SlackEventType getType()
      Returns:
      The value of the type attribute
    • getTs

      public String getTs()
      Returns:
      The value of the ts attribute
    • getSubtype

      public Optional<SlackMessageSubtype> getSubtype()
      Specified by:
      getSubtype in class SlackEventMessageBase
      Returns:
      The value of the subtype attribute
    • getAttachments

      public List<Attachment> getAttachments()
      Specified by:
      getAttachments in class SlackEventMessageBase
      Returns:
      The value of the attachments attribute
    • getThreadTs

      public String getThreadTs()
      Specified by:
      getThreadTs in class AbstractSlackReplyMessage
      Returns:
      The value of the threadTs attribute
    • getUserId

      public String getUserId()
      Specified by:
      getUserId in interface HasUser
      Specified by:
      getUserId in class AbstractSlackReplyMessage
      Returns:
      The value of the userId attribute
    • getChannelId

      public String getChannelId()
      Specified by:
      getChannelId in interface HasChannel
      Specified by:
      getChannelId in class AbstractSlackReplyMessage
      Returns:
      The value of the channelId attribute
    • getReplyCount

      public int getReplyCount()
      Overrides:
      getReplyCount in class AbstractSlackReplyMessage
      Returns:
      The value of the replyCount attribute
    • getReplyUserIds

      public Optional<List<String>> getReplyUserIds()
      Specified by:
      getReplyUserIds in class AbstractSlackReplyMessage
      Returns:
      The value of the replyUserIds attribute
    • getReplyUsersCount

      public Optional<Integer> getReplyUsersCount()
      Specified by:
      getReplyUsersCount in class AbstractSlackReplyMessage
      Returns:
      The value of the replyUsersCount attribute
    • getLatestReplyTimestamp

      public Optional<String> getLatestReplyTimestamp()
      Specified by:
      getLatestReplyTimestamp in class AbstractSlackReplyMessage
      Returns:
      The value of the latestReplyTimestamp attribute
    • withType

      public final SlackReplyMessage withType(SlackEventType value)
      Copy the current immutable object by setting a value for the type attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for type
      Returns:
      A modified copy or the this object
    • withTs

      public final SlackReplyMessage withTs(String value)
      Copy the current immutable object by setting a value for the ts attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ts
      Returns:
      A modified copy or the this object
    • withSubtype

      public final SlackReplyMessage withSubtype(@Nullable SlackMessageSubtype value)
      Copy the current immutable object by setting a present value for the optional subtype attribute.
      Parameters:
      value - The value for subtype, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withSubtype

      public final SlackReplyMessage withSubtype(Optional<? extends SlackMessageSubtype> optional)
      Copy the current immutable object by setting an optional value for the subtype attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for subtype
      Returns:
      A modified copy or this if not changed
    • withAttachments

      public final SlackReplyMessage withAttachments(Attachment... elements)
      Copy the current immutable object with elements that replace the content of attachments.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAttachments

      public final SlackReplyMessage withAttachments(Iterable<? extends Attachment> elements)
      Copy the current immutable object with elements that replace the content of attachments. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of attachments elements to set
      Returns:
      A modified copy or this if not changed
    • withThreadTs

      public final SlackReplyMessage withThreadTs(String value)
      Copy the current immutable object by setting a value for the threadTs attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for threadTs
      Returns:
      A modified copy or the this object
    • withUserId

      public final SlackReplyMessage withUserId(String value)
      Copy the current immutable object by setting a value for the userId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for userId
      Returns:
      A modified copy or the this object
    • withChannelId

      public final SlackReplyMessage withChannelId(String value)
      Copy the current immutable object by setting a value for the channelId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for channelId
      Returns:
      A modified copy or the this object
    • withReplyCount

      public final SlackReplyMessage withReplyCount(int value)
      Copy the current immutable object by setting a value for the replyCount attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for replyCount
      Returns:
      A modified copy or the this object
    • withReplyUserIds

      public final SlackReplyMessage withReplyUserIds(@Nullable List<String> value)
      Copy the current immutable object by setting a present value for the optional replyUserIds attribute.
      Parameters:
      value - The value for replyUserIds, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withReplyUserIds

      public final SlackReplyMessage withReplyUserIds(Optional<? extends List<String>> optional)
      Copy the current immutable object by setting an optional value for the replyUserIds attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for replyUserIds
      Returns:
      A modified copy or this if not changed
    • withReplyUsersCount

      public final SlackReplyMessage withReplyUsersCount(@Nullable Integer value)
      Copy the current immutable object by setting a present value for the optional replyUsersCount attribute.
      Parameters:
      value - The value for replyUsersCount, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withReplyUsersCount

      public final SlackReplyMessage withReplyUsersCount(Optional<Integer> optional)
      Copy the current immutable object by setting an optional value for the replyUsersCount attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for replyUsersCount
      Returns:
      A modified copy or this if not changed
    • withLatestReplyTimestamp

      public final SlackReplyMessage withLatestReplyTimestamp(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional latestReplyTimestamp attribute.
      Parameters:
      value - The value for latestReplyTimestamp, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withLatestReplyTimestamp

      public final SlackReplyMessage withLatestReplyTimestamp(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the latestReplyTimestamp attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for latestReplyTimestamp
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of SlackReplyMessage that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: type, ts, subtype, attachments, threadTs, userId, channelId, replyCount, replyUserIds, replyUsersCount, latestReplyTimestamp.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value SlackReplyMessage with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static SlackReplyMessage copyOf(AbstractSlackReplyMessage instance)
      Creates an immutable copy of a AbstractSlackReplyMessage value. 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 SlackReplyMessage instance
    • builder

      public static SlackReplyMessage.Builder builder()
      Creates a builder for SlackReplyMessage.
       SlackReplyMessage.builder()
          .setType(com.hubspot.slack.client.models.events.SlackEventType) // required type
          .setTs(String) // required ts
          .setSubtype(Optional<com.hubspot.slack.client.models.events.SlackMessageSubtype>) // optional subtype
          .addAttachments|addAllAttachments(com.hubspot.slack.client.models.Attachment) // attachments elements
          .setThreadTs(String) // required threadTs
          .setUserId(String) // required userId
          .setChannelId(String) // required channelId
          .setReplyCount(int) // optional replyCount
          .setReplyUserIds(Optional<List<String>>) // optional replyUserIds
          .setReplyUsersCount(Optional<Integer>) // optional replyUsersCount
          .setLatestReplyTimestamp(Optional<String>) // optional latestReplyTimestamp
          .build();
       
      Returns:
      A new SlackReplyMessage builder