Class CosmosPageRequest
java.lang.Object
org.springframework.data.domain.AbstractPageRequest
org.springframework.data.domain.PageRequest
com.azure.spring.data.cosmos.core.query.CosmosPageRequest
- All Implemented Interfaces:
Serializable
,org.springframework.data.domain.Pageable
public class CosmosPageRequest
extends org.springframework.data.domain.PageRequest
CosmosPageRequest representing page request during pagination query, field
FeedResponse.getContinuationToken()
response continuation token} is saved
to help query next page.
The requestContinuation token should be saved after each request and reused in later queries.
- See Also:
-
Constructor Summary
ConstructorDescriptionCosmosPageRequest
(int page, int size, String requestContinuation) Creates a newPageRequest
with unsorted parameters applied.CosmosPageRequest
(int page, int size, String requestContinuation, org.springframework.data.domain.Sort sort) Creates a newCosmosPageRequest
with sort parameters applied. -
Method Summary
Modifier and TypeMethodDescriptionboolean
long
To get request continuationint
hashCode()
org.springframework.data.domain.PageRequest
next()
static CosmosPageRequest
Creates a newCosmosPageRequest
static CosmosPageRequest
of
(long offset, int page, int size, String requestContinuation, org.springframework.data.domain.Sort sort) Creates a newCosmosPageRequest
Methods inherited from class org.springframework.data.domain.PageRequest
first, getSort, of, of, of, ofSize, previous, toString, withPage, withSort, withSort
Methods inherited from class org.springframework.data.domain.AbstractPageRequest
getPageNumber, getPageSize, hasPrevious, previousOrFirst
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.data.domain.Pageable
getSortOr, isPaged, isUnpaged, toOptional
-
Constructor Details
-
CosmosPageRequest
Creates a newPageRequest
with unsorted parameters applied.- Parameters:
page
- zero-based page index, must not be negative.size
- the size of the page to be returned, must be greater than 0.requestContinuation
- the continuation token of the request.
-
CosmosPageRequest
public CosmosPageRequest(int page, int size, String requestContinuation, org.springframework.data.domain.Sort sort) Creates a newCosmosPageRequest
with sort parameters applied.- Parameters:
page
- zero-based page index, must not be negative.size
- the size of the page to be returned, must be greater than 0.sort
- must not be null, useSort.unsorted()
instead.requestContinuation
- the continuation token of the request.
-
-
Method Details
-
of
public static CosmosPageRequest of(int page, int size, String requestContinuation, org.springframework.data.domain.Sort sort) Creates a newCosmosPageRequest
- Parameters:
page
- zero-based page index, must not be negative.size
- the size of the page to be returned, must be greater than 0.requestContinuation
- cannot be nullsort
- cannot be null- Returns:
- CosmosPageRequest
-
of
public static CosmosPageRequest of(long offset, int page, int size, String requestContinuation, org.springframework.data.domain.Sort sort) Creates a newCosmosPageRequest
- Parameters:
offset
- cannot be nullpage
- zero-based page index, must not be negative.size
- the size of the page to be returned, must be greater than 0.requestContinuation
- cannot be nullsort
- cannot be null- Returns:
- CosmosPageRequest
-
next
public org.springframework.data.domain.PageRequest next()- Specified by:
next
in interfaceorg.springframework.data.domain.Pageable
- Overrides:
next
in classorg.springframework.data.domain.PageRequest
-
getOffset
public long getOffset()- Specified by:
getOffset
in interfaceorg.springframework.data.domain.Pageable
- Overrides:
getOffset
in classorg.springframework.data.domain.AbstractPageRequest
-
getRequestContinuation
To get request continuation- Returns:
- String
-
hashCode
public int hashCode()- Overrides:
hashCode
in classorg.springframework.data.domain.PageRequest
-
equals
- Overrides:
equals
in classorg.springframework.data.domain.PageRequest
-