Package com.shri.restinpeace
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 TypeMethodDescriptionReturns the named response header's value, ornullif the response didn't carry it.items()Returns this page's decoded items, in the order the server returned them.intReturns how many items have been fetched so far, including this page's.intReturns how many pages have been fetched so far, including this one.com.google.gson.JsonElementrawBody()Returns this page's parsed response body, for arbitrary field access the closed@Paginatedattribute 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
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@Paginatedattribute 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
Returns the named response header's value, ornullif the response didn't carry it.- Parameters:
name- the header name- Returns:
- the header's value, or
nullif 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
-