T
- type of entity being returned by the query.public interface ResultSet<T> extends Iterable<T>
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the result, discarding any further results.
|
Iterator<T> |
iterator()
Obtain an iterator to loop through the results.
|
com.google.common.collect.ImmutableList<T> |
toList()
Materialize all results as a single list.
|
forEach, spliterator
Iterator<T> iterator()
The iterator can be obtained only once. When the iterator completes ( hasNext()
returns false) close()
will be automatically called.
com.google.common.collect.ImmutableList<T> toList()
Prior to returning close()
is invoked. This method must not be combined with iterator()
on the same instance.
void close()
This method may be invoked more than once. Its main use is to stop obtaining results before the iterator has finished.