Class ChannelsHistoryResponse

java.lang.Object
com.hubspot.slack.client.models.response.channels.AbstractChannelsHistoryResponse
com.hubspot.slack.client.models.response.channels.ChannelsHistoryResponse
All Implemented Interfaces:
TimeIntervalFilter, SlackResponse

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

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

  • Method Details

    • isOk

      public boolean isOk()
      Returns:
      The value of the ok attribute
    • getResponseMetadata

      public Optional<ResponseMetadata> getResponseMetadata()
      Returns:
      The value of the responseMetadata attribute
    • isInclusive

      public Optional<Boolean> isInclusive()
      Returns:
      The value of the inclusive attribute
    • getNewestTimestamp

      public Optional<String> getNewestTimestamp()
      Returns:
      The value of the newestTimestamp attribute
    • getOldestTimestamp

      public Optional<String> getOldestTimestamp()
      Returns:
      The value of the oldestTimestamp attribute
    • getPagingDirection

      public PagingDirection getPagingDirection()
      Returns:
      The computed-at-construction value of the pagingDirection attribute
    • hasMore

      public boolean hasMore()
      Specified by:
      hasMore in class AbstractChannelsHistoryResponse
      Returns:
      The value of the hasMore attribute
    • getMessages

      public List<LiteMessage> getMessages()
      Specified by:
      getMessages in class AbstractChannelsHistoryResponse
      Returns:
      The value of the messages attribute
    • withOk

      public final ChannelsHistoryResponse 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 ChannelsHistoryResponse 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 ChannelsHistoryResponse 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
    • withInclusive

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

      public final ChannelsHistoryResponse withInclusive(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the inclusive 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 inclusive
      Returns:
      A modified copy or this if not changed
    • withNewestTimestamp

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

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

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

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

      public final ChannelsHistoryResponse 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
    • withMessages

      public final ChannelsHistoryResponse 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 ChannelsHistoryResponse 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
    • equals

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

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

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

      public static ChannelsHistoryResponse.Builder builder()
      Creates a builder for ChannelsHistoryResponse.
       ChannelsHistoryResponse.builder()
          .setOk(boolean) // required ok
          .setResponseMetadata(Optional<ResponseMetadata>) // optional responseMetadata
          .setInclusive(Optional<Boolean>) // optional inclusive
          .setNewestTimestamp(Optional<String>) // optional newestTimestamp
          .setOldestTimestamp(Optional<String>) // optional oldestTimestamp
          .setHasMore(boolean) // required hasMore
          .addMessages|addAllMessages(com.hubspot.slack.client.models.LiteMessage) // messages elements
          .build();
       
      Returns:
      A new ChannelsHistoryResponse builder