public class CassandraPageRequest extends PageRequest
PageRequest implementation providing access to paging state. This class
allows creation of the first page request and represents through Cassandra paging is based on the progress of fetched
pages and allows forward-only navigation. Accessing a particular page requires fetching of all pages until the
desired page is reached.
The fetching progress is represented as paging state. Query results are associated with a
paging state that is used on the next query
as input parameter to continue page fetching.| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static CassandraPageRequest |
first(int size)
Creates a new unsorted
PageRequest for the first page. |
static CassandraPageRequest |
first(int size,
Sort.Direction direction,
String... properties)
Creates a new
PageRequest with sort direction and properties applied for the first page. |
static CassandraPageRequest |
first(int size,
Sort sort)
Creates a new
PageRequest with sort parameters applied for the first page. |
ByteBuffer |
getPagingState() |
int |
hashCode() |
boolean |
hasNext()
Returns whether there's a next
Pageable we can access from the current one. |
CassandraPageRequest |
next() |
static CassandraPageRequest |
of(int page,
int size)
Creates a new unsorted
PageRequest. |
static CassandraPageRequest |
of(int page,
int size,
Sort.Direction direction,
String... properties)
Creates a new
PageRequest with sort direction and properties applied. |
static CassandraPageRequest |
of(int page,
int size,
Sort sort)
Creates a new
PageRequest with sort parameters applied. |
static CassandraPageRequest |
of(Pageable current,
ByteBuffer pagingState)
Creates a a
PageRequest with sort direction and properties applied. |
PageRequest |
previous() |
String |
toString() |
static void |
validatePageable(Pageable pageable)
Validate the
Pageable whether it can be used for querying. |
CassandraPageRequest |
withSort(Sort sort)
Create a new
CassandraPageRequest associated with Sort sort order. |
first, getSortgetOffset, getPageNumber, getPageSize, hasPrevious, previousOrFirstpublic static CassandraPageRequest of(int page, int size)
PageRequest.page - zero-based page index.size - the size of the page to be returned.IllegalArgumentException - for page requests other than the first page.public static CassandraPageRequest of(int page, int size, Sort sort)
PageRequest with sort parameters applied.page - zero-based page index.size - the size of the page to be returned.sort - must not be null.IllegalArgumentException - for page requests other than the first page.public static CassandraPageRequest of(int page, int size, Sort.Direction direction, String... properties)
PageRequest with sort direction and properties applied.page - zero-based page index.size - the size of the page to be returned.direction - must not be null.properties - must not be null.IllegalArgumentException - for page requests other than the first page.public static CassandraPageRequest of(Pageable current, @Nullable ByteBuffer pagingState)
PageRequest with sort direction and properties applied.public static CassandraPageRequest first(int size)
PageRequest for the first page.size - the size of the page to be returned.public static CassandraPageRequest first(int size, Sort sort)
PageRequest with sort parameters applied for the first page.size - the size of the page to be returned.sort - must not be null.public static CassandraPageRequest first(int size, Sort.Direction direction, String... properties)
PageRequest with sort direction and properties applied for the first page.size - the size of the page to be returned.direction - must not be null.properties - must not be null.public static void validatePageable(Pageable pageable)
Pageable whether it can be used for querying. Valid pageables are either:
CassandraPageRequest with a paging statepageable - IllegalArgumentException - if the Pageable is not valid.@Nullable public ByteBuffer getPagingState()
paging state for the current CassandraPageRequest or null if the
current Pageable represents the last page.public boolean hasNext()
Pageable we can access from the current one. Will return false in
case the current Pageable already refers to the next page.Pageable we can access from the current one.public CassandraPageRequest next()
next in interface Pageablenext in class PageRequestpublic CassandraPageRequest withSort(Sort sort)
CassandraPageRequest associated with Sort sort order.sort - must not be null.CassandraPageRequest associated with the given Sort.public PageRequest previous()
previous in class PageRequestpublic boolean equals(@Nullable Object obj)
equals in class PageRequestpublic int hashCode()
hashCode in class PageRequestpublic String toString()
toString in class PageRequestCopyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.