T
- the element typepublic abstract class PagedFetcher<T> extends Object
Constructor and Description |
---|
PagedFetcher() |
Modifier and Type | Method and Description |
---|---|
Iterable<T> |
elements()
Returns an iterable object that traverses all fetched elements across all
associated pages.
|
Iterable<Page<T>> |
pages()
Returns an iterable object that fetches and traverses all matching pages.
|
@Nonnull public Iterable<T> elements()
Since multiple fetches may be necessary to iterate over all batches it is possible that concurrent changes on the server will cause the same batch to be iterated over twice.
ALso, since the returned iterator will perform asynchronous network
traffic it is possible that the Iterator.hasNext()
and
Iterator.next()
methods throws RuntimeException
having as
cause an ExecutionException
.
RuntimeException
- if the background page fetching failed@Nonnull public Iterable<Page<T>> pages()
This iterator will always yield at least one page, which might be empty.
Since the returned iterator will perform asynchronous network traffic it
is possible that the Iterator.next()
method throws
RuntimeException
having as cause an ExecutionException
.
RuntimeApiException
- if the background page fetching failedCopyright © 2016–2019 CLX Communications. All rights reserved.