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.PageRequestCosmosPageRequest representing page request during pagination query, fieldFeedResponse.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CosmosPageRequest(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)longgetOffset()StringgetRequestContinuation()To get request continuationinthashCode()org.springframework.data.domain.PageRequestnext()static CosmosPageRequestof(int page, int size, String requestContinuation, org.springframework.data.domain.Sort sort)Creates a newCosmosPageRequeststatic CosmosPageRequestof(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
-
-
-
-
Constructor Detail
-
CosmosPageRequest
public CosmosPageRequest(int page, int size, String requestContinuation)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- must not be null.
-
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.sort- must not be null, useSort.unsorted()instead.requestContinuation- must not be null.
-
-
Method Detail
-
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
public String getRequestContinuation()
To get request continuation- Returns:
- String
-
hashCode
public int hashCode()
- Overrides:
hashCodein classorg.springframework.data.domain.PageRequest
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classorg.springframework.data.domain.PageRequest
-
-