Package org.codice.ddf.commands.util
Class QueryResultIterable
java.lang.Object
org.codice.ddf.commands.util.QueryResultIterable
- All Implemented Interfaces:
Iterable<ddf.catalog.data.Result>
Effectively a cursor over the results of a filter that automatically pages through all results
Throws a
Throws a
CatalogCommandRuntimeException if anything goes wrong during iteration or
querying-
Constructor Summary
ConstructorsConstructorDescriptionQueryResultIterable(ddf.catalog.CatalogFramework catalog, Function<Integer, ddf.catalog.operation.QueryRequest> filter) For paging through a single filter with a default pageSize of 64QueryResultIterable(ddf.catalog.CatalogFramework catalog, Function<Integer, ddf.catalog.operation.QueryRequest> filter, int pageSize) For paging through a single filter. -
Method Summary
Modifier and TypeMethodDescriptionIterator<ddf.catalog.data.Result> iterator()Spliterator<ddf.catalog.data.Result> Stream<ddf.catalog.data.Result> stream()
-
Constructor Details
-
QueryResultIterable
public QueryResultIterable(ddf.catalog.CatalogFramework catalog, Function<Integer, ddf.catalog.operation.QueryRequest> filter) For paging through a single filter with a default pageSize of 64- Parameters:
catalog- catalog to queryfilter- A dynamic supplier of a filter that takes the current index such that the caller can control iteration based on their own logic
-
QueryResultIterable
public QueryResultIterable(ddf.catalog.CatalogFramework catalog, Function<Integer, ddf.catalog.operation.QueryRequest> filter, int pageSize) For paging through a single filter.- Parameters:
catalog- catalog to queryfilter- A dynamic supplier of a filter that takes the current index such that the caller can control iteration based on their own logicpageSize- How many results should each page hold
-
-
Method Details
-
iterator
-
spliterator
- Specified by:
spliteratorin interfaceIterable<ddf.catalog.data.Result>
-
stream
-