Class UniOnNull<T>

java.lang.Object
io.smallrye.mutiny.groups.UniOnNull<T>

public class UniOnNull<T> extends Object
  • Constructor Details

    • UniOnNull

      public UniOnNull(Uni<T> upstream)
  • Method Details

    • failWith

      @CheckReturnValue public Uni<T> failWith(Throwable failure)
      If the current Uni fires null as item, the produced Uni emits the passed failure.
      Parameters:
      failure - the exception to fire if the current Uni fires null as item.
      Returns:
      the new Uni
    • failWith

      @CheckReturnValue public Uni<T> failWith(Supplier<? extends Throwable> supplier)
      If the current Uni fires null as item, the produced Uni emits a failure produced using the given Supplier.
      Parameters:
      supplier - the supplier to produce the failure, must not be null, must not produce null
      Returns:
      the new Uni
    • fail

      @CheckReturnValue public Uni<T> fail()
      Returns:
      the new Uni
    • switchTo

      @CheckReturnValue public Uni<T> switchTo(Uni<? extends T> other)
      If the current Uni fires null as item, the produced Uni emits the events produced by the Uni passed as parameter.
      Parameters:
      other - the unit to switch to, must not be null
      Returns:
      the new Uni
    • switchTo

      @CheckReturnValue public Uni<T> switchTo(Supplier<Uni<? extends T>> supplier)
      If the current Uni fires null as item, the produced Uni emits the events produced by an Uni supplied using the passed Supplier
      Parameters:
      supplier - the supplier to use to produce the uni, must not be null, must not return nulls
      Returns:
      the new Uni
    • continueWith

      @CheckReturnValue public Uni<T> continueWith(T fallback)
      Provides a default item if the current Uni fires null as item.
      Parameters:
      fallback - the default item, must not be null
      Returns:
      the new Uni
    • continueWith

      @CheckReturnValue public Uni<T> continueWith(Supplier<? extends T> supplier)
      Provides a default item if the current Uni fires null as item. The new item is supplied by the given Supplier.
      Parameters:
      supplier - the supplier to produce the new item, must not be null, must not produce null
      Returns:
      the new Uni