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 a
CompletableFuture on each
next() 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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()next()static <T> ConnectorServiceV1.ResultFutureIterator<T>of(CogniteClient client, RequestProvider requestProvider, ResponseParser<T> responseParser) 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, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
ResultFutureIterator
public ResultFutureIterator()
-
-
Method Details
-
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.
-
hasNext
public boolean hasNext() -
next
- Specified by:
nextin interfaceIterator<T>- Throws:
NoSuchElementException
-