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.Pageable
from
(org.springframework.data.domain.Pageable pageable, com.google.cloud.datastore.Cursor cursor, Long totalCount) Creates aDatastorePageable
wrapper for a paged request, but passes unpaged requests back unchanged.static org.springframework.data.domain.Pageable
Creates aDatastorePageable
wrapper for a paged request, but passes unpaged requests back unchanged.org.springframework.data.domain.PageRequest
next()
com.google.cloud.datastore.Cursor
toCursor()
Methods inherited from class org.springframework.data.domain.PageRequest
equals, first, getSort, hashCode, of, of, of, ofSize, previous, toString, withPage, withSort, withSort
Methods inherited from class org.springframework.data.domain.AbstractPageRequest
getOffset, getPageNumber, getPageSize, hasPrevious, previousOrFirst
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 aDatastorePageable
wrapper for a paged request, but passes unpaged requests back unchanged.- Parameters:
pageable
- The sourcePageable
that can be paged or unpagedcursor
- Current cursor; null if not applicabletotalCount
- Total result count- Returns:
- an instance of
DatastorePageable
or the original unpagedPageable
.
-
from
public static org.springframework.data.domain.Pageable from(org.springframework.data.domain.Pageable pageable, String urlSafeCursor, Long totalCount) Creates aDatastorePageable
wrapper for a paged request, but passes unpaged requests back unchanged.- Parameters:
pageable
- The sourcePageable
that can be paged or unpagedurlSafeCursor
- Current cursor as ; null if not applicabletotalCount
- Current cursor; null if not applicable- Returns:
- an instance of
DatastorePageable
or the original unpagedPageable
.
-
getUrlSafeCursor
-
next
public org.springframework.data.domain.PageRequest next()- Specified by:
next
in interfaceorg.springframework.data.domain.Pageable
- Overrides:
next
in classorg.springframework.data.domain.PageRequest
-
toCursor
public com.google.cloud.datastore.Cursor toCursor() -
getTotalCount
-