Package no.digipost.collection
Class EnforceAtMostOneElementCollector<T>
- java.lang.Object
-
- no.digipost.collection.EnforceAtMostOneElementCollector<T>
-
- All Implemented Interfaces:
Collector<T,OneTimeAssignment<T>,Optional<T>>
public class EnforceAtMostOneElementCollector<T> extends Object implements Collector<T,OneTimeAssignment<T>,Optional<T>>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.stream.Collector
Collector.Characteristics
-
-
Constructor Summary
Constructors Constructor Description EnforceAtMostOneElementCollector(BiFunction<? super T,? super T,? extends RuntimeException> exceptionOnExcessiveElements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BiConsumer<OneTimeAssignment<T>,T>
accumulator()
Set<Collector.Characteristics>
characteristics()
BinaryOperator<OneTimeAssignment<T>>
combiner()
Function<OneTimeAssignment<T>,Optional<T>>
finisher()
Supplier<OneTimeAssignment<T>>
supplier()
-
-
-
Constructor Detail
-
EnforceAtMostOneElementCollector
public EnforceAtMostOneElementCollector(BiFunction<? super T,? super T,? extends RuntimeException> exceptionOnExcessiveElements)
-
-
Method Detail
-
supplier
public Supplier<OneTimeAssignment<T>> supplier()
-
accumulator
public BiConsumer<OneTimeAssignment<T>,T> accumulator()
- Specified by:
accumulator
in interfaceCollector<T,OneTimeAssignment<T>,Optional<T>>
-
combiner
public BinaryOperator<OneTimeAssignment<T>> combiner()
-
finisher
public Function<OneTimeAssignment<T>,Optional<T>> finisher()
-
characteristics
public Set<Collector.Characteristics> characteristics()
- Specified by:
characteristics
in interfaceCollector<T,OneTimeAssignment<T>,Optional<T>>
-
-