Class SlackEventMessage

All Implemented Interfaces:
HasChannel, HasEdited, HasUser, SlackEvent

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

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

  • Method Details

    • getEdited

      public Optional<MessageEdited> getEdited()
      Returns:
      The value of the edited attribute
    • 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
    • getChannelId

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

      public Optional<String> getThreadTs()
      Specified by:
      getThreadTs in class AbstractSlackEventMessage
      Returns:
      The value of the threadTs attribute
    • getBotId

      public Optional<String> getBotId()
      Specified by:
      getBotId in class AbstractSlackEventMessage
      Returns:
      The value of the botId attribute
    • getUserId

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

      public String getText()
      Specified by:
      getText in class AbstractSlackEventMessage
      Returns:
      The value of the text attribute
    • getFiles

      public List<SlackFile> getFiles()
      Specified by:
      getFiles in class AbstractSlackEventMessage
      Returns:
      The value of the files attribute
    • withEdited

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

      public final SlackEventMessage withEdited(Optional<? extends MessageEdited> optional)
      Copy the current immutable object by setting an optional value for the edited 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 edited
      Returns:
      A modified copy or this if not changed
    • withType

      public final SlackEventMessage 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 SlackEventMessage 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 SlackEventMessage 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 SlackEventMessage 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 SlackEventMessage 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 SlackEventMessage 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
    • withChannelId

      public final SlackEventMessage 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
    • withThreadTs

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

      public final SlackEventMessage withThreadTs(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the threadTs 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 threadTs
      Returns:
      A modified copy or this if not changed
    • withBotId

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

      public final SlackEventMessage withBotId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the botId 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 botId
      Returns:
      A modified copy or this if not changed
    • withUserId

      public final SlackEventMessage 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
    • withText

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

      public final SlackEventMessage withFiles(SlackFile... elements)
      Copy the current immutable object with elements that replace the content of files.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withFiles

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of SlackEventMessage 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: edited, type, ts, subtype, attachments, channelId, threadTs, botId, userId, text, files.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static SlackEventMessage copyOf(AbstractSlackEventMessage instance)
      Creates an immutable copy of a AbstractSlackEventMessage 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 SlackEventMessage instance
    • builder

      public static SlackEventMessage.Builder builder()
      Creates a builder for SlackEventMessage.
       SlackEventMessage.builder()
          .setEdited(Optional<com.hubspot.slack.client.models.events.MessageEdited>) // optional edited
          .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
          .setChannelId(String) // required channelId
          .setThreadTs(Optional<String>) // optional threadTs
          .setBotId(Optional<String>) // optional botId
          .setUserId(String) // required userId
          .setText(String) // required text
          .addFiles|addAllFiles(com.hubspot.slack.client.models.files.SlackFile) // files elements
          .build();
       
      Returns:
      A new SlackEventMessage builder