Interface QueryResultStream
- All Superinterfaces:
AutoCloseable,Iterator<QueryResult>
- All Known Implementing Classes:
QueryResultStreamAdapter
Iterator to process the results of a query. Adds hasNext(timeout, TimeUnit timeUnit) operation to limit the time to
wait for the next result.
- Since:
- 4.0
- Author:
- Marc Gathier
-
Method Summary
Methods inherited from interface java.lang.AutoCloseable
closeMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Method Details
-
hasNext
default boolean hasNext()Validates whether there is a following entry in this stream to consume. This method will wait for 1 second to return.- Specified by:
hasNextin interfaceIterator<QueryResult>- Returns:
trueif there is another entry,falseif there isn't for at least 1 second
-
hasNext
Validates whether there is a following entry in this stream to consume. Uses the giventimeoutwith the givenunitto wait to respond- Returns:
trueif there is another entry,falseif there isn't for at the given duration
-
next
QueryResult next()Returns the followingQueryResultfrom this stream. Might returnnullif nothing is present- Specified by:
nextin interfaceIterator<QueryResult>- Returns:
- the following
QueryResultfrom this stream
-