Class LiteMessage

java.lang.Object
com.hubspot.slack.client.models.LiteMessage
All Implemented Interfaces:
LiteMessageIF

@Generated(from="LiteMessageIF", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class LiteMessage extends Object implements LiteMessageIF
Immutable implementation of LiteMessageIF.

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

  • Method Details

    • getType

      public String getType()
      Specified by:
      getType in interface LiteMessageIF
      Returns:
      The value of the type attribute
    • getSubtype

      public Optional<String> getSubtype()
      Specified by:
      getSubtype in interface LiteMessageIF
      Returns:
      The value of the subtype attribute
    • getUser

      public Optional<String> getUser()
      Specified by:
      getUser in interface LiteMessageIF
      Returns:
      The value of the user attribute
    • getBotId

      public Optional<String> getBotId()
      Specified by:
      getBotId in interface LiteMessageIF
      Returns:
      The value of the botId attribute
    • getUsername

      public Optional<String> getUsername()
      Specified by:
      getUsername in interface LiteMessageIF
      Returns:
      The value of the username attribute
    • getText

      public String getText()
      Specified by:
      getText in interface LiteMessageIF
      Returns:
      The value of the text attribute
    • getAttachments

      public List<Attachment> getAttachments()
      Specified by:
      getAttachments in interface LiteMessageIF
      Returns:
      The value of the attachments attribute
    • getFiles

      public List<SlackFile> getFiles()
      Specified by:
      getFiles in interface LiteMessageIF
      Returns:
      The value of the files attribute
    • getBlocks

      public List<Block> getBlocks()
      Specified by:
      getBlocks in interface LiteMessageIF
      Returns:
      The value of the blocks attribute
    • getReactions

      public List<Reaction> getReactions()
      Specified by:
      getReactions in interface LiteMessageIF
      Returns:
      The value of the reactions attribute
    • getTimestamp

      public String getTimestamp()
      Specified by:
      getTimestamp in interface LiteMessageIF
      Returns:
      The value of the timestamp attribute
    • getThreadTimestamp

      public Optional<String> getThreadTimestamp()
      Specified by:
      getThreadTimestamp in interface LiteMessageIF
      Returns:
      The value of the threadTimestamp attribute
    • getReplyCount

      public Optional<Integer> getReplyCount()
      Specified by:
      getReplyCount in interface LiteMessageIF
      Returns:
      The value of the replyCount attribute
    • getReplyUserIds

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

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

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

      public final LiteMessage withType(String value)
      Copy the current immutable object by setting a value for the type attribute. An equals check 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
    • withSubtype

      public final LiteMessage withSubtype(@Nullable String 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 LiteMessage withSubtype(Optional<String> 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
    • withUser

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

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

      public final LiteMessage 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 LiteMessage 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
    • withUsername

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

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

      public final LiteMessage 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
    • withAttachments

      public final LiteMessage 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 LiteMessage 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
    • withFiles

      public final LiteMessage 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 LiteMessage 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
    • withBlocks

      public final LiteMessage 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 LiteMessage 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
    • withReactions

      public final LiteMessage withReactions(Reaction... elements)
      Copy the current immutable object with elements that replace the content of reactions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withReactions

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

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

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

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

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

      public final LiteMessage withReplyCount(Optional<Integer> optional)
      Copy the current immutable object by setting an optional value for the replyCount 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 replyCount
      Returns:
      A modified copy or this if not changed
    • withReplyUserIds

      public final LiteMessage 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 LiteMessage 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 LiteMessage 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 LiteMessage 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 LiteMessage 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 LiteMessage 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 LiteMessage 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, subtype, user, botId, username, text, attachments, files, blocks, reactions, timestamp, threadTimestamp, replyCount, replyUserIds, replyUsersCount, latestReplyTimestamp.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static LiteMessage.Builder builder()
      Creates a builder for LiteMessage.
       LiteMessage.builder()
          .setType(String) // required type
          .setSubtype(Optional<String>) // optional subtype
          .setUser(Optional<String>) // optional user
          .setBotId(Optional<String>) // optional botId
          .setUsername(Optional<String>) // optional username
          .setText(String) // required text
          .addAttachments|addAllAttachments(Attachment) // attachments elements
          .addFiles|addAllFiles(com.hubspot.slack.client.models.files.SlackFile) // files elements
          .addBlocks|addAllBlocks(com.hubspot.slack.client.models.blocks.Block) // blocks elements
          .addReactions|addAllReactions(Reaction) // reactions elements
          .setTimestamp(String) // required timestamp
          .setThreadTimestamp(Optional<String>) // optional threadTimestamp
          .setReplyCount(Optional<Integer>) // optional replyCount
          .setReplyUserIds(Optional<List<String>>) // optional replyUserIds
          .setReplyUsersCount(Optional<Integer>) // optional replyUsersCount
          .setLatestReplyTimestamp(Optional<String>) // optional latestReplyTimestamp
          .build();
       
      Returns:
      A new LiteMessage builder