T - the value type that the page holdspublic interface Page<T>
Use Page to iterate through all values (also in next pages):
Page<T> page = ...; // get a Page<T> instance
Iterator<T> iterator = page.iterateAll();
while (iterator.hasNext()) {
T value = iterator.next();
// do something with value
}
Or handle pagination explicitly:
Page<T> page = ...; // get a Page<T> instance
while (page != null) {
for (T value : page.values()) {
// do something with value
}
page = page.nextPage();
}| Modifier and Type | Method and Description |
|---|---|
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. |
Iterable<T> |
values()
Returns the values contained in this page.
|
Iterator<T> iterateAll()
String nextPageCursor()
null if no more results.Copyright © 2016 Google. All rights reserved.