-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProduces a newUniinvoking the given @{code action} when theitemevent is received.Produces a newUniinvoking the given @{code action} when theitemevent is received.Produces a newUniinvoking the given callback when theitemevent is fired.Produces a newUniinvoking the given callback when theitemevent is fired.<R> Uni<R> <R> Multi<R> transformToMulti(Function<? super T, ? extends Flow.Publisher<? extends R>> mapper) <R> Uni<R> transformToUni(BiConsumer<? super T, UniEmitter<? super R>> consumer) Transforms the received item asynchronously, forwarding the events emitted anUniEmitterconsumes by the given consumer.<R> Uni<R> transformToUni(Function<? super T, Uni<? extends R>> mapper) Transforms the received item asynchronously, forwarding the events emitted by anotherUniproduced by the givenmapper.
-
Constructor Details
-
UniOnNotNull
-
-
Method Details
-
invoke
Produces a newUniinvoking the given callback when theitemevent is fired. If the item isnull, the callback is not invoked.- Parameters:
callback- the callback, must not benull- Returns:
- the new
Uni
-
invoke
Produces a newUniinvoking the given callback when theitemevent is fired. If the item isnull, the callback is not invoked.- Parameters:
callback- the callback, must not benull- Returns:
- the new
Uni
-
call
Produces a newUniinvoking the given @{code action} when theitemevent is received. Note that if the received item isnull, the action is not executed, and the item is propagated downstream.Unlike
invoke(Consumer), the passed function returns aUni. When the producedUnisends its result, the result is discarded, and the original (non null)itemis forwarded downstream. If the producedUnifails, the failure is propagated downstream.- Parameters:
action- the callback, must not benull- Returns:
- the new
Uni
-
call
Produces a newUniinvoking the given @{code action} when theitemevent is received. Note that if the received item isnull, the action is not executed.Unlike
invoke(Consumer), the passed function returns aUni. When the producedUnisends its result, the result is discarded, and the original (non null)itemis forwarded downstream. If the producedUnifails, the failure is propagated downstream.- Parameters:
action- the callback, must not benulland must not returnnull- Returns:
- the new
Uni
-
transform
Produces a newUniinvoking the given function when the currentUnifires theitemevent. The function receives the (non-null) item as parameter, and can transform it. The returned object is sent downstream asitem.If the item is `null`, the mapper is not called and it produces a
nullitem.For asynchronous composition, see
transformToUni(Function).- Type Parameters:
R- the type of Uni item- Parameters:
mapper- the mapper function, must not benull- Returns:
- the new
Uni
-
transformToUni
Transforms the received item asynchronously, forwarding the events emitted by anotherUniproduced by the givenmapper.The mapper is called with the item event of the current
Uniand produces anUni, possibly using another type of item (R). The events fired by producedUniare forwarded to theUnireturned by this method.If the item is
null, the mapper is not called, andnullis propagated downstream.This operation is generally named
flatMap. -
transformToMulti
@CheckReturnValue public <R> Multi<R> transformToMulti(Function<? super T, ? extends Flow.Publisher<? extends R>> mapper) When thisUniproduces its item (notnull), call the givenmapperto produce aFlow.Publisher. Continue the pipeline with this publisher (as aMulti).The mapper is called with the item event of the current
Uniand produces aFlow.Publisher, possibly using another type of item (R). Events fired by the producedFlow.Publisherare forwarded to theMultireturned by this method.If the item is `null`, the mapper is not called and an empty
Multiis produced.This operation is generally named
flatMapPublisher.- Type Parameters:
R- the type of item produced by the resultingMulti- Parameters:
mapper- the mapper, must not benull, may expect to receivenullas item.- Returns:
- the multi
-
transformToUni
@CheckReturnValue public <R> Uni<R> transformToUni(BiConsumer<? super T, UniEmitter<? super R>> consumer) Transforms the received item asynchronously, forwarding the events emitted anUniEmitterconsumes by the given consumer.The consumer is called with the item event of the current
Uniand an emitter uses to fire events. These events are these propagated by the producedUni.If the incoming item is
null, theconsumeris not called and anullitem is propagated downstream.- Type Parameters:
R- the type of item emitted by the emitter- Parameters:
consumer- the function called with the item of the thisUniand anUniEmitter. It must not benull.- Returns:
- a new
Unithat would fire events from the emitter consumed by the mapper function, possibly in an asynchronous manner.
-
failWith
If the currentUniemits an item, the producedUniemits the retrieved failure using the givenSupplier.- Parameters:
supplier- the supplier to produce the failure, must not benull, must not producenull- Returns:
- the new
Uni
-
failWith
-