Class SlackEventBotMessage

All Implemented Interfaces:
HasChannel, SlackEvent

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

Use the builder to create immutable instances: SlackEventBotMessage.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
    • getChannelId

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

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

      public Optional<String> getText()
      Specified by:
      getText in class AbstractSlackEventBotMessage
      Returns:
      The value of the text attribute
    • getAttachments

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

      public String getBotId()
      Specified by:
      getBotId in class AbstractSlackEventBotMessage
      Returns:
      The value of the botId attribute
    • getBlocks

      public List<Block> getBlocks()
      Specified by:
      getBlocks in class AbstractSlackEventBotMessage
      Returns:
      The value of the blocks attribute
    • withType

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

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

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

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

      public final SlackEventBotMessage 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 SlackEventBotMessage 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
    • withBotId

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

      public final SlackEventBotMessage withBlocks(Block... elements)
      Copy the current immutable object with elements that replace the content of blocks.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withBlocks

      public final SlackEventBotMessage withBlocks(Iterable<? extends Block> elements)
      Copy the current immutable object with elements that replace the content of blocks. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of blocks 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 SlackEventBotMessage 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, channelId, threadTs, text, attachments, botId, blocks.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static SlackEventBotMessage.Builder builder()
      Creates a builder for SlackEventBotMessage.
       SlackEventBotMessage.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
          .setChannelId(String) // required channelId
          .setThreadTs(Optional<String>) // optional threadTs
          .setText(Optional<String>) // optional text
          .addAttachments|addAllAttachments(com.hubspot.slack.client.models.Attachment) // attachments elements
          .setBotId(String) // required botId
          .addBlocks|addAllBlocks(com.hubspot.slack.client.models.blocks.Block) // blocks elements
          .build();
       
      Returns:
      A new SlackEventBotMessage builder