Doc from jakarta.page request for the next
page of results
Doc from jakarta.page request for the
previous page of results
Doc from jakarta.
Doc from jakarta.
PageRequest.Cursor instances for result,
in order
Doc from jakarta.page request for which this
page was obtained
CursoredPage.
This may be used to simplify implementation of a repository interface.
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final List | cursors
Record Component accessed by cursors(). A list ofPageRequest. instances for result,
in order
|
| private final PageRequest | nextPageRequest
Record Component accessed by nextPageRequest(). Apage request for the next
page of results
|
| private final PageRequest | pageRequest
Record Component accessed by pageRequest(). Thepage request for which this
page was obtained
|
| private final PageRequest | previousPageRequest
Record Component accessed by previousPageRequest(). Apage request for the
previous page of results
|
| private final long | totalElements
Record Component accessed by totalElements(). The total number of elements across all pages that can be requested for the query |
| Access | Constructor and Description |
|---|---|
| public | CursoredPageRecord(List<T>
The page content, that is, the query results, in order content, List<PageRequest.A list of cursors,PageRequest. instances for result,
in orderThe total number of elements across all pages that
can be requested for the query totalElements, PageRequest The pageRequest, boolean page request for which this
page was obtainedTrue, if this is the first page of results firstPage, boolean True, if this is the last page of results lastPage)
|
| public | CursoredPageRecord(List<T> content, List<PageRequest.
|
| Modifier and Type | Method and Description |
|---|---|
| public List | content()
Record Component getter of content. Implements jakarta. Returns the page content as a Record Component The page content, that is, the query results, in order |
| public PageRequest. | cursor(int
position (0 is first) of a result on the page. index)Implements jakarta. Returns a |
| public List | cursors()
Record Component getter of cursors.
Record Component
A list of |
| public final boolean | equals(Object
the reference object with which to compare. o)Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public boolean | hasContent()
Implements jakarta. Returns whether the |
| public final int | |
| public boolean | hasNext()
Implements jakarta. Returns |
| public boolean | hasPrevious()
Implements jakarta. Returns |
| public boolean | hasTotals()
Implements jakarta. Returns |
| public Iterator | |
| public PageRequest | nextPageRequest()
Record Component getter of nextPageRequest. Implements jakarta. Creates a request for the next page in a forward direction from the current page.
Record Component
A |
| public int | numberOfElements()
Implements jakarta. Returns the number of elements on this |
| public PageRequest | pageRequest()
Record Component getter of pageRequest. Implements jakarta. Returns the page request for which this page was obtained.
Record Component
The |
| public PageRequest | previousPageRequest()
Record Component getter of previousPageRequest. Implements jakarta. Creates a request for the previous page in a reverse direction from the current page.
Record Component
A |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| public long | totalElements()
Record Component getter of totalElements. Implements jakarta. Returns the total number of elements across all pages of query results, if the
Record Component The total number of elements across all pages that can be requested for the query |
| public long | totalPages()
Implements jakarta. Returns the total number of pages of query results, if the |
| content | back to summary |
|---|---|
| private final List<T> content Record Component accessed by content(). The page content, that is, the query results, in order | |
| cursors | back to summary |
|---|---|
| private final List<PageRequest. Record Component accessed by cursors(). A list of | |
| nextPageRequest | back to summary |
|---|---|
| private final PageRequest nextPageRequest Record Component accessed by nextPageRequest(). A | |
| pageRequest | back to summary |
|---|---|
| private final PageRequest pageRequest Record Component accessed by pageRequest(). The | |
| previousPageRequest | back to summary |
|---|---|
| private final PageRequest previousPageRequest Record Component accessed by previousPageRequest(). A | |
| totalElements | back to summary |
|---|---|
| private final long totalElements Record Component accessed by totalElements(). The total number of elements across all pages that can be requested for the query | |
| CursoredPageRecord | back to summary |
|---|---|
public CursoredPageRecord(List<T> content, List<PageRequest.
| |
| CursoredPageRecord | back to summary |
|---|---|
| public CursoredPageRecord(List<T> content, List<PageRequest. | |
| content | back to summary |
|---|---|
| public List Record Component getter of content. Implements jakarta. Doc from jakarta. Returns the page content as a | |
| cursor | back to summary |
|---|---|
| public PageRequest. Implements jakarta. Doc from jakarta. Returns a
| |
| cursors | back to summary |
|---|---|
| public List Record Component getter of cursors.
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hasContent | back to summary |
|---|---|
| public boolean hasContent() Implements jakarta. Doc from jakarta. Returns whether the | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements jakarta. Doc from jakarta. Returns
| |
| hasPrevious | back to summary |
|---|---|
| public boolean hasPrevious() Implements jakarta. Doc from jakarta. Returns
| |
| hasTotals | back to summary |
|---|---|
| public boolean hasTotals() Implements jakarta. Doc from jakarta. Returns
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over elements of type | |
| nextPageRequest | back to summary |
|---|---|
| public PageRequest nextPageRequest() Record Component getter of nextPageRequest. Implements jakarta. Doc from jakarta. Creates a request for the next page in a forward direction from the current page. This method computes a cursor from the last entity of the current page and includes the cursor in the pagination information so that it can be used to obtain the next page in a forward direction according to the sort criteria and relative to that entity.
| |
| numberOfElements | back to summary |
|---|---|
| public int numberOfElements() Implements jakarta. Doc from jakarta. Returns the number of elements on this
| |
| pageRequest | back to summary |
|---|---|
| public PageRequest pageRequest() Record Component getter of pageRequest. Implements jakarta. Doc from jakarta. Returns the page request for which this page was obtained.
| |
| previousPageRequest | back to summary |
|---|---|
| public PageRequest previousPageRequest() Record Component getter of previousPageRequest. Implements jakarta. Doc from jakarta. Creates a request for the previous page in a reverse direction from the current page. This method computes a cursor from the first entity of the current page and includes the cursor in the pagination information so that it can be used to obtain the previous page in a reverse direction to the sort criteria and relative to that entity. Within a single page, results are not reversed and remain ordered according to the sort criteria. Page numbers are not accurate and should not be relied upon when
using cursor-based pagination. Jakarta Data providers should aim to at
least avoid returning negative or
| |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.
| |
| totalElements | back to summary |
|---|---|
| public long totalElements() Record Component getter of totalElements. Implements jakarta. Doc from jakarta. Returns the total number of elements across all pages of query results, if the
| |
| totalPages | back to summary |
|---|---|
| public long totalPages() Implements jakarta. Doc from jakarta. Returns the total number of pages of query results, if the
| |