Class UniOnNull<T>


  • public class UniOnNull<T>
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      UniOnNull​(Uni<T> upstream)  
    • 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 current Uni fires null as item.
      Uni<T> continueWith​(T fallback)
      Provides a default item if the current Uni fires null as item.
      Uni<T> fail()
      Like failWith(Throwable) but using a NoSuchElementException.
      Uni<T> failWith​(java.lang.Throwable failure)
      If the current Uni fires null as item, the produced Uni emits the passed failure.
      Uni<T> failWith​(java.util.function.Supplier<? extends java.lang.Throwable> supplier)
      If the current Uni fires null as item, the produced Uni emits a failure produced using the given Supplier.
      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.
      Uni<T> switchTo​(java.util.function.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UniOnNull

        public UniOnNull​(Uni<T> upstream)
    • Method Detail

      • failWith

        @CheckReturnValue
        public Uni<T> failWith​(java.lang.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​(java.util.function.Supplier<? extends java.lang.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
      • 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​(java.util.function.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​(java.util.function.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