T - the value type that the page holdspublic interface AsyncPage<T> extends Page<T>
Use AsyncPage to iterate through all values (also in next pages):
AsyncPage<T> page = ...; // get an AsyncPage<T> instance
Iterator<T> iterator = page.iterateAll();
while (iterator.hasNext()) {
T value = iterator.next();
// do something with value
}
Or handle pagination explicitly:
AsyncPage<T> page = ...; // get a AsyncPage<T> instance
while (page != null) {
for (T value : page.values()) {
// do something with value
}
page = page.nextPageAsync().get();
}| Modifier and Type | Method and Description |
|---|---|
Future<AsyncPage<T>> |
nextPageAsync()
Returns a
Future object for the next page. |
iterateAll, nextPage, nextPageCursor, valuesFuture<AsyncPage<T>> nextPageAsync()
Future object for the next page. Future.get() returns null if
the last page has been reached.Copyright © 2016 Google. All rights reserved.