Package no.digipost.stream
Interface EmptyResultIfEmptySourceCollector<T,A,R>
- Type Parameters:
T- the type of input elements to the reduction operationR- the type of value contained in the resulting Optional, if not source is empty.
- All Known Implementing Classes:
EnforceAtMostOneElementCollector
A collector type specific for implementations which produce an
Optional
based on if the source (typically a Stream, or more apropriately,
a NonEmptyStream) yields no elements or any element(s). Typically appropriate
for reduction operations which needs at least one element to produce a valid result.-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.stream.Collector
Collector.Characteristics -
Method Summary
Static MethodsMethods inherited from interface java.util.stream.Collector
accumulator, characteristics, combiner, finisher, supplier
-
Method Details
-
from
static <T,A, EmptyResultIfEmptySourceCollector<T,R> A, fromR> (Collector<T, A, Optional<R>> collector)
-