Interface ResultSet<T>

  • Type Parameters:
    T - type of entity being returned by the query.
    All Superinterfaces:
    Iterable<T>
    All Known Implementing Classes:
    LazyResultSet, ListResultSet

    public interface ResultSet<T>
    extends Iterable<T>
    Result from any data store query function.
    • Method Detail

      • iterator

        Iterator<T> iterator()
        Obtain an iterator to loop through the results.

        The iterator can be obtained only once. When the iterator completes ( hasNext() returns false) close() will be automatically called.

        Specified by:
        iterator in interface Iterable<T>
      • toList

        com.google.common.collect.ImmutableList<T> toList()
        Materialize all results as a single list.

        Prior to returning close() is invoked. This method must not be combined with iterator() on the same instance.

        Returns:
        immutable list of the complete results.
      • close

        void close()
        Close the result, discarding any further results.

        This method may be invoked more than once. Its main use is to stop obtaining results before the iterator has finished.