Class ResponseIterator<REQUESTBUILDER,REQUEST,RESPONSE>
- java.lang.Object
-
- com.oracle.bmc.paginator.internal.AbstractResponseIterator<REQUESTBUILDER,REQUEST,RESPONSE>
-
- com.oracle.bmc.paginator.internal.ResponseIterator<REQUESTBUILDER,REQUEST,RESPONSE>
-
- 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 operation
- All Implemented Interfaces:
Iterator<RESPONSE>
public class ResponseIterator<REQUESTBUILDER,REQUEST,RESPONSE> extends AbstractResponseIterator<REQUESTBUILDER,REQUEST,RESPONSE> implements Iterator<RESPONSE>
An iterator for iterating over response objects returned from a list operation.Each time we advance the iterator (via its
next()
method) we will call the list operation of the service for the next response.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 ResponseIterator(REQUESTBUILDER requestBuilder, Function<RESPONSE,String> nextPageTokenRetrievalFunction, Function<RequestBuilderAndToken<REQUESTBUILDER>,REQUEST> requestBuilderFunction, Function<REQUEST,RESPONSE> pageRetrievalFunction)
Constructs a new ResponseIterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
RESPONSE
next()
void
remove()
-
Methods inherited from class com.oracle.bmc.paginator.internal.AbstractResponseIterator
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
-
ResponseIterator
public ResponseIterator(REQUESTBUILDER requestBuilder, Function<RESPONSE,String> nextPageTokenRetrievalFunction, Function<RequestBuilderAndToken<REQUESTBUILDER>,REQUEST> requestBuilderFunction, Function<REQUEST,RESPONSE> pageRetrievalFunction)
Constructs a new ResponseIterator.- 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 call
-
-
Method Detail
-
next
public RESPONSE next()
- Specified by:
next
in interfaceIterator<REQUESTBUILDER>
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceIterator<REQUESTBUILDER>
-
remove
public void remove()
- Specified by:
remove
in interfaceIterator<REQUESTBUILDER>
-
-