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
ConstructorsConstructorDescriptionCosmosPageRequest(int page, int size, String requestContinuation) Creates a newPageRequestwith unsorted parameters applied.CosmosPageRequest(int page, int size, String requestContinuation, org.springframework.data.domain.Sort sort) Creates a newCosmosPageRequestwith sort parameters applied. -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongTo get request continuationinthashCode()org.springframework.data.domain.PageRequestnext()static CosmosPageRequestCreates a newCosmosPageRequeststatic CosmosPageRequestof(long offset, int page, int size, String requestContinuation, org.springframework.data.domain.Sort sort) Creates a newCosmosPageRequestMethods inherited from class org.springframework.data.domain.PageRequest
first, getSort, of, of, of, ofSize, previous, toString, withPage, withSort, withSortMethods inherited from class org.springframework.data.domain.AbstractPageRequest
getPageNumber, getPageSize, hasPrevious, previousOrFirstMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.data.domain.Pageable
getSortOr, isPaged, isUnpaged, toLimit, toOptional, toScrollPosition
-
Constructor Details
-
CosmosPageRequest
Creates a newPageRequestwith 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 newCosmosPageRequestwith 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.requestContinuation- the continuation token of the request.sort- must not be null, useSort.unsorted()instead.
-
-
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:
nextin interfaceorg.springframework.data.domain.Pageable- Overrides:
nextin classorg.springframework.data.domain.PageRequest
-
getOffset
public long getOffset()- Specified by:
getOffsetin interfaceorg.springframework.data.domain.Pageable- Overrides:
getOffsetin classorg.springframework.data.domain.AbstractPageRequest
-
getRequestContinuation
To get request continuation- Returns:
- String
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.springframework.data.domain.PageRequest
-
equals
- Overrides:
equalsin classorg.springframework.data.domain.PageRequest
-