next() method) will result in a method call. Instead, the logic of
this iterator can be described as:
next() will vend individual model/resource objects from that page until there are
no more to vend
| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private Iterator | |
| private final Function |
| Access | Constructor and Description |
|---|---|
| public | ResponseRecordIterator(final REQUESTBUILDER
a builder object which can create requests for a list operation requestBuilder, final Function<RESPONSE, String> a function which can extract the next page token from a
response produced by a list operation nextPageTokenRetrievalFunction, final Function<RequestBuilderAndToken<REQUESTBUILDER>, REQUEST> a function which can build a request for a list operation based
on a builder object and a pagination token to use requestBuilderFunction, final Function<REQUEST, RESPONSE> a function which will call a list operation with a request and
return the response of the call pageRetrievalFunction, final Function<RESPONSE, List<ITEMTYPE>> a function which can extract the collection of
results from a response produced by a list operation retrieveItemsFromResponseFunction)Constructs a new ResponseRecordIterator. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| public boolean | |
| public ITEMTYPE | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| currentItems | back to summary |
|---|---|
| private List<ITEMTYPE> currentItems | |
| currentIterator | back to summary |
|---|---|
| private Iterator<ITEMTYPE> currentIterator | |
| retrieveItemsFromResponseFunction | back to summary |
|---|---|
| private final Function<RESPONSE, List<ITEMTYPE>> retrieveItemsFromResponseFunction | |
| ResponseRecordIterator | back to summary |
|---|---|
| public ResponseRecordIterator(final REQUESTBUILDER requestBuilder, final Function<RESPONSE, String> nextPageTokenRetrievalFunction, final Function<RequestBuilderAndToken<REQUESTBUILDER>, REQUEST> requestBuilderFunction, final Function<REQUEST, RESPONSE> pageRetrievalFunction, final Function<RESPONSE, List<ITEMTYPE>> retrieveItemsFromResponseFunction) Constructs a new ResponseRecordIterator.
| |
| getFirstPage | back to summary |
|---|---|
| private void getFirstPage() | |
| getNextPage | back to summary |
|---|---|
| private void getNextPage() | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public ITEMTYPE next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the
| |