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
public interface EmptyResultIfEmptySourceCollector<T,A,R> extends Collector<T,A,Optional<R>>
A collector type specific for implementations which produce anOptionalbased on if the source (typically aStream, or more apropriately, aNonEmptyStream) 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 Methods Modifier and Type Method Description static <T,A,R>
EmptyResultIfEmptySourceCollector<T,A,R>from(Collector<T,A,Optional<R>> collector)-
Methods inherited from interface java.util.stream.Collector
accumulator, characteristics, combiner, finisher, supplier
-
-
-
-
Method Detail
-
from
static <T,A,R> EmptyResultIfEmptySourceCollector<T,A,R> from(Collector<T,A,Optional<R>> collector)
-
-