public class UniOnItemOrFailure<T> extends Object
| Constructor and Description |
|---|
UniOnItemOrFailure(Uni<T> upstream) |
| Modifier and Type | Method and Description |
|---|---|
<R> Uni<R> |
apply(BiFunction<? super T,Throwable,? extends R> mapper)
Deprecated.
|
Uni<T> |
invoke(BiConsumer<? super T,Throwable> callback)
|
Uni<T> |
invokeUni(BiFunction<? super T,Throwable,? extends Uni<?>> callback)
|
<R> Uni<R> |
produceUni(BiFunction<? super T,Throwable,? extends Uni<? extends R>> mapper)
Deprecated.
Use
transformToUni(BiFunction) instead |
<R> Uni<R> |
produceUni(Functions.TriConsumer<? super T,Throwable,UniEmitter<? super R>> consumer)
Deprecated.
Use
transformToUni(Functions.TriConsumer) instead |
<R> Uni<R> |
transform(BiFunction<? super T,Throwable,? extends R> mapper)
|
<R> Uni<R> |
transformToUni(BiFunction<? super T,Throwable,? extends Uni<? extends R>> mapper)
Transforms the received item or failure asynchronously, forwarding the events emitted by another
Uni
produced by the given mapper. |
<R> Uni<R> |
transformToUni(Functions.TriConsumer<? super T,Throwable,UniEmitter<? super R>> consumer)
Transforms the received item or failure asynchronously, forwarding the events emitted by the
UniEmitter
provided to the given consumer. |
public Uni<T> invoke(BiConsumer<? super T,Throwable> callback)
Uni invoking the given callback when the item or failure event is fired.
Note that the item can be null, so detecting failures must be done by checking whether the failure
parameter is null.callback - the callback, must not be nullUnipublic Uni<T> invokeUni(BiFunction<? super T,Throwable,? extends Uni<?>> callback)
Uni invoking the given callback when the item or failure event is fired.
Note that the item can be null, so detecting failures must be done by checking whether the failure
parameter is null.callback - the callback, must not be nullUni@Deprecated public <R> Uni<R> apply(BiFunction<? super T,Throwable,? extends R> mapper)
transform(BiFunction)Uni invoking the given function when the current Uni fires the item or
failure event. Note that the item can be null, so detecting failures must be done by checking
whether the failure parameter is null.
The function receives the item and failure as parameters, and can transform the item or recover from the failure.
The returned object is sent downstream as item.
For asynchronous composition, see transformToUni(BiFunction).
R - the type of Uni itemmapper - the mapper function, must not be nullUnipublic <R> Uni<R> transform(BiFunction<? super T,Throwable,? extends R> mapper)
Uni invoking the given function when the current Uni fires the item or
failure event. Note that the item can be null, so detecting failures must be done by checking
whether the failure parameter is null.
The function receives the item and failure as parameters, and can transform the item or recover from the failure.
The returned object is sent downstream as item.
For asynchronous composition, see transformToUni(BiFunction).
R - the type of Uni itemmapper - the mapper function, must not be nullUnipublic <R> Uni<R> transformToUni(BiFunction<? super T,Throwable,? extends Uni<? extends R>> mapper)
Uni
produced by the given mapper.
Note that the item can be null, so detecting failures must be done by checking whether the failure
parameter is null.
The mapper is called with the item produced by the upstream or the propagated failure. It produces an Uni,
possibly using another type of item (R). It can be used to recover from a failure. The events fired by
the produced Uni are forwarded to the Uni returned by this method.
This operation is generally named flatMap.
R - the type of itemmapper - the function called with the item and failure sent by the upstream Uni to produce another
Uni, 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.@Deprecated public <R> Uni<R> produceUni(BiFunction<? super T,Throwable,? extends Uni<? extends R>> mapper)
transformToUni(BiFunction) insteadUni
produced by the given mapper.
Note that the item can be null, so detecting failures must be done by checking whether the failure
parameter is null.
The mapper is called with the item produced by the upstream or the propagated failure. It produces an Uni,
possibly using another type of item (R). It can be used to recover from a failure. The events fired by
the produced Uni are forwarded to the Uni returned by this method.
This operation is generally named flatMap.
R - the type of itemmapper - the function called with the item and failure sent by the upstream Uni to produce another
Uni, 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> transformToUni(Functions.TriConsumer<? super T,Throwable,UniEmitter<? super R>> consumer)
UniEmitter
provided to the given consumer.
The consumer is called with the item event or failure event emitted by the current Uni and an emitter
used to fire events downstream.
As the item received from upstream can be null, detecting a failure must be done by checking whether the
failure passed to the consumer is null.
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.@Deprecated public <R> Uni<R> produceUni(Functions.TriConsumer<? super T,Throwable,UniEmitter<? super R>> consumer)
transformToUni(Functions.TriConsumer) insteadUniEmitter
provided to the given consumer.
The consumer is called with the item event or failure event emitted by the current Uni and an emitter
used to fire events downstream.
As the item received from upstream can be null, detecting a failure must be done by checking whether the
failure passed to the consumer is null.
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.