Top Description Fields Constructors Methods
com.oracle.bmc.paginator.internal

public Class ResponseRecordIterable<REQUESTBUILDER, REQUEST, RESPONSE, ITEMTYPE>

extends Object
implements Iterable<ITEMTYPE>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
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
<ITEMTYPE>
the type of the model/resource returned inside the response
Imports
java.util.function.Function, .Supplier, java.util.List, .Iterator, com.oracle.bmc.InternalSdk

An iterable which can be used to iterate over the models/resources returned by a list operation. These are the items which are contained with the response received from a list operation (e.g. by calling getItems() method on the response object). This iterable will handle calling the service to retrieve more results when required.

Field Summary

Modifier and TypeField and Description
private final Function<RESPONSE, String>
private final Function<REQUEST, RESPONSE>
private final Function<RequestBuilderAndToken<REQUESTBUILDER>, REQUEST>
private final Supplier<REQUESTBUILDER>
private final Function<RESPONSE, List<ITEMTYPE>>

Constructor Summary

AccessConstructor and Description
public
ResponseRecordIterable(final Supplier<REQUESTBUILDER>
a supplier which can called to produce a builder object for requests
requestBuilderSupplier
,
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>> retrieveItemsFromResponseFunction)

Creates a new iterable.

Method Summary

Modifier and TypeMethod and Description
public Iterator<ITEMTYPE>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nextPageTokenRetrievalFunctionback to summary
private final Function<RESPONSE, String> nextPageTokenRetrievalFunction
pageRetrievalFunctionback to summary
private final Function<REQUEST, RESPONSE> pageRetrievalFunction
requestBuilderFunctionback to summary
private final Function<RequestBuilderAndToken<REQUESTBUILDER>, REQUEST> requestBuilderFunction
requestBuilderSupplierback to summary
private final Supplier<REQUESTBUILDER> requestBuilderSupplier
retrieveItemsFromResponseFunctionback to summary
private final Function<RESPONSE, List<ITEMTYPE>> retrieveItemsFromResponseFunction

Constructor Detail

ResponseRecordIterableback to summary
public ResponseRecordIterable(final Supplier<REQUESTBUILDER> requestBuilderSupplier, final Function<RESPONSE, String> nextPageTokenRetrievalFunction, final Function<RequestBuilderAndToken<REQUESTBUILDER>, REQUEST> requestBuilderFunction, final Function<REQUEST, RESPONSE> pageRetrievalFunction, final Function<RESPONSE, List<ITEMTYPE>> retrieveItemsFromResponseFunction)

Creates a new iterable.

Parameters
requestBuilderSupplier:Supplier<REQUESTBUILDER>

a supplier which can called to produce a builder object for requests

nextPageTokenRetrievalFunction:Function<RESPONSE, String>

a function which can extract the next page token from a response produced by a list operation

requestBuilderFunction: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

pageRetrievalFunction:Function<REQUEST, RESPONSE>

a function which will call a list operation with a request and return the response of the call

Annotations
@InternalSdk
backwardCompatibilityRequired:true

Method Detail

iteratorback to summary
public Iterator<ITEMTYPE> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<ITEMTYPE>

an Iterator.

Annotations
@Override