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

public Class ResponseIterable<REQUESTBUILDER, REQUEST, RESPONSE>

extends Object
implements Iterable<RESPONSE>
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
Imports
java.util.function.Function, .Supplier, java.util.Iterator, com.oracle.bmc.InternalSdk

An iterable which can be used to iterate over responses returned from calling a list operation. Since this deals in responses, the returned response objects will contain a collection of results. 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>

Constructor Summary

AccessConstructor and Description
public
ResponseIterable(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
)

Creates a new iterable.

Method Summary

Modifier and TypeMethod and Description
public Iterator<RESPONSE>
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

Constructor Detail

ResponseIterableback to summary
public ResponseIterable(final Supplier<REQUESTBUILDER> requestBuilderSupplier, final Function<RESPONSE, String> nextPageTokenRetrievalFunction, final Function<RequestBuilderAndToken<REQUESTBUILDER>, REQUEST> requestBuilderFunction, final Function<REQUEST, RESPONSE> pageRetrievalFunction)

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<RESPONSE> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<RESPONSE>

an Iterator.

Annotations
@Override