A page contains the data that is retrieved to satisfy a given page request.
An instance of Page is obtained by supplying a PageRequest as
an argument of a repository method. For example,
@Find
Page<Vehicle> search(@By("make") String make,
@By("model") String model,
@By("year") int designYear,
PageRequest pageRequest,
Order<Vehicle> order);
If PageRequest#requestTotal() is enabled, the Page also
contains information about the total number of pages
and the total number of elements that can be
retrieved by the query.
| Modifier and Type | Method and Description |
|---|---|
| public List | |
| public boolean | Returns: whether thePage has content at all.Returns whether the |
| public boolean | Returns: false if this is the last page of results.Returns |
| public boolean | Returns: false if this is the first page of results.Returns |
| public boolean | Returns: true if totals are available.Returns |
| public PageRequest | Returns: a request for the next page.Returns a request for the next page if |
| public int | Returns: the number of elements on thisPage.Returns the number of elements on this |
| public PageRequest | Returns: the request for the current page; will never benull.Returns the page request for which this page was obtained. |
| public PageRequest | Returns: a request for the previous page.Returns a request for the previous page, if |
| public default Stream | Returns: a stream of results.Returns a sequential stream of results, which follow the order of the sort criteria, if any were specified. |
| public long | Returns: the total number of elements across all pages.Returns the total number of elements across all pages of query results, if the
|
| public long | Returns: the total number of pages.Returns the total number of pages of query results, if the |
| content | back to summary |
|---|---|
| public List Returns the page content as a | |
| hasContent | back to summary |
|---|---|
| public boolean hasContent() Returns whether the
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Returns
| |
| hasPrevious | back to summary |
|---|---|
| public boolean hasPrevious() Returns
| |
| hasTotals | back to summary |
|---|---|
| public boolean hasTotals() Returns
| |
| nextPageRequest | back to summary |
|---|---|
| public PageRequest nextPageRequest() Returns a request for the next page if
| |
| numberOfElements | back to summary |
|---|---|
| public int numberOfElements() Returns the number of elements on this
| |
| pageRequest | back to summary |
|---|---|
| public PageRequest pageRequest() Returns the page request for which this page was obtained.
| |
| previousPageRequest | back to summary |
|---|---|
| public PageRequest previousPageRequest() Returns a request for the previous page, if
| |
| stream | back to summary |
|---|---|
| public default Stream Returns a sequential stream of results, which follow the order of the sort criteria, if any were specified.
| |
| totalElements | back to summary |
|---|---|
| public long totalElements() Returns the total number of elements across all pages of query results, if the
| |
| totalPages | back to summary |
|---|---|
| public long totalPages() Returns the total number of pages of query results, if the
| |