Class ResponseRecordIterator<REQUESTBUILDER,REQUEST,RESPONSE,ITEMTYPE>
- java.lang.Object
-
- com.oracle.bmc.paginator.internal.AbstractResponseIterator<REQUESTBUILDER,REQUEST,RESPONSE>
-
- com.oracle.bmc.paginator.internal.ResponseRecordIterator<REQUESTBUILDER,REQUEST,RESPONSE,ITEMTYPE>
-
- Type Parameters:
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 response
- All Implemented Interfaces:
Iterator<ITEMTYPE>
public 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:- Fetch a page of results from the service
next()will vend individual model/resource objects from that page until there are no more to vend- Call the service for the next page of results
- Repeat steps 2 and 3 until there are no more results
-
This iterator does not support removal of elements.
-
-
Field Summary
-
Fields inherited from class com.oracle.bmc.paginator.internal.AbstractResponseIterator
currentResponse, nextPageToken, nextPageTokenRetrievalFunction, pageRetrievalFunction, requestBuilder, requestBuilderFunction
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()ITEMTYPEnext()voidremove()-
Methods inherited from class com.oracle.bmc.paginator.internal.AbstractResponseIterator
fetchFirstPage, fetchNextPage, getNextPageToken, getNextRequest
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
ResponseRecordIterator
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.- Parameters:
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 operation
-
-
Method Detail
-
next
public ITEMTYPE next()
- Specified by:
nextin interfaceIterator<REQUESTBUILDER>
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceIterator<REQUESTBUILDER>
-
remove
public void remove()
- Specified by:
removein interfaceIterator<REQUESTBUILDER>
-
-