Package io.smallrye.mutiny.groups
Class UniOnNull<T>
- 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 currentUnifiresnullas item.Uni<T>continueWith(T fallback)Provides a default item if the currentUnifiresnullas 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 currentUnifiresnullas item, the producedUniemits 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 currentUnifiresnullas item, the producedUniemits the events produced by theUnipassed 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 currentUnifiresnullas item, the producedUniemits the events produced by anUnisupplied using the passedSupplier- Parameters:
supplier- the supplier to use to produce the uni, must not benull, must not returnnulls- Returns:
- the new
Uni
-
continueWith
@CheckReturnValue public Uni<T> continueWith(T fallback)
Provides a default item if the currentUnifiresnullas 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 currentUnifiresnullas 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
-
-