Class AbstractResponseIterator<REQUESTBUILDER,REQUEST,RESPONSE>
- java.lang.Object
- 
- com.oracle.bmc.paginator.internal.AbstractResponseIterator<REQUESTBUILDER,REQUEST,RESPONSE>
 
- 
- Type Parameters:
- REQUESTBUILDER- the type of a builder which can produce requests for a list operation
- REQUEST- the type of a request to a list operation. This type must match the type produced by REQUESTBUILDER
- RESPONSE- the type of the response from a list operation
 - Direct Known Subclasses:
- ResponseIterator,- ResponseRecordIterator
 
 public abstract class AbstractResponseIterator<REQUESTBUILDER,REQUEST,RESPONSE> extends Object Contains common functionality for classes which will iterate over the results of paginated list operations in a service.
- 
- 
Field SummaryFields Modifier and Type Field Description protected RESPONSEcurrentResponseThe most recent response/result of calling the list operation.protected StringnextPageTokenThe page token to use on the next request to the list operationprotected Function<RESPONSE,String>nextPageTokenRetrievalFunctionA function which can be used to extract the next page token from a response from a list operationprotected Function<REQUEST,RESPONSE>pageRetrievalFunctionA function which can call a list operation with a request and return the response from that callprotected REQUESTBUILDERrequestBuilderA builder which can be used to construct requests to the list operationprotected Function<RequestBuilderAndToken<REQUESTBUILDER>,REQUEST>requestBuilderFunctionA function which constructs a request to a list operation based on a builder object and pagination token
 - 
Constructor SummaryConstructors Constructor Description AbstractResponseIterator(REQUESTBUILDER requestBuilder, Function<RESPONSE,String> nextPageTokenRetrievalFunction, Function<RequestBuilderAndToken<REQUESTBUILDER>,REQUEST> requestBuilderFunction, Function<REQUEST,RESPONSE> pageRetrievalFunction)Constructs a new AbstractResponseIterator.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfetchFirstPage()protected voidfetchNextPage()Updates the state of this class with the next page of resultsprotected Optional<String>getNextPageToken()Gets the page token that should be used when the list operation is next called.protected REQUESTgetNextRequest()Based on the state of this class, produces the next request that should be used when calling the list operation so that the next page of results will be returned.
 
- 
- 
- 
Field Detail- 
requestBuilderprotected final REQUESTBUILDER requestBuilder A builder which can be used to construct requests to the list operation
 - 
nextPageTokenRetrievalFunctionprotected final Function<RESPONSE,String> nextPageTokenRetrievalFunction A function which can be used to extract the next page token from a response from a list operation
 - 
pageRetrievalFunctionprotected final Function<REQUEST,RESPONSE> pageRetrievalFunction A function which can call a list operation with a request and return the response from that call
 - 
requestBuilderFunctionprotected final Function<RequestBuilderAndToken<REQUESTBUILDER>,REQUEST> requestBuilderFunction A function which constructs a request to a list operation based on a builder object and pagination token
 - 
currentResponseprotected RESPONSE currentResponse The most recent response/result of calling the list operation.If the operation has never been called, then this will be null 
 - 
nextPageTokenprotected String nextPageToken The page token to use on the next request to the list operation
 
- 
 - 
Constructor Detail- 
AbstractResponseIteratorpublic AbstractResponseIterator(REQUESTBUILDER requestBuilder, Function<RESPONSE,String> nextPageTokenRetrievalFunction, Function<RequestBuilderAndToken<REQUESTBUILDER>,REQUEST> requestBuilderFunction, Function<REQUEST,RESPONSE> pageRetrievalFunction) Constructs a new AbstractResponseIterator.- Parameters:
- requestBuilder- a builder object which can create requests for a list operation
- nextPageTokenRetrievalFunction- a function which can extract the next page token from a response produced by a list operation
- requestBuilderFunction- a function which can build a request for a list operation based on a builder object and a pagination token to use
- pageRetrievalFunction- a function which will call a list operation with a request and return the response of the call
 
 
- 
 - 
Method Detail- 
getNextRequestprotected REQUEST getNextRequest() Based on the state of this class, produces the next request that should be used when calling the list operation so that the next page of results will be returned.This will just create the request and not make any service calls - Returns:
- the next request that should be used when calling the list operation
 
 - 
getNextPageTokenprotected Optional<String> getNextPageToken() Gets the page token that should be used when the list operation is next called.- Returns:
- null if we have not previously made a request to fetch any results. Otherwise, an Optional containing the next page token to use. If there is no next page token to use then an empty/absent Optional will be returned
 
 - 
fetchNextPageprotected void fetchNextPage() Updates the state of this class with the next page of results
 - 
fetchFirstPageprotected void fetchFirstPage() 
 
- 
 
-