Class 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:
    Serialized Form
    • Constructor Detail

      • 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 - must not be null.
      • CosmosPageRequest

        public CosmosPageRequest​(int page,
                                 int size,
                                 String requestContinuation,
                                 org.springframework.data.domain.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.
        sort - must not be null, use Sort.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 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,
                                           org.springframework.data.domain.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
      • next

        public org.springframework.data.domain.PageRequest next()
        Specified by:
        next in interface org.springframework.data.domain.Pageable
        Overrides:
        next in class org.springframework.data.domain.PageRequest
      • getOffset

        public long getOffset()
        Specified by:
        getOffset in interface org.springframework.data.domain.Pageable
        Overrides:
        getOffset in class org.springframework.data.domain.AbstractPageRequest
      • getRequestContinuation

        public String getRequestContinuation()
        To get request continuation
        Returns:
        String
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class org.springframework.data.domain.PageRequest
      • equals

        public boolean equals​(Object obj)
        Overrides:
        equals in class org.springframework.data.domain.PageRequest