wrap

fun wrap(vararg collectors: Collector?): Collector

See wrap.


fun wrap(collectors: Iterable<Collector?>): Collector

Wraps a list of Collectors with a MultiCollector. This method works as follows:

  • Filters out the `null` collectors, so they are not used during search time.
  • If the input contains 1 real collector (i.e. non-`null` ), it is returned.
  • Otherwise the method returns a [MultiCollector] which wraps the non-`null` ones.

Throws

if either 0 collectors were input, or all collectors are null.