你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

CosmosPageRequest Class

  • java.lang.Object
    • org.springframework.data.domain.AbstractPageRequest
      • org.springframework.data.domain.PageRequest
        • com.azure.spring.data.cosmos.core.query.CosmosPageRequest

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.

Constructor Summary

Constructor Description
CosmosPageRequest(int page, int size, String requestContinuation)

Creates a new PageRequest with unsorted parameters applied.

CosmosPageRequest(int page, int size, String requestContinuation, Sort sort)

Creates a new CosmosPageRequest with sort parameters applied.

Method Summary

Modifier and Type Method and Description
boolean equals(Object obj)
long getOffset()
String getRequestContinuation()

To get request continuation

int hashCode()
org.springframework.data.domain.PageRequest next()
static CosmosPageRequest of(int page, int size, String requestContinuation, Sort sort)

Creates a new CosmosPageRequest

static CosmosPageRequest of(long offset, int page, int size, String requestContinuation, Sort sort)

Creates a new CosmosPageRequest

Methods inherited from java.lang.Object

Methods inherited from org.springframework.data.domain.AbstractPageRequest

org.springframework.data.domain.AbstractPageRequest.getOffset org.springframework.data.domain.AbstractPageRequest.getPageNumber org.springframework.data.domain.AbstractPageRequest.getPageSize org.springframework.data.domain.AbstractPageRequest.hasPrevious org.springframework.data.domain.AbstractPageRequest.previousOrFirst

Methods inherited from org.springframework.data.domain.PageRequest

org.springframework.data.domain.PageRequest.equals org.springframework.data.domain.PageRequest.first org.springframework.data.domain.PageRequest.getSort org.springframework.data.domain.PageRequest.hashCode org.springframework.data.domain.PageRequest.next org.springframework.data.domain.PageRequest.of org.springframework.data.domain.PageRequest.of org.springframework.data.domain.PageRequest.of org.springframework.data.domain.PageRequest.ofSize org.springframework.data.domain.PageRequest.previous org.springframework.data.domain.PageRequest.toString org.springframework.data.domain.PageRequest.withPage org.springframework.data.domain.PageRequest.withSort org.springframework.data.domain.PageRequest.withSort

Constructor Details

CosmosPageRequest

public CosmosPageRequest(int page, int size, String requestContinuation)

Creates a new PageRequest 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, Sort sort)

Creates a new CosmosPageRequest 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.
requestContinuation - the continuation token of the request.
sort - must not be null, use Sort#unsorted() instead.

Method Details

equals

public boolean equals(Object obj)

Overrides:

CosmosPageRequest.equals(Object obj)

Parameters:

obj

getOffset

public long getOffset()

Overrides:

CosmosPageRequest.getOffset()

getRequestContinuation

public String getRequestContinuation()

To get request continuation

Returns:

String

hashCode

public int hashCode()

Overrides:

CosmosPageRequest.hashCode()

next

public PageRequest next()

Overrides:

CosmosPageRequest.next()

of

public static CosmosPageRequest of(int page, int size, String requestContinuation, Sort sort)

Creates a new CosmosPageRequest

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 null
sort - cannot be null

Returns:

CosmosPageRequest

of

public static CosmosPageRequest of(long offset, int page, int size, String requestContinuation, Sort sort)

Creates a new CosmosPageRequest

Parameters:

offset - cannot be null
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 null
sort - cannot be null

Returns:

CosmosPageRequest

Applies to