java.lang.Object
io.smallrye.mutiny.groups.Gatherer.ExtractStep<I,ACC>
- Type Parameters:
I- the type of the items emitted by the upstreamMultiACC- the type of the accumulator
The second step in the builder to gather items emitted by a
Multi into an accumulator.-
Method Summary
Modifier and TypeMethodDescription<O> Gatherer.FinalizerStep<I, ACC, O> extract(BiFunction<ACC, Boolean, Optional<Gatherer.Extraction<ACC, O>>> extractor) Specifies the extractor function.
-
Method Details
-
extract
@CheckReturnValue public <O> Gatherer.FinalizerStep<I,ACC, extractO> (BiFunction<ACC, Boolean, Optional<Gatherer.Extraction<ACC, O>>> extractor) Specifies the extractor function.The extractor function is used to extract the items from the accumulator. When the extractor function returns an empty
Optional, no value is emitted. When the extractor function returns a non-emptyOptional, the value is emitted, and the accumulator is updated. This is done by returning aGatherer.Extractioncontaining the new accumulator and the value to emit.- Type Parameters:
O- the type of the value to emit- Parameters:
extractor- the extractor function, which takes the current accumulator and returns anOptionalcontaining aGatherer.Extractionwith the new accumulator and the value to emit- Returns:
- the next step in the builder
-