Package net.dona.doip.client

# Interface SearchResults<T>

Type Parameters:
  `T` - either String for searchIds or DigitalObject for full search

All Superinterfaces:
  `AutoCloseable`, `Iterable<T>`

All Known Implementing Classes:
  `DoipSearchResults`

public interface SearchResults<T> extends Iterable<T>, AutoCloseable
A representation of search results from `DoipClient` search operations. Provides either ids (an {code Iterable} or `Stream` of String objects) or Digital Objects (an `Iterable` or `Stream` of DigitalObject objects).

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  Closes the search results, releasing the connection to the server.
  `default com.google.gson.JsonArray`
  `getFacets()`
  `Iterator<T>`
  `iterator()`
  Returns an `Iterator` of the search results (either String or DigitalObject).
  `default Stream<T>`
  `parallelStream()`
  Returns a parallel `Stream` of the search results (either String or DigitalObject).
  `int`
  `size()`
  Returns the full number of search results across all pages, or -1 if the number is not available
  `default Spliterator<T>`
  `spliterator()`
  `default Stream<T>`
  `stream()`
  Returns a sequential `Stream` of these search results (either String or DigitalObject).

  ### Methods inherited from interface java.lang.Iterable

  `forEach`

- ## Method Details

  - ### size

    int size()
    Returns the full number of search results across all pages, or -1 if the number is not available
    Returns:
      the full number of search result across all pages, or -1 if the number is not available

  - ### getFacets

    default com.google.gson.JsonArray getFacets()

  - ### iterator

    Iterator<T> iterator()
    Returns an `Iterator` of the search results (either String or DigitalObject).
    Specified by:
      `iterator` in interface `Iterable<T>`

  - ### close

    void close()
    Closes the search results, releasing the connection to the server.
    Specified by:
      `close` in interface `AutoCloseable`

  - ### spliterator

    default Spliterator<T> spliterator()
    Specified by:
      `spliterator` in interface `Iterable<T>`

  - ### stream

    default Stream<T> stream()
    Returns a sequential `Stream` of these search results (either String or DigitalObject).
    Returns:
      a sequential stream of type T of these search results of type T

  - ### parallelStream

    default Stream<T> parallelStream()
    Returns a parallel `Stream` of the search results (either String or DigitalObject).
    Returns:
      a parallel stream of type T of these search results of type T