Class Page<T>

java.lang.Object
com.atlassian.diagnostics.Page<T>
Type Parameters:
T - the type the items contained in the page
All Implemented Interfaces:
Iterable<T>

public class Page<T> extends Object implements Iterable<T>
A page of items, typically returned from a service that supports pagination of results. A page of data is the result of a page request, and provides requests that can be used to retrieve the previous and next pages (if available).

Pagination is done based on numeric offsets.

Services that return Page instances are expected to retrieve the requested results + 1 extra item. When this extra value is provided to the constructor, the page can determine that there is a next page of data and can provide a next request.

Any page constructed with a request that has a start greater than 0 is assumed to have a previous page that starts with a start offset of start - limit, or 0, whichever is greater.

  • Constructor Details

    • Page

      public Page(@Nonnull PageRequest request, @Nonnull List<T> values)
      Parameters:
      request - the request that triggered this page
      values - the resulting values, if a next page is available. If more values are provided tha
  • Method Details