REQUESTBUILDER
- the type of a builder which can produce requests for a list operationREQUEST
- the type of a request to a list operation. This type must match the type produced
by REQUESTBUILDERRESPONSE
- the type of the response from a list operationITEMTYPE
- the type of the model/resource returned inside the responsepublic class ResponseRecordIterator<REQUESTBUILDER,REQUEST,RESPONSE,ITEMTYPE> extends AbstractResponseIterator<REQUESTBUILDER,REQUEST,RESPONSE> implements Iterator<ITEMTYPE>
An iterator for iterating over response objects returned from a list operation. This iterator handles
calling the service for additional data when needed. However, not every advancement of the iterator
(via its 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 vendThis iterator does not support removal of elements.
currentResponse, nextPageToken, nextPageTokenRetrievalFunction, pageRetrievalFunction, requestBuilder, requestBuilderFunction
Constructor and Description |
---|
ResponseRecordIterator(REQUESTBUILDER requestBuilder,
Function<RESPONSE,String> nextPageTokenRetrievalFunction,
Function<RequestBuilderAndToken<REQUESTBUILDER>,REQUEST> requestBuilderFunction,
Function<REQUEST,RESPONSE> pageRetrievalFunction,
Function<RESPONSE,List<ITEMTYPE>> retrieveItemsFromResponseFunction)
Constructs a new ResponseRecordIterator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
ITEMTYPE |
next() |
void |
remove() |
fetchNextPage, getNextPageToken, getNextRequest
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public ResponseRecordIterator(REQUESTBUILDER requestBuilder, Function<RESPONSE,String> nextPageTokenRetrievalFunction, Function<RequestBuilderAndToken<REQUESTBUILDER>,REQUEST> requestBuilderFunction, Function<REQUEST,RESPONSE> pageRetrievalFunction, Function<RESPONSE,List<ITEMTYPE>> retrieveItemsFromResponseFunction)
Constructs a new ResponseRecordIterator.
requestBuilder
- a builder object which can create requests for a list operationnextPageTokenRetrievalFunction
- a function which can extract the next page token from a
response produced by a list operationrequestBuilderFunction
- a function which can build a request for a list operation based on
a builder object and a pagination token to usepageRetrievalFunction
- a function which will call a list operation with a request and return
the response of the callretrieveItemsFromResponseFunction
- a function which can extract the collection of results
from a response produced by a list operationCopyright © 2016–2022. All rights reserved.