T - the value type that the page holdspublic class PageImpl<T> extends Object implements Page<T>, Serializable
| Modifier and Type | Class and Description |
|---|---|
static interface |
PageImpl.NextPageFetcher<T>
Interface for fetching the next page of results from the service.
|
| Constructor and Description |
|---|
PageImpl(PageImpl.NextPageFetcher<T> pageFetcher,
String cursor,
Iterable<T> results)
Creates a
PageImpl object. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
Iterator<T> |
iterateAll()
Returns an iterator for all values, possibly also in the next pages.
|
Page<T> |
nextPage()
Returns the next page of results or
null if no more result. |
String |
nextPageCursor()
Returns the cursor for the nextPage or
null if no more results. |
static <T> Map<T,Object> |
nextRequestOptions(T pageTokenOption,
String cursor,
Map<T,?> optionMap)
Utility method to construct the options map for the next page request.
|
Iterable<T> |
values()
Returns the values contained in this page.
|
public PageImpl(PageImpl.NextPageFetcher<T> pageFetcher, String cursor, Iterable<T> results)
PageImpl object. In order for the object to be serializable the results parameter must be serializable.public Iterable<T> values()
Pagepublic Iterator<T> iterateAll()
PageiterateAll in interface Page<T>public String nextPageCursor()
Pagenull if no more results.nextPageCursor in interface Page<T>public Page<T> nextPage()
Pagenull if no more result.public static <T> Map<T,Object> nextRequestOptions(T pageTokenOption, String cursor, Map<T,?> optionMap)
T - the value type that the page holds. Instances of T should be
SerializablepageTokenOption - the key for the next page cursor option in the options mapcursor - the cursor for the next pageoptionMap - the previous options mapCopyright © 2016 Google. All rights reserved.