Package com.cognite.client.servicesV1
Class ConnectorServiceV1.ResultFutureIterator<T>
- java.lang.Object
-
- com.cognite.client.servicesV1.ConnectorServiceV1.ConnectorBase
-
- com.cognite.client.servicesV1.ConnectorServiceV1.ResultFutureIterator<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Serializable,Iterator<CompletableFuture<ResponseItems<T>>>
- Enclosing class:
- ConnectorServiceV1
public abstract static class ConnectorServiceV1.ResultFutureIterator<T> extends ConnectorServiceV1.ConnectorBase implements Iterator<CompletableFuture<ResponseItems<T>>>
Iterator for paging through requests based on response cursors. This iterator is based on async request, and will return aCompletableFutureon eachnext()call. However,hasNext()needs to wait for the current request to complete before being able to evaluate if it carries a cursor to the next page.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResultFutureIterator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()CompletableFuture<ResponseItems<T>>next()static <T> ConnectorServiceV1.ResultFutureIterator<T>of(CogniteClient client, RequestProvider requestProvider, ResponseParser<T> responseParser)ConnectorServiceV1.ResultFutureIterator<T>withRequestExecutor(RequestExecutor requestExecutor)Configure a specificRequestExecutorto handle the HTTP(S) request against the Cognnite API.-
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, remove
-
-
-
-
Method Detail
-
of
public static <T> ConnectorServiceV1.ResultFutureIterator<T> of(CogniteClient client, RequestProvider requestProvider, ResponseParser<T> responseParser)
-
withRequestExecutor
public ConnectorServiceV1.ResultFutureIterator<T> withRequestExecutor(RequestExecutor requestExecutor)
Configure a specificRequestExecutorto handle the HTTP(S) request against the Cognnite API.- Parameters:
requestExecutor- The RequestExecutor to use.- Returns:
- ResultFutureIterator with the configured RequestExecutor.
-
next
public CompletableFuture<ResponseItems<T>> next() throws NoSuchElementException
- Specified by:
nextin interfaceIterator<T>- Throws:
NoSuchElementException
-
-