public class MultiIfEmpty<T> extends Object
| Modifier and Type | Method and Description |
|---|---|
Multi<T> |
continueWith(Iterable<T> items)
When the upstream
Multi completes without having emitted items, continue with the given items. |
Multi<T> |
continueWith(Supplier<? extends Iterable<? extends T>> supplier)
|
Multi<T> |
continueWith(T... items)
When the upstream
Multi completes without having emitted items, continue with the given items. |
Multi<T> |
fail()
Like
failWith(Throwable) but using a NoSuchElementException. |
Multi<T> |
failWith(Supplier<? extends Throwable> supplier)
|
Multi<T> |
failWith(Throwable failure)
When the current
Multi completes without having emitted items, the passed failure is sent downstream. |
Multi<T> |
switchTo(org.reactivestreams.Publisher<? extends T> other)
|
Multi<T> |
switchTo(Supplier<org.reactivestreams.Publisher<? extends T>> supplier)
|
Multi<T> |
switchToEmitter(Consumer<MultiEmitter<? super T>> consumer)
When the upstream
Multi completes without having emitted items, it continues with the events fired with
the emitter passed to the consumer callback. |
public Multi<T> failWith(Throwable failure)
Multi completes without having emitted items, the passed failure is sent downstream.failure - the failureMultipublic Multi<T> failWith(Supplier<? extends Throwable> supplier)
Multi completes without having emitted items, a failure produced by the given
Supplier is sent downstream.supplier - the supplier to produce the failure, must not be null, must not produce nullMultipublic Multi<T> fail()
failWith(Throwable) but using a NoSuchElementException.Multipublic Multi<T> switchToEmitter(Consumer<MultiEmitter<? super T>> consumer)
Multi completes without having emitted items, it continues with the events fired with
the emitter passed to the consumer callback.
If the upstream Multi fails, the switch does not apply.
consumer - the callback receiving the emitter to fire the events. Must not be null. Throwing exception
in this function propagates a failure downstream.Multipublic Multi<T> switchTo(org.reactivestreams.Publisher<? extends T> other)
Multi completes without having emitted items, it continues with the events fired by the
passed Publisher / Multi.
If the upstream Multi fails, the switch does not apply.
other - the stream to switch to when the upstream completes.Multipublic Multi<T> switchTo(Supplier<org.reactivestreams.Publisher<? extends T>> supplier)
Multi completes without having emitted items, it continues with the events fired by a
Publisher produces with the given Supplier.supplier - the supplier to use to produce the publisher, must not be null, must not return nullsUni@SafeVarargs public final Multi<T> continueWith(T... items)
Multi completes without having emitted items, continue with the given items.items - the items, must not be null, must not contain nullMultipublic Multi<T> continueWith(Iterable<T> items)
Multi completes without having emitted items, continue with the given items.items - the items, must not be null, must not contain nullMultipublic Multi<T> continueWith(Supplier<? extends Iterable<? extends T>> supplier)
Multi completes without having emitted items, continue with the items produced by the
given Supplier.supplier - the supplier to produce the items, must not be null, must not produce nullMultiCopyright © 2019–2020 SmallRye. All rights reserved.