Interface PagedResponse<T>

All Superinterfaces:
Iterable<T>
All Known Implementing Classes:
PagedResponseImpl

@PublicApi public interface PagedResponse<T> extends Iterable<T>
A response to a paged request, used in pagination. Wraps a list and provides information on whether there are more results.
  • Method Details

    • getResults

      List<T> getResults()
      Returns:
      the results
    • size

      int size()
      Returns:
      the number of results in this page of results
    • hasNextPage

      boolean hasNextPage()
      Indicates whether the source has more results after this page.
      Returns:
      true if there are more results
    • getPagedRequest

      PagedRequest getPagedRequest()
      Returns:
      the request used to produce this response
    • map

      <M> PagedResponse<M> map(com.google.common.base.Function<T,M> mapper)
      Allows you to map a paged response of T into M
      Type Parameters:
      M - the output type
      Parameters:
      mapper - the mapping function
      Returns:
      a paged response of M
    • findFirst

      Optional<T> findFirst()
      Returns:
      an optional first element of the paged response