Class ConversationsHistoryResponse

java.lang.Object
com.hubspot.slack.client.models.response.conversations.ConversationsHistoryResponse
All Implemented Interfaces:
ConversationsHistoryResponseIF, SlackResponse

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

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

  • Method Details

    • isOk

      public boolean isOk()
      Specified by:
      isOk in interface SlackResponse
      Returns:
      The value of the ok attribute
    • getResponseMetadata

      public Optional<ResponseMetadata> getResponseMetadata()
      Specified by:
      getResponseMetadata in interface SlackResponse
      Returns:
      The value of the responseMetadata attribute
    • getMessages

      public List<LiteMessage> getMessages()
      Specified by:
      getMessages in interface ConversationsHistoryResponseIF
      Returns:
      The value of the messages attribute
    • hasMore

      public boolean hasMore()
      Specified by:
      hasMore in interface ConversationsHistoryResponseIF
      Returns:
      The value of the hasMore attribute
    • getPinCount

      public int getPinCount()
      Specified by:
      getPinCount in interface ConversationsHistoryResponseIF
      Returns:
      The value of the pinCount attribute
    • withOk

      public final ConversationsHistoryResponse withOk(boolean value)
      Copy the current immutable object by setting a value for the ok attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ok
      Returns:
      A modified copy or the this object
    • withResponseMetadata

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

      public final ConversationsHistoryResponse withResponseMetadata(Optional<? extends ResponseMetadata> optional)
      Copy the current immutable object by setting an optional value for the responseMetadata 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 responseMetadata
      Returns:
      A modified copy or this if not changed
    • withMessages

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

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

      public final ConversationsHistoryResponse withHasMore(boolean value)
      Copy the current immutable object by setting a value for the hasMore attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for hasMore
      Returns:
      A modified copy or the this object
    • withPinCount

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ConversationsHistoryResponse 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: ok, responseMetadata, messages, hasMore, pinCount.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      Creates an immutable copy of a ConversationsHistoryResponseIF 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 ConversationsHistoryResponse instance
    • builder

      public static ConversationsHistoryResponse.Builder builder()
      Creates a builder for ConversationsHistoryResponse.
       ConversationsHistoryResponse.builder()
          .setOk(boolean) // required ok
          .setResponseMetadata(Optional<ResponseMetadata>) // optional responseMetadata
          .addMessages|addAllMessages(com.hubspot.slack.client.models.LiteMessage) // messages elements
          .setHasMore(boolean) // required hasMore
          .setPinCount(int) // required pinCount
          .build();
       
      Returns:
      A new ConversationsHistoryResponse builder