Interface PaginationContext<T>

Type Parameters:
T - the decoded item type

public interface PaginationContext<T>
The single page's items and metadata a PaginationStrategy is consulted with after every fetch - see docs/design/pagination-helper.md §6.8.
  • Method Summary

    Modifier and Type
    Method
    Description
    header(String name)
    Returns the named response header's value, or null if the response didn't carry it.
    Returns this page's decoded items, in the order the server returned them.
    int
    Returns how many items have been fetched so far, including this page's.
    int
    Returns how many pages have been fetched so far, including this one.
    com.google.gson.JsonElement
    Returns this page's parsed response body, for arbitrary field access the closed @Paginated attribute vocabulary can't reach (a cursor needing decoding before reuse, combined termination logic across multiple signals, and the other cases catalogued in §10).
  • Method Details

    • items

      List<T> items()
      Returns this page's decoded items, in the order the server returned them.
      Returns:
      this page's decoded items
    • rawBody

      com.google.gson.JsonElement rawBody()
      Returns this page's parsed response body, for arbitrary field access the closed @Paginated attribute vocabulary can't reach (a cursor needing decoding before reuse, combined termination logic across multiple signals, and the other cases catalogued in §10).
      Returns:
      the parsed response body tree
    • header

      String header(String name)
      Returns the named response header's value, or null if the response didn't carry it.
      Parameters:
      name - the header name
      Returns:
      the header's value, or null if absent
    • pagesFetchedSoFar

      int pagesFetchedSoFar()
      Returns how many pages have been fetched so far, including this one.
      Returns:
      the number of pages fetched so far, including this one
    • itemsFetchedSoFar

      int itemsFetchedSoFar()
      Returns how many items have been fetched so far, including this page's.
      Returns:
      the number of items fetched so far, including this page's