Class DatastorePageable
java.lang.Object
org.springframework.data.domain.AbstractPageRequest
org.springframework.data.domain.PageRequest
com.google.cloud.spring.data.datastore.repository.query.DatastorePageable
- All Implemented Interfaces:
Serializable,org.springframework.data.domain.Pageable
public class DatastorePageable
extends org.springframework.data.domain.PageRequest
A pageable implementation for Cloud Datastore that uses the cursor for efficient reads.
The static methods can take either paged or unpaged Pageable, while instance methods
only deal with a paged self object.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.data.domain.Pageablefrom(org.springframework.data.domain.Pageable pageable, com.google.cloud.datastore.Cursor cursor, Long totalCount) Creates aDatastorePageablewrapper for a paged request, but passes unpaged requests back unchanged.static org.springframework.data.domain.PageableCreates aDatastorePageablewrapper for a paged request, but passes unpaged requests back unchanged.org.springframework.data.domain.PageRequestnext()com.google.cloud.datastore.CursortoCursor()Methods inherited from class org.springframework.data.domain.PageRequest
equals, first, getSort, hashCode, of, of, of, ofSize, previous, toString, withPage, withSort, withSortMethods inherited from class org.springframework.data.domain.AbstractPageRequest
getOffset, 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
-
Method Details
-
from
public static org.springframework.data.domain.Pageable from(org.springframework.data.domain.Pageable pageable, com.google.cloud.datastore.Cursor cursor, Long totalCount) Creates aDatastorePageablewrapper for a paged request, but passes unpaged requests back unchanged.- Parameters:
pageable- The sourcePageablethat can be paged or unpagedcursor- Current cursor; null if not applicabletotalCount- Total result count- Returns:
- an instance of
DatastorePageableor the original unpagedPageable.
-
from
public static org.springframework.data.domain.Pageable from(org.springframework.data.domain.Pageable pageable, String urlSafeCursor, Long totalCount) Creates aDatastorePageablewrapper for a paged request, but passes unpaged requests back unchanged.- Parameters:
pageable- The sourcePageablethat can be paged or unpagedurlSafeCursor- Current cursor as ; null if not applicabletotalCount- Current cursor; null if not applicable- Returns:
- an instance of
DatastorePageableor the original unpagedPageable.
-
getUrlSafeCursor
-
next
public org.springframework.data.domain.PageRequest next()- Specified by:
nextin interfaceorg.springframework.data.domain.Pageable- Overrides:
nextin classorg.springframework.data.domain.PageRequest
-
toCursor
public com.google.cloud.datastore.Cursor toCursor() -
getTotalCount
-