Interface QueryResult<T>

Type Parameters:
T - Type of queried objects
All Superinterfaces:
AutoCloseable, Iterable<T>

public interface QueryResult<T> extends AutoCloseable, Iterable<T>
This interface describes actions which could be done with query results
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the stream of query result and releases resources
    boolean
    Checks if query result is empty
    Iterate through the query resulting objects
    int
    Calculate number of objects in query result
    Converts query result to a stream
    Converts query result to collection

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • stream

      Stream<T> stream()
      Converts query result to a stream
      Returns:
      stream of T objects
    • size

      int size()
      Calculate number of objects in query result
      Returns:
      integer number
    • isEmpty

      boolean isEmpty()
      Checks if query result is empty
      Returns:
      true if query result has no objects
    • iterator

      Iterator<T> iterator()
      Iterate through the query resulting objects
      Specified by:
      iterator in interface Iterable<T>
      Returns:
      iterator
    • close

      void close()
      Closes the stream of query result and releases resources
      Specified by:
      close in interface AutoCloseable
    • toCollection

      ResultCollection<T> toCollection()
      Converts query result to collection
      Returns:
      collection of type T objects