Package no.digipost.collection
Class EnforceAtMostOneElementCollector<T>
java.lang.Object
no.digipost.collection.EnforceAtMostOneElementCollector<T>
- All Implemented Interfaces:
Collector<T,,OneTimeAssignment<T>, Optional<T>> EmptyResultIfEmptySourceCollector<T,OneTimeAssignment<T>, T>
public class EnforceAtMostOneElementCollector<T>
extends Object
implements EmptyResultIfEmptySourceCollector<T,OneTimeAssignment<T>,T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.stream.Collector
Collector.Characteristics -
Constructor Summary
ConstructorsConstructorDescriptionEnforceAtMostOneElementCollector(BiFunction<? super T, ? super T, ? extends RuntimeException> exceptionOnExcessiveElements) -
Method Summary
-
Constructor Details
-
EnforceAtMostOneElementCollector
public EnforceAtMostOneElementCollector(BiFunction<? super T, ? super T, ? extends RuntimeException> exceptionOnExcessiveElements)
-
-
Method Details
-
supplier
-
accumulator
- Specified by:
accumulatorin interfaceCollector<T,OneTimeAssignment<T>, Optional<T>>
-
combiner
-
finisher
-
characteristics
- Specified by:
characteristicsin interfaceCollector<T,OneTimeAssignment<T>, Optional<T>>
-