Interface IQueryResult<T>
- All Superinterfaces:
IQueryable<T>, Iterable<T>
- All Known Implementing Classes:
CollectionResult, Collector
An IQueryResult represents the results of a query.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisEmpty()Returns whether this QueryResult is empty.iterator()Returns an iterator on the collected objects.stream()Returns a sequentialStreamof the collected objects.T[]Returns the collected objects as an arraytoSet()Creates a new Set copy with the contents of this query result.Returns a Set backed by this query result.Methods inherited from interface IQueryable
contains, queryMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
isEmpty
boolean isEmpty()Returns whether this QueryResult is empty.- Returns:
trueif this QueryResult has accepted any results, andfalseotherwise.
-
iterator
-
toArray
Returns the collected objects as an array- Parameters:
clazz- The type of array to return- Returns:
- The array of results
- Throws:
ArrayStoreException- the runtime type of the specified array is not a super-type of the runtime type of every collected object
-
toSet
-
toUnmodifiableSet
-
stream
Returns a sequentialStreamof the collected objects.- Since:
- 2.8
- Implementation Requirements:
- The default implementation creates a sequential
Streamfrom this query-resultsSpliterator. Implementations backed by aCollectionshould override this method and callCollection.stream().
-