public class UniOnNotNull<T> extends Object
| Constructor and Description |
|---|
UniOnNotNull(Uni<T> upstream) |
| Modifier and Type | Method and Description |
|---|---|
<R> Uni<R> |
apply(Function<? super T,? extends R> mapper)
|
Uni<T> |
invoke(Consumer<? super T> callback)
Produces a new
Uni invoking the given callback when the item event is fired. |
<R> Uni<R> |
produceCompletionStage(Function<? super T,? extends CompletionStage<? extends R>> mapper)
Transforms the received item asynchronously, forwarding the events emitted by another
CompletionStage
produced by the given mapper. |
<R> Multi<R> |
produceMulti(Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> mapper)
When this
Uni produces its item (not null), call the given mapper to produce
a Publisher. |
<R> Uni<R> |
produceUni(BiConsumer<? super T,UniEmitter<? super R>> consumer)
Transforms the received item asynchronously, forwarding the events emitted an
UniEmitter consumes by
the given consumer. |
<R> Uni<R> |
produceUni(Function<? super T,? extends Uni<? extends R>> mapper)
Transforms the received item asynchronously, forwarding the events emitted by another
Uni produced by
the given mapper. |
public Uni<T> invoke(Consumer<? super T> callback)
Uni invoking the given callback when the item event is fired. If the item is
null, the callback is not invoked.callback - the callback, must not be nullUnipublic <R> Uni<R> apply(Function<? super T,? extends R> mapper)
Uni invoking the given function when the current Uni fires the item event.
The function receives the (non-null) item as parameter, and can transform it. The returned object is sent downstream
as item.
If the item is `null`, the mapper is not called and it produces a null item.
For asynchronous composition, see produceUni(Function).
R - the type of Uni itemmapper - the mapper function, must not be nullUnipublic <R> Uni<R> produceUni(Function<? super T,? extends Uni<? extends R>> mapper)
Uni produced by
the given mapper.
The mapper is called with the item event of the current Uni and produces an Uni, possibly
using another type of item (R). The events fired by produced Uni are forwarded to the
Uni returned by this method.
If the item is null, the mapper is not called, and null is propagated downstream.
This operation is generally named flatMap.
public <R> Multi<R> produceMulti(Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> mapper)
Uni produces its item (not null), call the given mapper to produce
a Publisher. Continue the pipeline with this publisher (as a Multi).
The mapper is called with the item event of the current Uni and produces a Publisher, possibly
using another type of item (R). Events fired by the produced Publisher are forwarded to the
Multi returned by this method.
If the item is `null`, the mapper is not called and an empty Multi is produced.
This operation is generally named flatMapPublisher.
R - the type of item produced by the resulting Multimapper - the mapper, must not be null, may expect to receive null as item.public <R> Uni<R> produceCompletionStage(Function<? super T,? extends CompletionStage<? extends R>> mapper)
CompletionStage
produced by the given mapper.
The mapper is called with the item event of the current Uni and produces an CompletionStage,
possibly using another type of item (R). The events fired by produced CompletionStage are
forwarded to the Uni returned by this method.
If the incoming item is null, the mapper is not called, and a CompletionStage redeeming
null is returned.
R - the type of itemmapper - the function called with the item of this Uni and producing the CompletionStage,
must not be null, must not return null.Uni that would fire events from the uni produced by the mapper function, possibly
in an asynchronous manner.public <R> Uni<R> produceUni(BiConsumer<? super T,UniEmitter<? super R>> consumer)
UniEmitter consumes by
the given consumer.
The consumer is called with the item event of the current Uni and an emitter uses to fire events.
These events are these propagated by the produced Uni.
If the incoming item is null, the consumer is not called and a null item is propagated
downstream.
R - the type of item emitted by the emitterconsumer - the function called with the item of the this Uni and an UniEmitter.
It must not be null.Uni that would fire events from the emitter consumed by the mapper function, possibly
in an asynchronous manner.Copyright © 2019–2020 SmallRye. All rights reserved.