Interface QueryResultStream

All Superinterfaces:
AutoCloseable, Iterator<QueryResult>
All Known Implementing Classes:
QueryResultStreamAdapter

public interface QueryResultStream extends Iterator<QueryResult>, AutoCloseable
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

    Modifier and Type
    Method
    Description
    default boolean
    Validates whether there is a following entry in this stream to consume.
    boolean
    hasNext(int timeout, TimeUnit unit)
    Validates whether there is a following entry in this stream to consume.
    Returns the following QueryResult from this stream.

    Methods inherited from interface java.lang.AutoCloseable

    close

    Methods 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:
      hasNext in interface Iterator<QueryResult>
      Returns:
      true if there is another entry, false if there isn't for at least 1 second
    • hasNext

      boolean hasNext(int timeout, TimeUnit unit)
      Validates whether there is a following entry in this stream to consume. Uses the given timeout with the given unit to wait to respond
      Returns:
      true if there is another entry, false if there isn't for at the given duration
    • next

      QueryResult next()
      Returns the following QueryResult from this stream. Might return null if nothing is present
      Specified by:
      next in interface Iterator<QueryResult>
      Returns:
      the following QueryResult from this stream