- java.lang.Object
-
- io.smallrye.mutiny.groups.UniOnNull<T>
-
public class UniOnNull<T> extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Uni<T>
continueWith(java.util.function.Supplier<? extends T> supplier)
Provides a default item if the currentUni
firesnull
as item.Uni<T>
continueWith(T fallback)
Provides a default item if the currentUni
firesnull
as item.Uni<T>
fail()
LikefailWith(Throwable)
but using aNoSuchElementException
.Uni<T>
failWith(java.lang.Throwable failure)
Uni<T>
failWith(java.util.function.Supplier<? extends java.lang.Throwable> supplier)
Uni<T>
switchTo(Uni<? extends T> other)
Uni<T>
switchTo(java.util.function.Supplier<Uni<? extends T>> supplier)
-
-
-
Method Detail
-
failWith
@CheckReturnValue public Uni<T> failWith(java.util.function.Supplier<? extends java.lang.Throwable> supplier)
If the currentUni
firesnull
as item, the producedUni
emits a failure produced using the givenSupplier
.- Parameters:
supplier
- the supplier to produce the failure, must not benull
, must not producenull
- Returns:
- the new
Uni
-
fail
@CheckReturnValue public Uni<T> fail()
LikefailWith(Throwable)
but using aNoSuchElementException
.- Returns:
- the new
Uni
-
switchTo
@CheckReturnValue public Uni<T> switchTo(Uni<? extends T> other)
If the currentUni
firesnull
as item, the producedUni
emits the events produced by theUni
passed as parameter.- Parameters:
other
- the unit to switch to, must not benull
- Returns:
- the new
Uni
-
switchTo
@CheckReturnValue public Uni<T> switchTo(java.util.function.Supplier<Uni<? extends T>> supplier)
If the currentUni
firesnull
as item, the producedUni
emits the events produced by anUni
supplied using the passedSupplier
- Parameters:
supplier
- the supplier to use to produce the uni, must not benull
, must not returnnull
s- Returns:
- the new
Uni
-
continueWith
@CheckReturnValue public Uni<T> continueWith(T fallback)
Provides a default item if the currentUni
firesnull
as item.- Parameters:
fallback
- the default item, must not benull
- Returns:
- the new
Uni
-
continueWith
@CheckReturnValue public Uni<T> continueWith(java.util.function.Supplier<? extends T> supplier)
Provides a default item if the currentUni
firesnull
as item. The new item is supplied by the givenSupplier
.- Parameters:
supplier
- the supplier to produce the new item, must not benull
, must not producenull
- Returns:
- the new
Uni
-
-