Class QueryResultIterable

java.lang.Object
org.codice.ddf.commands.util.QueryResultIterable
All Implemented Interfaces:
Iterable<ddf.catalog.data.Result>

public class QueryResultIterable extends Object implements Iterable<ddf.catalog.data.Result>
Effectively a cursor over the results of a filter that automatically pages through all results
Throws a CatalogCommandRuntimeException if anything goes wrong during iteration or querying
  • 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 query
      filter - 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 query
      filter - A dynamic supplier of a filter that takes the current index such that the caller can control iteration based on their own logic
      pageSize - How many results should each page hold
  • Method Details

    • iterator

      public Iterator<ddf.catalog.data.Result> iterator()
      Specified by:
      iterator in interface Iterable<ddf.catalog.data.Result>
    • spliterator

      public Spliterator<ddf.catalog.data.Result> spliterator()
      Specified by:
      spliterator in interface Iterable<ddf.catalog.data.Result>
    • stream

      public Stream<ddf.catalog.data.Result> stream()