T - the value typepublic abstract classMaybe<T>extendsObjectimplementsMaybeSource<T>
Maybe class represents a deferred computation and emission of a single value, no value at all or an exception. TheMaybe class implements theMaybeSource base interface and the default consumer type it interacts with is theMaybeObserver via thesubscribe(MaybeObserver) method.
TheMaybe operates with the following sequential protocol:
onSubscribe (onSuccess | onError | onComplete)? Note thatonSuccess,onError andonComplete are mutually exclusive events; unlikeObservable,onSuccess is never followed byonError oronComplete.
LikeObservable, a runningMaybe can be stopped through theDisposable instance provided to consumers throughMaybeObserver.onSubscribe(io.reactivex.disposables.Disposable).
Like anObservable, aMaybe is lazy, can be either "hot" or "cold", synchronous or asynchronous.Maybe instances returned by the methods of this class arecold and there is a standardhot implementation in the form of a subject:MaybeSubject.
The documentation for this class makes use of marble diagrams. The following legend explains these diagrams:

SeeFlowable orObservable for the implementation of the Reactive Pattern for a stream or vector of values.
Example:
Disposable d = Maybe.just("Hello World") .delay(10, TimeUnit.SECONDS, Schedulers.io()) .subscribeWith(new DisposableMaybeObserver<String>() { @Override public void onStart() { System.out.println("Started"); } @Override public void onSuccess(String value) { System.out.println("Success: " + value); } @Override public void onError(Throwable error) { error.printStackTrace(); } @Override public void onComplete() { System.out.println("Done!"); } }); Thread.sleep(5000); d.dispose(); Note that by design, subscriptions viasubscribe(MaybeObserver) can't be disposed from the outside (hence thevoid return of thesubscribe(MaybeObserver) method) and it is the responsibility of the implementor of theMaybeObserver to allow this to happen. RxJava supports such usage with the standardDisposableMaybeObserver instance. For convenience, thesubscribeWith(MaybeObserver) method is provided as well to allow working with aMaybeObserver (or subclass) instance to be applied with in a fluent manner (such as in the example above).
DisposableMaybeObserver| Constructor and Description |
|---|
Maybe() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Maybe<T> | amb(Iterable<? extendsMaybeSource<? extends T>> sources)Runs multiple MaybeSources and signals the events of the first one that signals (disposing the rest). |
static <T> Maybe<T> | ambArray(MaybeSource<? extends T>... sources)Runs multiple MaybeSources and signals the events of the first one that signals (disposing the rest). |
Maybe<T> | ambWith(MaybeSource<? extendsT> other)Mirrors the MaybeSource (current or provided) that first signals an event. |
<R> R | as(MaybeConverter<T,? extends R> converter)Calls the specified converter function during assembly time and returns its resulting value. |
T | blockingGet()Waits in a blocking fashion until the current Maybe signals a success value (which is returned), null if completed or an exception (which is propagated). |
T | blockingGet(T defaultValue)Waits in a blocking fashion until the current Maybe signals a success value (which is returned), defaultValue if completed or an exception (which is propagated). |
Maybe<T> | cache()Returns a Maybe that subscribes to this Maybe lazily, caches its event and replays it, to all the downstream subscribers. |
<U> Maybe<U> | cast(Class<? extends U> clazz)Casts the success value of the current Maybe into the target type or signals a ClassCastException if not compatible. |
<R> Maybe<R> | compose(MaybeTransformer<? superT,? extends R> transformer)Transform a Maybe by applying a particular Transformer function to it. |
static <T> Flowable<T> | concat(Iterable<? extendsMaybeSource<? extends T>> sources)Concatenate the single values, in a non-overlapping fashion, of the MaybeSource sources provided by an Iterable sequence. |
static <T> Flowable<T> | concat(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2)Returns a Flowable that emits the items emitted by two MaybeSources, one after the other. |
static <T> Flowable<T> | concat(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3)Returns a Flowable that emits the items emitted by three MaybeSources, one after the other. |
static <T> Flowable<T> | concat(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3,MaybeSource<? extends T> source4)Returns a Flowable that emits the items emitted by four MaybeSources, one after the other. |
static <T> Flowable<T> | concat(Publisher<? extendsMaybeSource<? extends T>> sources)Concatenate the single values, in a non-overlapping fashion, of the MaybeSource sources provided by a Publisher sequence. |
static <T> Flowable<T> | concat(Publisher<? extendsMaybeSource<? extends T>> sources, int prefetch)Concatenate the single values, in a non-overlapping fashion, of the MaybeSource sources provided by a Publisher sequence. |
static <T> Flowable<T> | concatArray(MaybeSource<? extends T>... sources)Concatenate the single values, in a non-overlapping fashion, of the MaybeSource sources in the array. |
static <T> Flowable<T> | concatArrayDelayError(MaybeSource<? extends T>... sources)Concatenates a variable number of MaybeSource sources and delays errors from any of them till all terminate. |
static <T> Flowable<T> | concatArrayEager(MaybeSource<? extends T>... sources)Concatenates a sequence of MaybeSource eagerly into a single stream of values. |
static <T> Flowable<T> | concatDelayError(Iterable<? extendsMaybeSource<? extends T>> sources)Concatenates the Iterable sequence of MaybeSources into a single sequence by subscribing to each MaybeSource, one after the other, one at a time and delays any errors till the all inner MaybeSources terminate. |
static <T> Flowable<T> | concatDelayError(Publisher<? extendsMaybeSource<? extends T>> sources)Concatenates the Publisher sequence of Publishers into a single sequence by subscribing to each inner Publisher, one after the other, one at a time and delays any errors till the all inner and the outer Publishers terminate. |
static <T> Flowable<T> | concatEager(Iterable<? extendsMaybeSource<? extends T>> sources)Concatenates a sequence of MaybeSources eagerly into a single stream of values. |
static <T> Flowable<T> | concatEager(Publisher<? extendsMaybeSource<? extends T>> sources)Concatenates a Publisher sequence of MaybeSources eagerly into a single stream of values. |
<R> Maybe<R> | concatMap(Function<? superT,? extendsMaybeSource<? extends R>> mapper)Returns a Maybe that is based on applying a specified function to the item emitted by the source Maybe, where that function returns a MaybeSource. |
Flowable<T> | concatWith(MaybeSource<? extendsT> other)Returns a Flowable that emits the items emitted from the current MaybeSource, then the next, one after the other, without interleaving them. |
Single<Boolean> | contains(Object item)Returns a Single that emits a Boolean that indicates whether the source Maybe emitted a specified item. |
Single<Long> | count()Returns a Single that counts the total number of items emitted (0 or 1) by the source Maybe and emits this count as a 64-bit Long. |
static <T> Maybe<T> | create(MaybeOnSubscribe<T> onSubscribe)Provides an API (via a cold Maybe) that bridges the reactive world with the callback-style world. |
Maybe<T> | defaultIfEmpty(T defaultItem)Returns a Maybe that emits the item emitted by the source Maybe or a specified default item if the source Maybe is empty. |
static <T> Maybe<T> | defer(Callable<? extendsMaybeSource<? extends T>> maybeSupplier)Calls a Callable for each individual MaybeObserver to return the actual MaybeSource source to be subscribed to. |
Maybe<T> | delay(long delay,TimeUnit unit)Returns a Maybe that signals the events emitted by the source Maybe shifted forward in time by a specified delay. |
Maybe<T> | delay(long delay,TimeUnit unit,Scheduler scheduler)Returns a Maybe that signals the events emitted by the source Maybe shifted forward in time by a specified delay running on the specified Scheduler. |
<U,V> Maybe<T> | delay(Publisher<U> delayIndicator)Delays the emission of this Maybe until the given Publisher signals an item or completes. |
Maybe<T> | delaySubscription(long delay,TimeUnit unit)Returns a Maybe that delays the subscription to the source Maybe by a given amount of time. |
Maybe<T> | delaySubscription(long delay,TimeUnit unit,Scheduler scheduler)Returns a Maybe that delays the subscription to the source Maybe by a given amount of time, both waiting and subscribing on a given Scheduler. |
<U> Maybe<T> | delaySubscription(Publisher<U> subscriptionIndicator)Returns a Maybe that delays the subscription to this Maybe until the other Publisher emits an element or completes normally. |
Maybe<T> | doAfterSuccess(Consumer<? superT> onAfterSuccess)Calls the specified consumer with the success item after this item has been emitted to the downstream. |
Maybe<T> | doAfterTerminate(Action onAfterTerminate) |
Maybe<T> | doFinally(Action onFinally)Calls the specified action after this Maybe signals onSuccess, onError or onComplete or gets disposed by the downstream. |
Maybe<T> | doOnComplete(Action onComplete)Modifies the source Maybe so that it invokes an action when it calls onComplete. |
Maybe<T> | doOnDispose(Action onDispose)Calls the shared Action if a MaybeObserver subscribed to the current Maybe disposes the common Disposable it received via onSubscribe. |
Maybe<T> | doOnError(Consumer<? superThrowable> onError)Calls the shared consumer with the error sent via onError for each MaybeObserver that subscribes to the current Maybe. |
Maybe<T> | doOnEvent(BiConsumer<? superT,? superThrowable> onEvent)Calls the given onEvent callback with the (success value, null) for an onSuccess, (null, throwable) for an onError or (null, null) for an onComplete signal from this Maybe before delivering said signal to the downstream. |
Maybe<T> | doOnSubscribe(Consumer<? superDisposable> onSubscribe)Calls the shared consumer with the Disposable sent through the onSubscribe for each MaybeObserver that subscribes to the current Maybe. |
Maybe<T> | doOnSuccess(Consumer<? superT> onSuccess)Calls the shared consumer with the success value sent via onSuccess for each MaybeObserver that subscribes to the current Maybe. |
Maybe<T> | doOnTerminate(Action onTerminate)Returns a Maybe instance that calls the given onTerminate callback just before this Maybe completes normally or with an exception. |
static <T> Maybe<T> | empty()Returns a (singleton) Maybe instance that calls onComplete immediately. |
static <T> Maybe<T> | error(Callable<? extendsThrowable> supplier)Returns a Maybe that invokes a MaybeObserver'sonError method when the MaybeObserver subscribes to it. |
static <T> Maybe<T> | error(Throwable exception)Returns a Maybe that invokes a subscriber's onError method when the subscriber subscribes to it. |
Maybe<T> | filter(Predicate<? superT> predicate)Filters the success item of the Maybe via a predicate function and emitting it if the predicate returns true, completing otherwise. |
<R> Maybe<R> | flatMap(Function<? superT,? extendsMaybeSource<? extends R>> mapper)Returns a Maybe that is based on applying a specified function to the item emitted by the source Maybe, where that function returns a MaybeSource. |
<R> Maybe<R> | flatMap(Function<? superT,? extendsMaybeSource<? extends R>> onSuccessMapper,Function<? superThrowable,? extendsMaybeSource<? extends R>> onErrorMapper,Callable<? extendsMaybeSource<? extends R>> onCompleteSupplier)Maps the onSuccess, onError or onComplete signals of this Maybe into MaybeSource and emits that MaybeSource's signals. |
<U,R> Maybe<R> | flatMap(Function<? superT,? extendsMaybeSource<? extends U>> mapper,BiFunction<? superT,? super U,? extends R> resultSelector)Returns a Maybe that emits the results of a specified function to the pair of values emitted by the source Maybe and a specified mapped MaybeSource. |
Completable | flatMapCompletable(Function<? superT,? extendsCompletableSource> mapper)Returns a Completable that completes based on applying a specified function to the item emitted by the sourceMaybe, where that function returns aCompletable. |
<R> Observable<R> | flatMapObservable(Function<? superT,? extendsObservableSource<? extends R>> mapper)Returns an Observable that is based on applying a specified function to the item emitted by the source Maybe, where that function returns an ObservableSource. |
<R> Flowable<R> | flatMapPublisher(Function<? superT,? extendsPublisher<? extends R>> mapper)Returns a Flowable that emits items based on applying a specified function to the item emitted by the source Maybe, where that function returns a Publisher. |
<R> Single<R> | flatMapSingle(Function<? superT,? extendsSingleSource<? extends R>> mapper) |
<R> Maybe<R> | flatMapSingleElement(Function<? superT,? extendsSingleSource<? extends R>> mapper) |
<U> Flowable<U> | flattenAsFlowable(Function<? superT,? extendsIterable<? extends U>> mapper) |
<U> Observable<U> | flattenAsObservable(Function<? superT,? extendsIterable<? extends U>> mapper)Maps the success value of the upstream Maybe into anIterable and emits its items as anObservable sequence. |
static <T> Maybe<T> | fromAction(Action run)Returns a Maybe instance that runs the given Action for each subscriber and emits either its exception or simply completes. |
static <T> Maybe<T> | fromCallable(Callable<? extends T> callable)Returns a Maybe that invokes the givenCallable for each individualMaybeObserver that subscribes and emits the resulting non-null item viaonSuccess while considering anull result from theCallable as indication for valueless completion viaonComplete. |
static <T> Maybe<T> | fromCompletable(CompletableSource completableSource)Wraps a CompletableSource into a Maybe. |
static <T> Maybe<T> | fromFuture(Future<? extends T> future)Converts a Future into a Maybe, treating a null result as an indication of emptiness. |
static <T> Maybe<T> | fromFuture(Future<? extends T> future, long timeout,TimeUnit unit)Converts a Future into a Maybe, with a timeout on the Future. |
static <T> Maybe<T> | fromRunnable(Runnable run)Returns a Maybe instance that runs the given Action for each subscriber and emits either its exception or simply completes. |
static <T> Maybe<T> | fromSingle(SingleSource<T> singleSource)Wraps a SingleSource into a Maybe. |
Maybe<T> | hide()Hides the identity of this Maybe and its Disposable. |
Completable | ignoreElement()Ignores the item emitted by the source Maybe and only calls onComplete oronError. |
Single<Boolean> | isEmpty()Returns a Single that emits true if the source Maybe is empty, otherwisefalse. |
static <T> Maybe<T> | just(T item)Returns a Maybe that emits a specified item. |
<R> Maybe<R> | lift(MaybeOperator<? extends R,? superT> lift)This method requires advanced knowledge about building operators, please consider other standard composition methods first; Returns a Maybe which, when subscribed to, invokes theapply(MaybeObserver) method of the providedMaybeOperator for each individual downstreamMaybe and allows the insertion of a custom operator by accessing the downstream'sMaybeObserver during this subscription phase and providing a newMaybeObserver, containing the custom operator's intended business logic, that will be used in the subscription process going further upstream. |
<R> Maybe<R> | map(Function<? superT,? extends R> mapper)Returns a Maybe that applies a specified function to the item emitted by the source Maybe and emits the result of this function application. |
Single<Notification<T>> | materialize()Maps the signal types of this Maybe into a Notification of the same kind and emits it as a single success value to downstream. |
static <T> Flowable<T> | merge(Iterable<? extendsMaybeSource<? extends T>> sources)Merges an Iterable sequence of MaybeSource instances into a single Flowable sequence, running all MaybeSources at once. |
static <T> Maybe<T> | merge(MaybeSource<? extendsMaybeSource<? extends T>> source)Flattens a MaybeSource that emits aMaybeSource into a singleMaybeSource that emits the item emitted by the nestedMaybeSource, without any transformation. |
static <T> Flowable<T> | merge(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2)Flattens two MaybeSources into a single Flowable, without any transformation. |
static <T> Flowable<T> | merge(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3)Flattens three MaybeSources into a single Flowable, without any transformation. |
static <T> Flowable<T> | merge(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3,MaybeSource<? extends T> source4)Flattens four MaybeSources into a single Flowable, without any transformation. |
static <T> Flowable<T> | merge(Publisher<? extendsMaybeSource<? extends T>> sources)Merges a Flowable sequence of MaybeSource instances into a single Flowable sequence, running all MaybeSources at once. |
static <T> Flowable<T> | merge(Publisher<? extendsMaybeSource<? extends T>> sources, int maxConcurrency)Merges a Flowable sequence of MaybeSource instances into a single Flowable sequence, running at most maxConcurrency MaybeSources at once. |
static <T> Flowable<T> | mergeArray(MaybeSource<? extends T>... sources)Merges an array sequence of MaybeSource instances into a single Flowable sequence, running all MaybeSources at once. |
static <T> Flowable<T> | mergeArrayDelayError(MaybeSource<? extends T>... sources)Flattens an array of MaybeSources into one Flowable, in a way that allows a Subscriber to receive all successfully emitted items from each of the source MaybeSources without being interrupted by an error notification from one of them. |
static <T> Flowable<T> | mergeDelayError(Iterable<? extendsMaybeSource<? extends T>> sources)Flattens an Iterable of MaybeSources into one Flowable, in a way that allows a Subscriber to receive all successfully emitted items from each of the source MaybeSources without being interrupted by an error notification from one of them. |
static <T> Flowable<T> | mergeDelayError(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2)Flattens two MaybeSources into one Flowable, in a way that allows a Subscriber to receive all successfully emitted items from each of the source MaybeSources without being interrupted by an error notification from one of them. |
static <T> Flowable<T> | mergeDelayError(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3)Flattens three MaybeSource into one Flowable, in a way that allows a Subscriber to receive all successfully emitted items from all of the source MaybeSources without being interrupted by an error notification from one of them. |
static <T> Flowable<T> | mergeDelayError(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3,MaybeSource<? extends T> source4)Flattens four MaybeSources into one Flowable, in a way that allows a Subscriber to receive all successfully emitted items from all of the source MaybeSources without being interrupted by an error notification from one of them. |
static <T> Flowable<T> | mergeDelayError(Publisher<? extendsMaybeSource<? extends T>> sources)Flattens a Publisher that emits MaybeSources into one Publisher, in a way that allows a Subscriber to receive all successfully emitted items from all of the source MaybeSources without being interrupted by an error notification from one of them or even the main Publisher. |
static <T> Flowable<T> | mergeDelayError(Publisher<? extendsMaybeSource<? extends T>> sources, int maxConcurrency)Flattens a Publisher that emits MaybeSources into one Publisher, in a way that allows a Subscriber to receive all successfully emitted items from all of the source MaybeSources without being interrupted by an error notification from one of them or even the main Publisher as well as limiting the total number of active MaybeSources. |
Flowable<T> | mergeWith(MaybeSource<? extendsT> other)Flattens this and another Maybe into a single Flowable, without any transformation. |
static <T> Maybe<T> | never()Returns a Maybe that never sends any items or notifications to a MaybeObserver. |
Maybe<T> | observeOn(Scheduler scheduler)Wraps a Maybe to emit its item (or notify of its error) on a specified Scheduler, asynchronously. |
<U> Maybe<U> | ofType(Class<U> clazz)Filters the items emitted by a Maybe, only emitting its success value if that is an instance of the supplied Class. |
Maybe<T> | onErrorComplete()Returns a Maybe instance that if this Maybe emits an error, it will emit an onComplete and swallow the throwable. |
Maybe<T> | onErrorComplete(Predicate<? superThrowable> predicate)Returns a Maybe instance that if this Maybe emits an error and the predicate returns true, it will emit an onComplete and swallow the throwable. |
Maybe<T> | onErrorResumeNext(Function<? superThrowable,? extendsMaybeSource<? extendsT>> resumeFunction)Instructs a Maybe to pass control to another Maybe rather than invoking onError if it encounters an error. |
Maybe<T> | onErrorResumeNext(MaybeSource<? extendsT> next)Instructs a Maybe to pass control to another MaybeSource rather than invokingonError if it encounters an error. |
Maybe<T> | onErrorReturn(Function<? superThrowable,? extendsT> valueSupplier)Instructs a Maybe to emit an item (returned by a specified function) rather than invoking onError if it encounters an error. |
Maybe<T> | onErrorReturnItem(T item)Instructs a Maybe to emit an item (returned by a specified function) rather than invoking onError if it encounters an error. |
Maybe<T> | onExceptionResumeNext(MaybeSource<? extendsT> next) |
Maybe<T> | onTerminateDetach()Nulls out references to the upstream producer and downstream MaybeObserver if the sequence is terminated or downstream calls dispose(). |
Flowable<T> | repeat()Returns a Flowable that repeats the sequence of items emitted by the source Maybe indefinitely. |
Flowable<T> | repeat(long times)Returns a Flowable that repeats the sequence of items emitted by the source Maybe at most count times. |
Flowable<T> | repeatUntil(BooleanSupplier stop)Returns a Flowable that repeats the sequence of items emitted by the source Maybe until the provided stop function returns true. |
Flowable<T> | repeatWhen(Function<? superFlowable<Object>,? extendsPublisher<?>> handler)Returns a Flowable that emits the same values as the source Publisher with the exception of an onComplete. |
Maybe<T> | retry()Returns a Maybe that mirrors the source Maybe, resubscribing to it if it calls onError (infinite retry count). |
Maybe<T> | retry(BiPredicate<? superInteger,? superThrowable> predicate)Returns a Maybe that mirrors the source Maybe, resubscribing to it if it calls onError and the predicate returns true for that specific exception and retry count. |
Maybe<T> | retry(long count)Returns a Maybe that mirrors the source Maybe, resubscribing to it if it calls onError up to a specified number of retries. |
Maybe<T> | retry(long times,Predicate<? superThrowable> predicate)Retries at most times or until the predicate returns false, whichever happens first. |
Maybe<T> | retry(Predicate<? superThrowable> predicate)Retries the current Maybe if it fails and the predicate returns true. |
Maybe<T> | retryUntil(BooleanSupplier stop)Retries until the given stop function returns true. |
Maybe<T> | retryWhen(Function<? superFlowable<Throwable>,? extendsPublisher<?>> handler)Returns a Maybe that emits the same values as the source Maybe with the exception of an onError. |
static <T> Single<Boolean> | sequenceEqual(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2)Returns a Single that emits a Boolean value that indicates whether two MaybeSource sequences are the same by comparing the items emitted by each MaybeSource pairwise. |
static <T> Single<Boolean> | sequenceEqual(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,BiPredicate<? super T,? super T> isEqual)Returns a Single that emits a Boolean value that indicates whether two MaybeSources are the same by comparing the items emitted by each MaybeSource pairwise based on the results of a specified equality function. |
Disposable | subscribe()Subscribes to a Maybe and ignores onSuccess andonComplete emissions. |
Disposable | subscribe(Consumer<? superT> onSuccess)Subscribes to a Maybe and provides a callback to handle the items it emits. |
Disposable | subscribe(Consumer<? superT> onSuccess,Consumer<? superThrowable> onError)Subscribes to a Maybe and provides callbacks to handle the items it emits and any error notification it issues. |
Disposable | subscribe(Consumer<? superT> onSuccess,Consumer<? superThrowable> onError,Action onComplete)Subscribes to a Maybe and provides callbacks to handle the items it emits and any error or completion notification it issues. |
void | subscribe(MaybeObserver<? superT> observer)Subscribes the given MaybeObserver to this MaybeSource instance. |
protected abstract void | subscribeActual(MaybeObserver<? superT> observer)Implement this method in subclasses to handle the incoming MaybeObservers. |
Maybe<T> | subscribeOn(Scheduler scheduler)Asynchronously subscribes subscribers to this Maybe on the specified Scheduler. |
<E extendsMaybeObserver<? superT>> | subscribeWith(E observer)Subscribes a given MaybeObserver (subclass) to this Maybe and returns the given MaybeObserver as is. |
Maybe<T> | switchIfEmpty(MaybeSource<? extendsT> other)Returns a Maybe that emits the items emitted by the source Maybe or the items of an alternate MaybeSource if the current Maybe is empty. |
Single<T> | switchIfEmpty(SingleSource<? extendsT> other)Returns a Single that emits the items emitted by the source Maybe or the item of an alternate SingleSource if the current Maybe is empty. |
<U> Maybe<T> | takeUntil(MaybeSource<U> other)Returns a Maybe that emits the items emitted by the source Maybe until a second MaybeSource emits an item. |
<U> Maybe<T> | takeUntil(Publisher<U> other)Returns a Maybe that emits the item emitted by the source Maybe until a second Publisher emits an item. |
TestObserver<T> | test()Creates a TestObserver and subscribes it to this Maybe. |
TestObserver<T> | test(boolean cancelled)Creates a TestObserver optionally in cancelled state, then subscribes it to this Maybe. |
Maybe<T> | timeout(long timeout,TimeUnit timeUnit)Returns a Maybe that mirrors the source Maybe but applies a timeout policy for each emitted item. |
Maybe<T> | timeout(long timeout,TimeUnit timeUnit,MaybeSource<? extendsT> fallback)Returns a Maybe that mirrors the source Maybe but applies a timeout policy for each emitted item. |
Maybe<T> | timeout(long timeout,TimeUnit timeUnit,Scheduler scheduler)Returns a Maybe that mirrors the source Maybe but applies a timeout policy for each emitted item, where this policy is governed on a specified Scheduler. |
Maybe<T> | timeout(long timeout,TimeUnit timeUnit,Scheduler scheduler,MaybeSource<? extendsT> fallback)Returns a Maybe that mirrors the source Maybe but applies a timeout policy for each emitted item using a specified Scheduler. |
<U> Maybe<T> | timeout(MaybeSource<U> timeoutIndicator)If the current Maybe didn't signal an event before thetimeoutIndicatorMaybeSource signals, aTimeoutException is signaled instead. |
<U> Maybe<T> | timeout(MaybeSource<U> timeoutIndicator,MaybeSource<? extendsT> fallback)If the current Maybe didn't signal an event before thetimeoutIndicatorMaybeSource signals, the currentMaybe is disposed and thefallbackMaybeSource subscribed to as a continuation. |
<U> Maybe<T> | timeout(Publisher<U> timeoutIndicator)If the current Maybe source didn't signal an event before thetimeoutIndicatorPublisher signals, aTimeoutException is signaled instead. |
<U> Maybe<T> | timeout(Publisher<U> timeoutIndicator,MaybeSource<? extendsT> fallback)If the current Maybe didn't signal an event before thetimeoutIndicatorPublisher signals, the currentMaybe is disposed and thefallbackMaybeSource subscribed to as a continuation. |
staticMaybe<Long> | timer(long delay,TimeUnit unit)Returns a Maybe that emits 0L after a specified delay. |
staticMaybe<Long> | timer(long delay,TimeUnit unit,Scheduler scheduler)Returns a Maybe that emits 0L after a specified delay on a specified Scheduler. |
<R> R | to(Function<? superMaybe<T>,R> convert)Calls the specified converter function with the current Maybe instance during assembly time and returns its result. |
Flowable<T> | toFlowable()Converts this Maybe into a backpressure-aware Flowable instance composing cancellation through. |
Observable<T> | toObservable()Converts this Maybe into an Observable instance composing disposal through. |
Single<T> | toSingle()Converts this Maybe into a Single instance composing disposal through and turning an empty Maybe into a signal of NoSuchElementException. |
Single<T> | toSingle(T defaultValue)Converts this Maybe into a Single instance composing disposal through and turning an empty Maybe into a Single that emits the given value through onSuccess. |
static <T> Maybe<T> | unsafeCreate(MaybeSource<T> onSubscribe)Advanced use only: creates a Maybe instance without any safeguards by using a callback that is called with a MaybeObserver. |
Maybe<T> | unsubscribeOn(Scheduler scheduler)Returns a Maybe which makes sure when a MaybeObserver disposes the Disposable, that call is propagated up on the specified scheduler. |
static <T,D> Maybe<T> | using(Callable<? extends D> resourceSupplier,Function<? super D,? extendsMaybeSource<? extends T>> sourceSupplier,Consumer<? super D> resourceDisposer)Constructs a Maybe that creates a dependent resource object which is disposed of when the upstream terminates or the downstream calls dispose(). |
static <T,D> Maybe<T> | using(Callable<? extends D> resourceSupplier,Function<? super D,? extendsMaybeSource<? extends T>> sourceSupplier,Consumer<? super D> resourceDisposer, boolean eager)Constructs a Maybe that creates a dependent resource object which is disposed of just before termination if you have set disposeEagerly totrue and a downstream dispose() does not occur before termination. |
static <T> Maybe<T> | wrap(MaybeSource<T> source)Wraps a MaybeSource instance into a new Maybe instance if not already a Maybe instance. |
static <T,R> Maybe<R> | zip(Iterable<? extendsMaybeSource<? extends T>> sources,Function<? superObject[],? extends R> zipper)Returns a Maybe that emits the results of a specified combiner function applied to combinations of items emitted, in sequence, by an Iterable of other MaybeSources. |
static <T1,T2,R> Maybe<R> | zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,BiFunction<? super T1,? super T2,? extends R> zipper)Returns a Maybe that emits the results of a specified combiner function applied to combinations of two items emitted, in sequence, by two other MaybeSources. |
static <T1,T2,T3,R> | zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,Function3<? super T1,? super T2,? super T3,? extends R> zipper)Returns a Maybe that emits the results of a specified combiner function applied to combinations of three items emitted, in sequence, by three other MaybeSources. |
static <T1,T2,T3,T4,R> | zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,Function4<? super T1,? super T2,? super T3,? super T4,? extends R> zipper)Returns a Maybe that emits the results of a specified combiner function applied to combinations of four items emitted, in sequence, by four other MaybeSources. |
static <T1,T2,T3,T4,T5,R> | zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,MaybeSource<? extends T5> source5,Function5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> zipper)Returns a Maybe that emits the results of a specified combiner function applied to combinations of five items emitted, in sequence, by five other MaybeSources. |
static <T1,T2,T3,T4,T5,T6,R> | zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,MaybeSource<? extends T5> source5,MaybeSource<? extends T6> source6,Function6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> zipper)Returns a Maybe that emits the results of a specified combiner function applied to combinations of six items emitted, in sequence, by six other MaybeSources. |
static <T1,T2,T3,T4,T5,T6,T7,R> | zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,MaybeSource<? extends T5> source5,MaybeSource<? extends T6> source6,MaybeSource<? extends T7> source7,Function7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> zipper)Returns a Maybe that emits the results of a specified combiner function applied to combinations of seven items emitted, in sequence, by seven other MaybeSources. |
static <T1,T2,T3,T4,T5,T6,T7,T8,R> | zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,MaybeSource<? extends T5> source5,MaybeSource<? extends T6> source6,MaybeSource<? extends T7> source7,MaybeSource<? extends T8> source8,Function8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> zipper)Returns a Maybe that emits the results of a specified combiner function applied to combinations of eight items emitted, in sequence, by eight other MaybeSources. |
static <T1,T2,T3,T4,T5,T6,T7,T8,T9,R> | zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,MaybeSource<? extends T5> source5,MaybeSource<? extends T6> source6,MaybeSource<? extends T7> source7,MaybeSource<? extends T8> source8,MaybeSource<? extends T9> source9,Function9<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? super T9,? extends R> zipper)Returns a Maybe that emits the results of a specified combiner function applied to combinations of nine items emitted, in sequence, by nine other MaybeSources. |
static <T,R> Maybe<R> | zipArray(Function<? superObject[],? extends R> zipper,MaybeSource<? extends T>... sources)Returns a Maybe that emits the results of a specified combiner function applied to combinations of items emitted, in sequence, by an array of other MaybeSources. |
<U,R> Maybe<R> | zipWith(MaybeSource<? extends U> other,BiFunction<? superT,? super U,? extends R> zipper)Waits until this and the other MaybeSource signal a success value then applies the given BiFunction to those values and emits the BiFunction's resulting value to downstream. |
@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> amb(Iterable<? extendsMaybeSource<? extends T>> sources)

amb does not operate by default on a particularScheduler.T - the value typesources - the Iterable sequence of sources. A subscription to each source will occur in the same order as in the Iterable.@CheckReturnValue@SchedulerSupport(value="none")public static <T> Maybe<T> ambArray(MaybeSource<? extends T>... sources)

ambArray does not operate by default on a particularScheduler.T - the value typesources - the array of sources. A subscription to each source will occur in the same order as in the array.@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> concat(Iterable<? extendsMaybeSource<? extends T>> sources)

Flowable honors the backpressure of the downstream consumer.concat does not operate by default on a particularScheduler.T - the value typesources - the Iterable sequence of MaybeSource instances@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> concat(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2)

Flowable honors the backpressure of the downstream consumer.concat does not operate by default on a particularScheduler.T - the common value typesource1 - a MaybeSource to be concatenatedsource2 - a MaybeSource to be concatenated@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> concat(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3)

Flowable honors the backpressure of the downstream consumer.concat does not operate by default on a particularScheduler.T - the common value typesource1 - a MaybeSource to be concatenatedsource2 - a MaybeSource to be concatenatedsource3 - a MaybeSource to be concatenated@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> concat(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3,MaybeSource<? extends T> source4)

Flowable honors the backpressure of the downstream consumer.concat does not operate by default on a particularScheduler.T - the common value typesource1 - a MaybeSource to be concatenatedsource2 - a MaybeSource to be concatenatedsource3 - a MaybeSource to be concatenatedsource4 - a MaybeSource to be concatenated@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public static <T> Flowable<T> concat(Publisher<? extendsMaybeSource<? extends T>> sources)

Flowable honors the backpressure of the downstream consumer and expects thePublisher to honor backpressure as well. If the sourcesPublisher violates this, aMissingBackpressureException is signalled.concat does not operate by default on a particularScheduler.T - the value typesources - the Publisher of MaybeSource instances@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> concat(Publisher<? extendsMaybeSource<? extends T>> sources, int prefetch)

Flowable honors the backpressure of the downstream consumer and expects thePublisher to honor backpressure as well. If the sourcesPublisher violates this, aMissingBackpressureException is signalled.concat does not operate by default on a particularScheduler.T - the value typesources - the Publisher of MaybeSource instancesprefetch - the number of MaybeSources to prefetch from the Publisher@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> concatArray(MaybeSource<? extends T>... sources)

Flowable honors the backpressure of the downstream consumer.concatArray does not operate by default on a particularScheduler.T - the value typesources - the array of MaybeSource instances@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public static <T> Flowable<T> concatArrayDelayError(MaybeSource<? extends T>... sources)

concatArrayDelayError does not operate by default on a particularScheduler.T - the common base value typesources - the array of sourcesNullPointerException - if sources is null@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public static <T> Flowable<T> concatArrayEager(MaybeSource<? extends T>... sources)
Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the source MaybeSources. The operator buffers the value emitted by these MaybeSources and then drains them in order, each one after the previous one completes.

Scheduler.T - the value typesources - a sequence of MaybeSources that need to be eagerly concatenated@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> concatDelayError(Iterable<? extendsMaybeSource<? extends T>> sources)

concatDelayError does not operate by default on a particularScheduler.T - the common element base typesources - the Iterable sequence of MaybeSources@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public static <T> Flowable<T> concatDelayError(Publisher<? extendsMaybeSource<? extends T>> sources)

concatDelayError fully supports backpressure.concatDelayError does not operate by default on a particularScheduler.T - the common element base typesources - the Publisher sequence of Publishers@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public static <T> Flowable<T> concatEager(Iterable<? extendsMaybeSource<? extends T>> sources)
Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the source MaybeSources. The operator buffers the values emitted by these MaybeSources and then drains them in order, each one after the previous one completes.

Scheduler.T - the value typesources - a sequence of MaybeSource that need to be eagerly concatenated@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public static <T> Flowable<T> concatEager(Publisher<? extendsMaybeSource<? extends T>> sources)
Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the emitted source Publishers as they are observed. The operator buffers the values emitted by these Publishers and then drains them in order, each one after the previous one completes.

MissingBackpressureException.Scheduler.T - the value typesources - a sequence of Publishers that need to be eagerly concatenated@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> create(MaybeOnSubscribe<T> onSubscribe)
Example:
Maybe.<Event>create(emitter -> { Callback listener = new Callback() { @Override public void onEvent(Event e) { if (e.isNothing()) { emitter.onComplete(); } else { emitter.onSuccess(e); } } @Override public void onFailure(Exception e) { emitter.onError(e); } }; AutoCloseable c = api.someMethod(listener); emitter.setCancellable(c::close); });create does not operate by default on a particularScheduler.T - the value typeonSubscribe - the emitter that is called when a MaybeObserver subscribes to the returnedMaybeMaybeOnSubscribe,Cancellable@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> defer(Callable<? extendsMaybeSource<? extends T>> maybeSupplier)
defer does not operate by default on a particularScheduler.T - the value typemaybeSupplier - the Callable that is called for each individual MaybeObserver and returns a MaybeSource instance to subscribe to@CheckReturnValue@SchedulerSupport(value="none")public static <T> Maybe<T> empty()
onComplete immediately.
empty does not operate by default on a particularScheduler.T - the value type@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> error(Throwable exception)
onError method when the subscriber subscribes to it.
error does not operate by default on a particularScheduler.T - the type of the item (ostensibly) emitted by the Maybeexception - the particular Throwable to pass toonErroronError method when the subscriber subscribes to it@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> error(Callable<? extendsThrowable> supplier)
MaybeObserver'sonError method when the MaybeObserver subscribes to it.
error does not operate by default on a particularScheduler.T - the type of the items (ostensibly) emitted by the Maybesupplier - a Callable factory to return a Throwable for each individual MaybeObserverMaybeObserver'sonError method when the MaybeObserver subscribes to it@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> fromAction(Action run)
fromAction does not operate by default on a particularScheduler.Action throws an exception, the respectiveThrowable is delivered to the downstream viaMaybeObserver.onError(Throwable), except when the downstream has disposed thisMaybe source. In this latter case, theThrowable is delivered to the global error handler viaRxJavaPlugins.onError(Throwable) as anUndeliverableException.T - the target typerun - the runnable to run for each subscriberNullPointerException - if run is null@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> fromCompletable(CompletableSource completableSource)
fromCompletable does not operate by default on a particularScheduler.T - the target typecompletableSource - the CompletableSource to convert fromNullPointerException - if completable is null@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> fromSingle(SingleSource<T> singleSource)
fromSingle does not operate by default on a particularScheduler.T - the target typesingleSource - the SingleSource to convert fromNullPointerException - if single is null@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> fromCallable(@NonNullCallable<? extends T> callable)
Maybe that invokes the givenCallable for each individualMaybeObserver that subscribes and emits the resulting non-null item viaonSuccess while considering anull result from theCallable as indication for valueless completion viaonComplete. This operator allows you to defer the execution of the givenCallable until aMaybeObserver subscribes to the returnedMaybe. In other terms, this source operator evaluates the givenCallable "lazily".
Note that thenull handling of this operator differs from the similar source operators in the otherbase reactive classes. Those operators signal aNullPointerException if the value returned by theirCallable isnull while thisfromCallable considers it to indicate the returnedMaybe is empty.
fromCallable does not operate by default on a particularScheduler.Callable.call() will be forwarded toonError, except if theMaybeObserver disposed the subscription in the meantime. In this latter case, the exception is forwarded to the global error handler viaRxJavaPlugins.onError(Throwable) wrapped into aUndeliverableException. Fatal exceptions are rethrown and usually will end up in the executing thread'sThread.UncaughtExceptionHandler.uncaughtException(Thread, Throwable) handler.@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> fromFuture(Future<? extends T> future)
Future into a Maybe, treating a null result as an indication of emptiness.
You can convert any object that supports theFuture interface into a Maybe that emits the return value of theFuture.get() method of that object, by passing the object into thefrom method.
Important note: This Maybe is blocking; you cannot dispose it.
Unlike 1.x, disposing the Maybe won't cancel the future. If necessary, one can use composition to achieve the cancellation effect:futureMaybe.doOnDispose(() -> future.cancel(true));.
fromFuture does not operate by default on a particularScheduler.T - the type of object that theFuture returns, and also the type of item to be emitted by the resulting Maybefuture - the sourceFutureFuture@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> fromFuture(Future<? extends T> future, long timeout,TimeUnit unit)
Future into a Maybe, with a timeout on the Future.
You can convert any object that supports theFuture interface into a Maybe that emits the return value of theFuture.get() method of that object, by passing the object into thefromFuture method.
Unlike 1.x, disposing the Maybe won't cancel the future. If necessary, one can use composition to achieve the cancellation effect:futureMaybe.doOnCancel(() -> future.cancel(true));.
Important note: This Maybe is blocking on the thread it gets subscribed on; you cannot dispose it.
fromFuture does not operate by default on a particularScheduler.T - the type of object that theFuture returns, and also the type of item to be emitted by the resulting Maybefuture - the sourceFuturetimeout - the maximum time to wait before callinggetunit - theTimeUnit of thetimeout argumentFuture@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> fromRunnable(Runnable run)
fromRunnable does not operate by default on a particularScheduler.T - the target typerun - the runnable to run for each subscriberNullPointerException - if run is null@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> just(T item)
Maybe that emits a specified item.
To convert any object into aMaybe that emits that object, pass that object into thejust method.
just does not operate by default on a particularScheduler.T - the type of that itemitem - the item to emitMaybe that emitsitem@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public static <T> Flowable<T> merge(Iterable<? extendsMaybeSource<? extends T>> sources)
merge does not operate by default on a particularScheduler.MaybeSources signal aThrowable viaonError, the resultingFlowable terminates with thatThrowable and all other sourceMaybeSources are disposed. If more than oneMaybeSource signals an error, the resultingFlowable may terminate with the first one's error or, depending on the concurrency of the sources, may terminate with aCompositeException containing two or more of the various error signals.Throwables that didn't make into the composite will be sent (individually) to the global error handler viaRxJavaPlugins.onError(Throwable) method asUndeliverableException errors. Similarly,Throwables signaled by source(s) after the returnedFlowable has been cancelled or terminated with a (composite) error will be sent to the same global error handler. UsemergeDelayError(Iterable) to merge sources and terminate only when all sourceMaybeSources have completed or failed with an error.T - the common and resulting value typesources - the Iterable sequence of MaybeSource sourcesmergeDelayError(Iterable)@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public static <T> Flowable<T> merge(Publisher<? extendsMaybeSource<? extends T>> sources)
merge does not operate by default on a particularScheduler.MaybeSources signal aThrowable viaonError, the resultingFlowable terminates with thatThrowable and all other sourceMaybeSources are disposed. If more than oneMaybeSource signals an error, the resultingFlowable may terminate with the first one's error or, depending on the concurrency of the sources, may terminate with aCompositeException containing two or more of the various error signals.Throwables that didn't make into the composite will be sent (individually) to the global error handler viaRxJavaPlugins.onError(Throwable) method asUndeliverableException errors. Similarly,Throwables signaled by source(s) after the returnedFlowable has been cancelled or terminated with a (composite) error will be sent to the same global error handler. UsemergeDelayError(Publisher) to merge sources and terminate only when all sourceMaybeSources have completed or failed with an error.T - the common and resulting value typesources - the Flowable sequence of MaybeSource sourcesmergeDelayError(Publisher)@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> merge(Publisher<? extendsMaybeSource<? extends T>> sources, int maxConcurrency)
merge does not operate by default on a particularScheduler.MaybeSources signal aThrowable viaonError, the resultingFlowable terminates with thatThrowable and all other sourceMaybeSources are disposed. If more than oneMaybeSource signals an error, the resultingFlowable may terminate with the first one's error or, depending on the concurrency of the sources, may terminate with aCompositeException containing two or more of the various error signals.Throwables that didn't make into the composite will be sent (individually) to the global error handler viaRxJavaPlugins.onError(Throwable) method asUndeliverableException errors. Similarly,Throwables signaled by source(s) after the returnedFlowable has been cancelled or terminated with a (composite) error will be sent to the same global error handler. UsemergeDelayError(Publisher, int) to merge sources and terminate only when all sourceMaybeSources have completed or failed with an error.T - the common and resulting value typesources - the Flowable sequence of MaybeSource sourcesmaxConcurrency - the maximum number of concurrently running MaybeSourcesmergeDelayError(Publisher, int)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> merge(MaybeSource<? extendsMaybeSource<? extends T>> source)
MaybeSource that emits aMaybeSource into a singleMaybeSource that emits the item emitted by the nestedMaybeSource, without any transformation.
merge does not operate by default on a particularScheduler.Maybe emits the outer source's or the innerMaybeSource'sThrowable as is. Unlike the othermerge() operators, this operator won't and can't produce aCompositeException because there is only one possibility for the outer or the innerMaybeSource to emit anonError signal. Therefore, there is no need for amergeDelayError(MaybeSource<MaybeSource<T>>) operator.T - the value type of the sources and the outputsource - aMaybeSource that emits aMaybeSourceMaybe that emits the item that is the result of flattening theMaybeSource emitted bysource@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> merge(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2)

You can combine items emitted by multiple MaybeSources so that they appear as a single Flowable, by using themerge method.
merge does not operate by default on a particularScheduler.MaybeSources signal aThrowable viaonError, the resultingFlowable terminates with thatThrowable and all other sourceMaybeSources are disposed. If more than oneMaybeSource signals an error, the resultingFlowable may terminate with the first one's error or, depending on the concurrency of the sources, may terminate with aCompositeException containing two or more of the various error signals.Throwables that didn't make into the composite will be sent (individually) to the global error handler viaRxJavaPlugins.onError(Throwable) method asUndeliverableException errors. Similarly,Throwables signaled by source(s) after the returnedFlowable has been cancelled or terminated with a (composite) error will be sent to the same global error handler. UsemergeDelayError(MaybeSource, MaybeSource) to merge sources and terminate only when all sourceMaybeSources have completed or failed with an error.T - the common value typesource1 - a MaybeSource to be mergedsource2 - a MaybeSource to be mergedmergeDelayError(MaybeSource, MaybeSource)@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> merge(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3)

You can combine items emitted by multiple MaybeSources so that they appear as a single Flowable, by using themerge method.
merge does not operate by default on a particularScheduler.MaybeSources signal aThrowable viaonError, the resultingFlowable terminates with thatThrowable and all other sourceMaybeSources are disposed. If more than oneMaybeSource signals an error, the resultingFlowable may terminate with the first one's error or, depending on the concurrency of the sources, may terminate with aCompositeException containing two or more of the various error signals.Throwables that didn't make into the composite will be sent (individually) to the global error handler viaRxJavaPlugins.onError(Throwable) method asUndeliverableException errors. Similarly,Throwables signaled by source(s) after the returnedFlowable has been cancelled or terminated with a (composite) error will be sent to the same global error handler. UsemergeDelayError(MaybeSource, MaybeSource, MaybeSource) to merge sources and terminate only when all sourceMaybeSources have completed or failed with an error.T - the common value typesource1 - a MaybeSource to be mergedsource2 - a MaybeSource to be mergedsource3 - a MaybeSource to be mergedmergeDelayError(MaybeSource, MaybeSource, MaybeSource)@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> merge(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3,MaybeSource<? extends T> source4)

You can combine items emitted by multiple MaybeSources so that they appear as a single Flowable, by using themerge method.
merge does not operate by default on a particularScheduler.MaybeSources signal aThrowable viaonError, the resultingFlowable terminates with thatThrowable and all other sourceMaybeSources are disposed. If more than oneMaybeSource signals an error, the resultingFlowable may terminate with the first one's error or, depending on the concurrency of the sources, may terminate with aCompositeException containing two or more of the various error signals.Throwables that didn't make into the composite will be sent (individually) to the global error handler viaRxJavaPlugins.onError(Throwable) method asUndeliverableException errors. Similarly,Throwables signaled by source(s) after the returnedFlowable has been cancelled or terminated with a (composite) error will be sent to the same global error handler. UsemergeDelayError(MaybeSource, MaybeSource, MaybeSource, MaybeSource) to merge sources and terminate only when all sourceMaybeSources have completed or failed with an error.T - the common value typesource1 - a MaybeSource to be mergedsource2 - a MaybeSource to be mergedsource3 - a MaybeSource to be mergedsource4 - a MaybeSource to be mergedmergeDelayError(MaybeSource, MaybeSource, MaybeSource, MaybeSource)@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> mergeArray(MaybeSource<? extends T>... sources)
mergeArray does not operate by default on a particularScheduler.MaybeSources signal aThrowable viaonError, the resultingFlowable terminates with thatThrowable and all other sourceMaybeSources are disposed. If more than oneMaybeSource signals an error, the resultingFlowable may terminate with the first one's error or, depending on the concurrency of the sources, may terminate with aCompositeException containing two or more of the various error signals.Throwables that didn't make into the composite will be sent (individually) to the global error handler viaRxJavaPlugins.onError(Throwable) method asUndeliverableException errors. Similarly,Throwables signaled by source(s) after the returnedFlowable has been cancelled or terminated with a (composite) error will be sent to the same global error handler. UsemergeArrayDelayError(MaybeSource...) to merge sources and terminate only when all sourceMaybeSources have completed or failed with an error.T - the common and resulting value typesources - the array sequence of MaybeSource sourcesmergeArrayDelayError(MaybeSource...)@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public static <T> Flowable<T> mergeArrayDelayError(MaybeSource<? extends T>... sources)
This behaves likemerge(Publisher) except that if any of the merged MaybeSources notify of an error viaonError,mergeDelayError will refrain from propagating that error notification until all of the merged MaybeSources have finished emitting items.

Even if multiple merged MaybeSources sendonError notifications,mergeDelayError will only invoke theonError method of its Subscribers once.
mergeArrayDelayError does not operate by default on a particularScheduler.T - the common element base typesources - the Iterable of MaybeSources@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public static <T> Flowable<T> mergeDelayError(Iterable<? extendsMaybeSource<? extends T>> sources)
This behaves likemerge(Publisher) except that if any of the merged MaybeSources notify of an error viaonError,mergeDelayError will refrain from propagating that error notification until all of the merged MaybeSources have finished emitting items.

Even if multiple merged MaybeSources sendonError notifications,mergeDelayError will only invoke theonError method of its Subscribers once.
mergeDelayError does not operate by default on a particularScheduler.T - the common element base typesources - the Iterable of MaybeSources@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public static <T> Flowable<T> mergeDelayError(Publisher<? extendsMaybeSource<? extends T>> sources)
This behaves likemerge(Publisher) except that if any of the merged MaybeSources notify of an error viaonError,mergeDelayError will refrain from propagating that error notification until all of the merged MaybeSources and the main Publisher have finished emitting items.

Even if multiple merged Publishers sendonError notifications,mergeDelayError will only invoke theonError method of its Subscribers once.
Publisher is consumed in unbounded mode (i.e., no backpressure is applied to it).mergeDelayError does not operate by default on a particularScheduler.T - the common element base typesources - a Publisher that emits MaybeSourcessource Publisher@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> mergeDelayError(Publisher<? extendsMaybeSource<? extends T>> sources, int maxConcurrency)
This behaves likemerge(Publisher, int) except that if any of the merged MaybeSources notify of an error viaonError,mergeDelayError will refrain from propagating that error notification until all of the merged MaybeSources and the main Publisher have finished emitting items.

Even if multiple merged Publishers sendonError notifications,mergeDelayError will only invoke theonError method of its Subscribers once.
Publisher is consumed in unbounded mode (i.e., no backpressure is applied to it).mergeDelayError does not operate by default on a particularScheduler.History: 2.1.9 - experimental
T - the common element base typesources - a Publisher that emits MaybeSourcesmaxConcurrency - the maximum number of active inner MaybeSources to be merged at a timesource Publisher@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> mergeDelayError(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2)
This behaves likemerge(MaybeSource, MaybeSource) except that if any of the merged MaybeSources notify of an error viaonError,mergeDelayError will refrain from propagating that error notification until all of the merged MaybeSources have finished emitting items.

Even if both merged MaybeSources sendonError notifications,mergeDelayError will only invoke theonError method of its Subscribers once.
mergeDelayError does not operate by default on a particularScheduler.T - the common element base typesource1 - a MaybeSource to be mergedsource2 - a MaybeSource to be merged@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> mergeDelayError(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3)
This behaves likemerge(MaybeSource, MaybeSource, MaybeSource) except that if any of the merged MaybeSources notify of an error viaonError,mergeDelayError will refrain from propagating that error notification until all of the merged MaybeSources have finished emitting items.

Even if multiple merged MaybeSources sendonError notifications,mergeDelayError will only invoke theonError method of its Subscribers once.
mergeDelayError does not operate by default on a particularScheduler.T - the common element base typesource1 - a MaybeSource to be mergedsource2 - a MaybeSource to be mergedsource3 - a MaybeSource to be merged@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Flowable<T> mergeDelayError(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,MaybeSource<? extends T> source3,MaybeSource<? extends T> source4)
This behaves likemerge(MaybeSource, MaybeSource, MaybeSource, MaybeSource) except that if any of the merged MaybeSources notify of an error viaonError,mergeDelayError will refrain from propagating that error notification until all of the merged MaybeSources have finished emitting items.

Even if multiple merged MaybeSources sendonError notifications,mergeDelayError will only invoke theonError method of its Subscribers once.
mergeDelayError does not operate by default on a particularScheduler.T - the common element base typesource1 - a MaybeSource to be mergedsource2 - a MaybeSource to be mergedsource3 - a MaybeSource to be mergedsource4 - a MaybeSource to be merged@CheckReturnValue@SchedulerSupport(value="none")public static <T> Maybe<T> never()
MaybeObserver.
This Maybe is useful primarily for testing purposes.
never does not operate by default on a particularScheduler.T - the type of items (not) emitted by the MaybeMaybeObserver@CheckReturnValue@SchedulerSupport(value="none")public static <T> Single<Boolean> sequenceEqual(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2)

sequenceEqual does not operate by default on a particularScheduler.T - the type of items emitted by each MaybeSourcesource1 - the first MaybeSource to comparesource2 - the second MaybeSource to compare@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Single<Boolean> sequenceEqual(MaybeSource<? extends T> source1,MaybeSource<? extends T> source2,BiPredicate<? super T,? super T> isEqual)

sequenceEqual does not operate by default on a particularScheduler.T - the type of items emitted by each MaybeSourcesource1 - the first MaybeSource to comparesource2 - the second MaybeSource to compareisEqual - a function used to compare items emitted by each MaybeSource@CheckReturnValue@SchedulerSupport(value="io.reactivex:computation")public static Maybe<Long> timer(long delay,TimeUnit unit)
0L after a specified delay.
timer operates by default on thecomputationScheduler.delay - the initial delay before emitting a single0Lunit - time units to use fordelay0L after a specified delay@CheckReturnValue@NonNull@SchedulerSupport(value="custom")public static Maybe<Long> timer(long delay,TimeUnit unit,Scheduler scheduler)
0L after a specified delay on a specified Scheduler.
Scheduler this operator will use.delay - the initial delay before emitting a single 0Lunit - time units to use fordelayscheduler - theScheduler to use for scheduling the item0L after a specified delay, on a specified Scheduler@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> unsafeCreate(MaybeSource<T> onSubscribe)
unsafeCreate does not operate by default on a particularScheduler.T - the value typeonSubscribe - the function that is called with the subscribing MaybeObserver@CheckReturnValue@SchedulerSupport(value="none")public static <T,D> Maybe<T> using(Callable<? extends D> resourceSupplier,Function<? super D,? extendsMaybeSource<? extends T>> sourceSupplier,Consumer<? super D> resourceDisposer)

using does not operate by default on a particularScheduler.T - the element type of the generated MaybeSourceD - the type of the resource associated with the output sequenceresourceSupplier - the factory function to create a resource object that depends on the MaybesourceSupplier - the factory function to create a MaybeSourceresourceDisposer - the function that will dispose of the resource@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T,D> Maybe<T> using(Callable<? extends D> resourceSupplier,Function<? super D,? extendsMaybeSource<? extends T>> sourceSupplier,Consumer<? super D> resourceDisposer, boolean eager)
disposeEagerly totrue and a downstream dispose() does not occur before termination. Otherwise resource disposal will occur on call to dispose(). Eager disposal is particularly appropriate for a synchronous Maybe that reuses resources.disposeAction will only be called once per subscription.
using does not operate by default on a particularScheduler.T - the element type of the generated MaybeSourceD - the type of the resource associated with the output sequenceresourceSupplier - the factory function to create a resource object that depends on the MaybesourceSupplier - the factory function to create a MaybeSourceresourceDisposer - the function that will dispose of the resourceeager - iftrue then disposal will happen either on a dispose() call or just before emission of a terminal event (onComplete oronError).@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T> Maybe<T> wrap(MaybeSource<T> source)
wrap does not operate by default on a particularScheduler.T - the value typesource - the source to wrap@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T,R> Maybe<R> zip(Iterable<? extendsMaybeSource<? extends T>> sources,Function<? superObject[],? extends R> zipper)
Note on method signature: since Java doesn't allow creating a generic array withnew T[], the implementation of this operator has to create anObject[] instead. Unfortunately, aFunction<Integer[], R> passed to the method would trigger aClassCastException.

This operator terminates eagerly if any of the source MaybeSources signal an onError or onComplete. This also means it is possible some sources may not get subscribed to at all.
zip does not operate by default on a particularScheduler.T - the common value typeR - the zipped result typesources - an Iterable of source MaybeSourceszipper - a function that, when applied to an item emitted by each of the source MaybeSources, results in an item that will be emitted by the resulting Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T1,T2,R> Maybe<R> zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,BiFunction<? super T1,? super T2,? extends R> zipper)

This operator terminates eagerly if any of the source MaybeSources signal an onError or onComplete. This also means it is possible some sources may not get subscribed to at all.
zip does not operate by default on a particularScheduler.T1 - the value type of the first sourceT2 - the value type of the second sourceR - the zipped result typesource1 - the first source MaybeSourcesource2 - a second source MaybeSourcezipper - a function that, when applied to an item emitted by each of the source MaybeSources, results in an item that will be emitted by the resulting Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T1,T2,T3,R> Maybe<R> zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,Function3<? super T1,? super T2,? super T3,? extends R> zipper)

This operator terminates eagerly if any of the source MaybeSources signal an onError or onComplete. This also means it is possible some sources may not get subscribed to at all.
zip does not operate by default on a particularScheduler.T1 - the value type of the first sourceT2 - the value type of the second sourceT3 - the value type of the third sourceR - the zipped result typesource1 - the first source MaybeSourcesource2 - a second source MaybeSourcesource3 - a third source MaybeSourcezipper - a function that, when applied to an item emitted by each of the source MaybeSources, results in an item that will be emitted by the resulting Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T1,T2,T3,T4,R> Maybe<R> zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,Function4<? super T1,? super T2,? super T3,? super T4,? extends R> zipper)

This operator terminates eagerly if any of the source MaybeSources signal an onError or onComplete. This also means it is possible some sources may not get subscribed to at all.
zip does not operate by default on a particularScheduler.T1 - the value type of the first sourceT2 - the value type of the second sourceT3 - the value type of the third sourceT4 - the value type of the fourth sourceR - the zipped result typesource1 - the first source MaybeSourcesource2 - a second source MaybeSourcesource3 - a third source MaybeSourcesource4 - a fourth source MaybeSourcezipper - a function that, when applied to an item emitted by each of the source MaybeSources, results in an item that will be emitted by the resulting Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T1,T2,T3,T4,T5,R> Maybe<R> zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,MaybeSource<? extends T5> source5,Function5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> zipper)

This operator terminates eagerly if any of the source MaybeSources signal an onError or onComplete. This also means it is possible some sources may not get subscribed to at all.
zip does not operate by default on a particularScheduler.T1 - the value type of the first sourceT2 - the value type of the second sourceT3 - the value type of the third sourceT4 - the value type of the fourth sourceT5 - the value type of the fifth sourceR - the zipped result typesource1 - the first source MaybeSourcesource2 - a second source MaybeSourcesource3 - a third source MaybeSourcesource4 - a fourth source MaybeSourcesource5 - a fifth source MaybeSourcezipper - a function that, when applied to an item emitted by each of the source MaybeSources, results in an item that will be emitted by the resulting Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T1,T2,T3,T4,T5,T6,R> Maybe<R> zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,MaybeSource<? extends T5> source5,MaybeSource<? extends T6> source6,Function6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> zipper)

This operator terminates eagerly if any of the source MaybeSources signal an onError or onComplete. This also means it is possible some sources may not get subscribed to at all.
zip does not operate by default on a particularScheduler.T1 - the value type of the first sourceT2 - the value type of the second sourceT3 - the value type of the third sourceT4 - the value type of the fourth sourceT5 - the value type of the fifth sourceT6 - the value type of the sixth sourceR - the zipped result typesource1 - the first source MaybeSourcesource2 - a second source MaybeSourcesource3 - a third source MaybeSourcesource4 - a fourth source MaybeSourcesource5 - a fifth source MaybeSourcesource6 - a sixth source MaybeSourcezipper - a function that, when applied to an item emitted by each of the source MaybeSources, results in an item that will be emitted by the resulting Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T1,T2,T3,T4,T5,T6,T7,R> Maybe<R> zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,MaybeSource<? extends T5> source5,MaybeSource<? extends T6> source6,MaybeSource<? extends T7> source7,Function7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> zipper)

This operator terminates eagerly if any of the source MaybeSources signal an onError or onComplete. This also means it is possible some sources may not get subscribed to at all.
zip does not operate by default on a particularScheduler.T1 - the value type of the first sourceT2 - the value type of the second sourceT3 - the value type of the third sourceT4 - the value type of the fourth sourceT5 - the value type of the fifth sourceT6 - the value type of the sixth sourceT7 - the value type of the seventh sourceR - the zipped result typesource1 - the first source MaybeSourcesource2 - a second source MaybeSourcesource3 - a third source MaybeSourcesource4 - a fourth source MaybeSourcesource5 - a fifth source MaybeSourcesource6 - a sixth source MaybeSourcesource7 - a seventh source MaybeSourcezipper - a function that, when applied to an item emitted by each of the source MaybeSources, results in an item that will be emitted by the resulting Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T1,T2,T3,T4,T5,T6,T7,T8,R> Maybe<R> zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,MaybeSource<? extends T5> source5,MaybeSource<? extends T6> source6,MaybeSource<? extends T7> source7,MaybeSource<? extends T8> source8,Function8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> zipper)

This operator terminates eagerly if any of the source MaybeSources signal an onError or onComplete. This also means it is possible some sources may not get subscribed to at all.
zip does not operate by default on a particularScheduler.T1 - the value type of the first sourceT2 - the value type of the second sourceT3 - the value type of the third sourceT4 - the value type of the fourth sourceT5 - the value type of the fifth sourceT6 - the value type of the sixth sourceT7 - the value type of the seventh sourceT8 - the value type of the eighth sourceR - the zipped result typesource1 - the first source MaybeSourcesource2 - a second source MaybeSourcesource3 - a third source MaybeSourcesource4 - a fourth source MaybeSourcesource5 - a fifth source MaybeSourcesource6 - a sixth source MaybeSourcesource7 - a seventh source MaybeSourcesource8 - an eighth source MaybeSourcezipper - a function that, when applied to an item emitted by each of the source MaybeSources, results in an item that will be emitted by the resulting Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T1,T2,T3,T4,T5,T6,T7,T8,T9,R> Maybe<R> zip(MaybeSource<? extends T1> source1,MaybeSource<? extends T2> source2,MaybeSource<? extends T3> source3,MaybeSource<? extends T4> source4,MaybeSource<? extends T5> source5,MaybeSource<? extends T6> source6,MaybeSource<? extends T7> source7,MaybeSource<? extends T8> source8,MaybeSource<? extends T9> source9,Function9<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? super T9,? extends R> zipper)

zip does not operate by default on a particularScheduler.This operator terminates eagerly if any of the source MaybeSources signal an onError or onComplete. This also means it is possible some sources may not get subscribed to at all.
T1 - the value type of the first sourceT2 - the value type of the second sourceT3 - the value type of the third sourceT4 - the value type of the fourth sourceT5 - the value type of the fifth sourceT6 - the value type of the sixth sourceT7 - the value type of the seventh sourceT8 - the value type of the eighth sourceT9 - the value type of the ninth sourceR - the zipped result typesource1 - the first source MaybeSourcesource2 - a second source MaybeSourcesource3 - a third source MaybeSourcesource4 - a fourth source MaybeSourcesource5 - a fifth source MaybeSourcesource6 - a sixth source MaybeSourcesource7 - a seventh source MaybeSourcesource8 - an eighth source MaybeSourcesource9 - a ninth source MaybeSourcezipper - a function that, when applied to an item emitted by each of the source MaybeSources, results in an item that will be emitted by the resulting MaybeSource@CheckReturnValue@NonNull@SchedulerSupport(value="none")public static <T,R> Maybe<R> zipArray(Function<? superObject[],? extends R> zipper,MaybeSource<? extends T>... sources)
Note on method signature: since Java doesn't allow creating a generic array withnew T[], the implementation of this operator has to create anObject[] instead. Unfortunately, aFunction<Integer[], R> passed to the method would trigger aClassCastException.

This operator terminates eagerly if any of the source MaybeSources signal an onError or onComplete. This also means it is possible some sources may not get subscribed to at all.
zipArray does not operate by default on a particularScheduler.T - the common element typeR - the result typesources - an array of source MaybeSourceszipper - a function that, when applied to an item emitted by each of the source MaybeSources, results in an item that will be emitted by the resulting MaybeSource@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> ambWith(MaybeSource<? extendsT> other)

ambWith does not operate by default on a particularScheduler.other - a MaybeSource competing to react first. A subscription to this provided source will occur after subscribing to the current source.@CheckReturnValue@SchedulerSupport(value="none")public final <R> R as(@NonNullMaybeConverter<T,? extends R> converter)
This allows fluent conversion to any other type.
as does not operate by default on a particularScheduler.History: 2.1.7 - experimental
R - the resulting object typeconverter - the function that receives the current Maybe instance and returns a valueNullPointerException - if converter is null@CheckReturnValue@SchedulerSupport(value="none")public final T blockingGet()
blockingGet does not operate by default on a particularScheduler.Exception intoRuntimeException and throws that. Otherwise,RuntimeExceptions andErrors are rethrown as they are.@CheckReturnValue@SchedulerSupport(value="none")public final T blockingGet(T defaultValue)
blockingGet does not operate by default on a particularScheduler.Exception intoRuntimeException and throws that. Otherwise,RuntimeExceptions andErrors are rethrown as they are.defaultValue - the default item to return if this Maybe is empty@CheckReturnValue@SchedulerSupport(value="none")public final Maybe<T> cache()

The operator subscribes only when the first downstream subscriber subscribes and maintains a single subscription towards this Maybe.
Note: You sacrifice the ability to dispose the origin when you use thecache.
cache does not operate by default on a particularScheduler.@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U> Maybe<U> cast(Class<? extends U> clazz)
cast does not operate by default on a particularScheduler.U - the target typeclazz - the type token to use for casting the success result from the current Maybe@CheckReturnValue@SchedulerSupport(value="none")public final <R> Maybe<R> compose(MaybeTransformer<? superT,? extends R> transformer)
This method operates on the Maybe itself whereaslift(io.reactivex.MaybeOperator<? extends R, ? super T>) operates on the Maybe's MaybeObservers.
If the operator you are creating is designed to act on the individual item emitted by a Maybe, uselift(io.reactivex.MaybeOperator<? extends R, ? super T>). If your operator is designed to transform the source Maybe as a whole (for instance, by applying a particular set of existing RxJava operators to it) usecompose.
compose does not operate by default on a particularScheduler.R - the value type of the Maybe returned by the transformer functiontransformer - the transformer function, not null@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <R> Maybe<R> concatMap(Function<? superT,? extendsMaybeSource<? extends R>> mapper)

concatMap does not operate by default on a particularScheduler.Note that flatMap and concatMap for Maybe is the same operation.
R - the result value typemapper - a function that, when applied to the item emitted by the source Maybe, returns a MaybeSourcefunc when applied to the item emitted by the source Maybe@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Flowable<T> concatWith(MaybeSource<? extendsT> other)

concatWith does not operate by default on a particularScheduler.other - a MaybeSource to be concatenated after the current@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Single<Boolean> contains(Object item)

contains does not operate by default on a particularScheduler.item - the item to search for in the emissions from the source Maybe, not nulltrue if the specified item is emitted by the source Maybe, orfalse if the source Maybe completes without emitting that item@CheckReturnValue@SchedulerSupport(value="none")public final Single<Long> count()

count does not operate by default on a particularScheduler.count()@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> defaultIfEmpty(T defaultItem)
Note that the result Maybe is semantically equivalent to aSingle, since it's guaranteed to emit exactly one item or an error. SeetoSingle(Object) for a method with equivalent behavior which returns aSingle.

defaultIfEmpty does not operate by default on a particularScheduler.defaultItem - the item to emit if the source Maybe emits no items@CheckReturnValue@SchedulerSupport(value="io.reactivex:computation")public final Maybe<T> delay(long delay,TimeUnit unit)

delay operates by default on thecomputationScheduler.delay - the delay to shift the source byunit - theTimeUnit in whichperiod is defined@CheckReturnValue@NonNull@SchedulerSupport(value="custom")public final Maybe<T> delay(long delay,TimeUnit unit,Scheduler scheduler)

Scheduler this operator will use.delay - the delay to shift the source byunit - the time unit ofdelayscheduler - theScheduler to use for delaying@CheckReturnValue@NonNull@SchedulerSupport(value="none")@BackpressureSupport(value=UNBOUNDED_IN)public final <U,V> Maybe<T> delay(Publisher<U> delayIndicator)

delayIndicator is consumed in an unbounded manner but is cancelled after the first item it produces.delay does not operate by default on a particularScheduler.U - the subscription delay value type (ignored)V - the item delay value type (ignored)delayIndicator - the Publisher that gets subscribed to when this Maybe signals an event and that signal is emitted when the Publisher signals an item or completes@BackpressureSupport(value=UNBOUNDED_IN)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U> Maybe<T> delaySubscription(Publisher<U> subscriptionIndicator)
Publisher source is consumed in an unbounded fashion (without applying backpressure).Scheduler.U - the value type of the other Publisher, irrelevantsubscriptionIndicator - the other Publisher that should trigger the subscription to this Publisher.@CheckReturnValue@SchedulerSupport(value="io.reactivex:computation")public final Maybe<T> delaySubscription(long delay,TimeUnit unit)

delaySubscription operates by default on thecomputationScheduler.delay - the time to delay the subscriptionunit - the time unit ofdelay@CheckReturnValue@SchedulerSupport(value="custom")public final Maybe<T> delaySubscription(long delay,TimeUnit unit,Scheduler scheduler)

Scheduler this operator will use.delay - the time to delay the subscriptionunit - the time unit ofdelayscheduler - the Scheduler on which the waiting and subscription will happen@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> doAfterSuccess(Consumer<? superT> onAfterSuccess)
Note that theonAfterNext action is shared between subscriptions and as such should be thread-safe.
doAfterSuccess does not operate by default on a particularScheduler.History: 2.0.1 - experimental
onAfterSuccess - the Consumer that will be called after emitting an item from upstream to the downstream@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> doAfterTerminate(Action onAfterTerminate)
Action to be called when this Maybe invokes eitheronSuccess,onComplete oronError.
doAfterTerminate does not operate by default on a particularScheduler.onAfterTerminate - anAction to be invoked when the source Maybe finishesAction@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> doFinally(Action onFinally)
In case of a race between a terminal event and a dispose call, the providedonFinally action is executed once per subscription.
Note that theonFinally action is shared between subscriptions and as such should be thread-safe.
doFinally does not operate by default on a particularScheduler.History: 2.0.1 - experimental
onFinally - the action called when this Maybe terminates or gets disposed@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> doOnDispose(Action onDispose)
Action if a MaybeObserver subscribed to the current Maybe disposes the common Disposable it received via onSubscribe.doOnDispose does not operate by default on a particularScheduler.onDispose - the action called when the subscription is disposedNullPointerException - if onDispose is null@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> doOnComplete(Action onComplete)
onComplete.
doOnComplete does not operate by default on a particularScheduler.onComplete - the action to invoke when the source Maybe callsonComplete@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> doOnError(Consumer<? superThrowable> onError)

doOnError does not operate by default on a particularScheduler.onError - the consumer called with the success value of onError@CheckReturnValue@SchedulerSupport(value="none")public final Maybe<T> doOnEvent(BiConsumer<? superT,? superThrowable> onEvent)
Exceptions thrown from the callback will override the event so the downstream receives the error instead of the original signal.
doOnEvent does not operate by default on a particularScheduler.onEvent - the callback to call with the terminal event tuple@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> doOnSubscribe(Consumer<? superDisposable> onSubscribe)
doOnSubscribe does not operate by default on a particularScheduler.onSubscribe - the consumer called with the Disposable sent via onSubscribe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> doOnTerminate(Action onTerminate)

This differs fromdoAfterTerminate in that this happensbefore theonComplete oronError notification.
doOnTerminate does not operate by default on a particularScheduler.onTerminate - the action to invoke when the consumer callsonComplete oronErrordoOnTerminate(Action)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> doOnSuccess(Consumer<? superT> onSuccess)

doOnSuccess does not operate by default on a particularScheduler.onSuccess - the consumer called with the success value of onSuccess@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> filter(Predicate<? superT> predicate)

filter does not operate by default on a particularScheduler.predicate - a function that evaluates the item emitted by the source Maybe, returningtrue if it passes the filtertrue@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <R> Maybe<R> flatMap(Function<? superT,? extendsMaybeSource<? extends R>> mapper)

flatMap does not operate by default on a particularScheduler.Note that flatMap and concatMap for Maybe is the same operation.
R - the result value typemapper - a function that, when applied to the item emitted by the source Maybe, returns a MaybeSourcefunc when applied to the item emitted by the source Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <R> Maybe<R> flatMap(Function<? superT,? extendsMaybeSource<? extends R>> onSuccessMapper,Function<? superThrowable,? extendsMaybeSource<? extends R>> onErrorMapper,Callable<? extendsMaybeSource<? extends R>> onCompleteSupplier)

flatMap does not operate by default on a particularScheduler.R - the result typeonSuccessMapper - a function that returns a MaybeSource to merge for the onSuccess item emitted by this MaybeonErrorMapper - a function that returns a MaybeSource to merge for an onError notification from this MaybeonCompleteSupplier - a function that returns a MaybeSource to merge for an onComplete notification this Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U,R> Maybe<R> flatMap(Function<? superT,? extendsMaybeSource<? extends U>> mapper,BiFunction<? superT,? super U,? extends R> resultSelector)

flatMap does not operate by default on a particularScheduler.U - the type of items emitted by the MaybeSource returned by themapper functionR - the type of items emitted by the resulting Maybemapper - a function that returns a MaybeSource for the item emitted by the source MayberesultSelector - a function that combines one item emitted by each of the source and collection MaybeSource and returns an item to be emitted by the resulting MaybeSource@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U> Flowable<U> flattenAsFlowable(Function<? superT,? extendsIterable<? extends U>> mapper)
Maybe into anIterable and emits its items as aFlowable sequence.
flattenAsFlowable does not operate by default on a particularScheduler.U - the type of item emitted by the resulting Iterablemapper - a function that returns an Iterable sequence of values for when given an item emitted by the source Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U> Observable<U> flattenAsObservable(Function<? superT,? extendsIterable<? extends U>> mapper)
Maybe into anIterable and emits its items as anObservable sequence.
flattenAsObservable does not operate by default on a particularScheduler.U - the type of item emitted by the resulting Iterablemapper - a function that returns an Iterable sequence of values for when given an item emitted by the source Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <R> Observable<R> flatMapObservable(Function<? superT,? extendsObservableSource<? extends R>> mapper)

flatMapObservable does not operate by default on a particularScheduler.R - the result value typemapper - a function that, when applied to the item emitted by the source Maybe, returns an ObservableSourcefunc when applied to the item emitted by the source Maybe@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <R> Flowable<R> flatMapPublisher(Function<? superT,? extendsPublisher<? extends R>> mapper)

flatMapPublisher does not operate by default on a particularScheduler.R - the result value typemapper - a function that, when applied to the item emitted by the source Maybe, returns a Flowablefunc when applied to the item emitted by the source Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <R> Single<R> flatMapSingle(Function<? superT,? extendsSingleSource<? extends R>> mapper)
Single based on applying a specified function to the item emitted by the sourceMaybe, where that function returns aSingle. When this Maybe completes aNoSuchElementException will be thrown.
flatMapSingle does not operate by default on a particularScheduler.R - the result value typemapper - a function that, when applied to the item emitted by the source Maybe, returns a Singlemapper when applied to the item emitted by the source Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <R> Maybe<R> flatMapSingleElement(Function<? superT,? extendsSingleSource<? extends R>> mapper)
Maybe based on applying a specified function to the item emitted by the sourceMaybe, where that function returns aSingle. When this Maybe just completes the resultingMaybe completes as well.
flatMapSingleElement does not operate by default on a particularScheduler.History: 2.0.2 - experimental
R - the result value typemapper - a function that, when applied to the item emitted by the source Maybe, returns a Single@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Completable flatMapCompletable(Function<? superT,? extendsCompletableSource> mapper)
Completable that completes based on applying a specified function to the item emitted by the sourceMaybe, where that function returns aCompletable.
flatMapCompletable does not operate by default on a particularScheduler.mapper - a function that, when applied to the item emitted by the source Maybe, returns a Completablemapper when applied to the item emitted by the source Maybe@CheckReturnValue@SchedulerSupport(value="none")public final Maybe<T> hide()

Allows preventing certain identity-based optimizations (fusion).
hide does not operate by default on a particularScheduler.@CheckReturnValue@SchedulerSupport(value="none")public final Completable ignoreElement()
onComplete oronError.
ignoreElement does not operate by default on a particularScheduler.onComplete oronError, based on which one is called by the source Maybe@CheckReturnValue@SchedulerSupport(value="none")public final Single<Boolean> isEmpty()
true if the source Maybe is empty, otherwisefalse.
isEmpty does not operate by default on a particularScheduler.@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <R> Maybe<R> lift(MaybeOperator<? extends R,? superT> lift)
Maybe which, when subscribed to, invokes theapply(MaybeObserver) method of the providedMaybeOperator for each individual downstreamMaybe and allows the insertion of a custom operator by accessing the downstream'sMaybeObserver during this subscription phase and providing a newMaybeObserver, containing the custom operator's intended business logic, that will be used in the subscription process going further upstream. Generally, such a newMaybeObserver will wrap the downstream'sMaybeObserver and forwards theonSuccess,onError andonComplete events from the upstream directly or according to the emission pattern the custom operator's business logic requires. In addition, such operator can intercept the flow control calls ofdispose andisDisposed that would have traveled upstream and perform additional actions depending on the same business logic requirements.
Example:
// Step 1: Create the consumer type that will be returned by the MaybeOperator.apply(): public final class CustomMaybeObserver<T> implements MaybeObserver<T>, Disposable { // The downstream's MaybeObserver that will receive the onXXX events final MaybeObserver<? super String> downstream; // The connection to the upstream source that will call this class' onXXX methods Disposable upstream; // The constructor takes the downstream subscriber and usually any other parameters public CustomMaybeObserver(MaybeObserver<? super String> downstream) { this.downstream = downstream; } // In the subscription phase, the upstream sends a Disposable to this class // and subsequently this class has to send a Disposable to the downstream. // Note that relaying the upstream's Disposable directly is not allowed in RxJava @Override public void onSubscribe(Disposable d) { if (upstream != null) { d.dispose(); } else { upstream = d; downstream.onSubscribe(this); } } // The upstream calls this with the next item and the implementation's // responsibility is to emit an item to the downstream based on the intended // business logic, or if it can't do so for the particular item, // request more from the upstream @Override public void onSuccess(T item) { String str = item.toString(); if (str.length() < 2) { downstream.onSuccess(str); } else { // Maybe is usually expected to produce one of the onXXX events downstream.onComplete(); } } // Some operators may handle the upstream's error while others // could just forward it to the downstream. @Override public void onError(Throwable throwable) { downstream.onError(throwable); } // When the upstream completes, usually the downstream should complete as well. @Override public void onComplete() { downstream.onComplete(); } // Some operators may use their own resources which should be cleaned up if // the downstream disposes the flow before it completed. Operators without // resources can simply forward the dispose to the upstream. // In some cases, a disposed flag may be set by this method so that other parts // of this class may detect the dispose and stop sending events // to the downstream. @Override public void dispose() { upstream.dispose(); } // Some operators may simply forward the call to the upstream while others // can return the disposed flag set in dispose(). @Override public boolean isDisposed() { return upstream.isDisposed(); } } // Step 2: Create a class that implements the MaybeOperator interface and // returns the custom consumer type from above in its apply() method. // Such class may define additional parameters to be submitted to // the custom consumer type. final class CustomMaybeOperator<T> implements MaybeOperator<String> { @Override public MaybeObserver<? super String> apply(MaybeObserver<? super T> upstream) { return new CustomMaybeObserver<T>(upstream); } } // Step 3: Apply the custom operator via lift() in a flow by creating an instance of it // or reusing an existing one. Maybe.just(5) .lift(new CustomMaybeOperator<Integer>()) .test() .assertResult("5"); Maybe.just(15) .lift(new CustomMaybeOperator<Integer>()) .test() .assertResult();Creating custom operators can be complicated and it is recommended one consults theRxJava wiki: Writing operators page about the tools, requirements, rules, considerations and pitfalls of implementing them.
Note that implementing custom operators via thislift() method adds slightly more overhead by requiring an additional allocation and indirection per assembled flows. Instead, extending the abstractMaybe class and creating aMaybeTransformer with it is recommended.
Note also that it is not possible to stop the subscription phase inlift() as theapply() method requires a non-nullMaybeObserver instance to be returned, which is then unconditionally subscribed to the upstreamMaybe. For example, if the operator decided there is no reason to subscribe to the upstream source because of some optimization possibility or a failure to prepare the operator, it still has to return aMaybeObserver that should immediately dispose the upstream'sDisposable in itsonSubscribe method. Again, using aMaybeTransformer and extending theMaybe is a better option assubscribeActual(io.reactivex.MaybeObserver<? super T>) can decide to not subscribe to its upstream after all.
lift does not operate by default on a particularScheduler, however, theMaybeOperator may use aScheduler to support its own asynchronous behavior.R - the output value typelift - theMaybeOperator that receives the downstream'sMaybeObserver and should return aMaybeObserver with custom behavior to be used as the consumer for the currentMaybe.compose(MaybeTransformer)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <R> Maybe<R> map(Function<? superT,? extends R> mapper)

map does not operate by default on a particularScheduler.R - the result value typemapper - a function to apply to the item emitted by the Maybe@CheckReturnValue@SchedulerSupport(value="none")public final Single<Notification<T>> materialize()
Notification of the same kind and emits it as a single success value to downstream.
materialize does not operate by default on a particularScheduler.Single.dematerialize(Function)@BackpressureSupport(value=FULL)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Flowable<T> mergeWith(MaybeSource<? extendsT> other)

You can combine items emitted by multiple Maybes so that they appear as a single Flowable, by using themergeWith method.
mergeWith does not operate by default on a particularScheduler.other - a MaybeSource to be merged@CheckReturnValue@NonNull@SchedulerSupport(value="custom")public final Maybe<T> observeOn(Scheduler scheduler)
Scheduler, asynchronously.
Scheduler this operator will use.scheduler - theScheduler to notify subscribers onSchedulersubscribeOn(io.reactivex.Scheduler)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U> Maybe<U> ofType(Class<U> clazz)

ofType does not operate by default on a particularScheduler.U - the output typeclazz - the class type to filter the items emitted by the source Maybe@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <R> R to(Function<? superMaybe<T>,R> convert)
to does not operate by default on a particularScheduler.R - the result typeconvert - the function that is called with the current Maybe instance during assembly time that should return some value to be the result@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public final Flowable<T> toFlowable()
toFlowable does not operate by default on a particularScheduler.@CheckReturnValue@SchedulerSupport(value="none")public final Observable<T> toObservable()
toObservable does not operate by default on a particularScheduler.@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Single<T> toSingle(T defaultValue)
toSingle does not operate by default on a particularScheduler.defaultValue - the default item to signal in Single if this Maybe is empty@CheckReturnValue@SchedulerSupport(value="none")public final Single<T> toSingle()
toSingle does not operate by default on a particularScheduler.@CheckReturnValue@SchedulerSupport(value="none")public final Maybe<T> onErrorComplete()
onErrorComplete does not operate by default on a particularScheduler.@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> onErrorComplete(Predicate<? superThrowable> predicate)
onErrorComplete does not operate by default on a particularScheduler.predicate - the predicate to call when an Throwable is emitted which should return true if the Throwable should be swallowed and replaced with an onComplete.@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> onErrorResumeNext(MaybeSource<? extendsT> next)
MaybeSource rather than invokingonError if it encounters an error.
You can use this to prevent errors from propagating or to supply fallback data should errors be encountered.
onErrorResumeNext does not operate by default on a particularScheduler.next - the nextMaybeSource that will take over if the source Maybe encounters an error@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> onErrorResumeNext(Function<? superThrowable,? extendsMaybeSource<? extendsT>> resumeFunction)
onError if it encounters an error.
You can use this to prevent errors from propagating or to supply fallback data should errors be encountered.
onErrorResumeNext does not operate by default on a particularScheduler.resumeFunction - a function that returns a MaybeSource that will take over if the source Maybe encounters an error@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> onErrorReturn(Function<? superThrowable,? extendsT> valueSupplier)
onError if it encounters an error.
You can use this to prevent errors from propagating or to supply fallback data should errors be encountered.
onErrorReturn does not operate by default on a particularScheduler.valueSupplier - a function that returns a single value that will be emitted as success value the current Maybe signals an onError event@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> onErrorReturnItem(T item)
onError if it encounters an error.
You can use this to prevent errors from propagating or to supply fallback data should errors be encountered.
onErrorReturnItem does not operate by default on a particularScheduler.item - the value that is emitted as onSuccess in case this Maybe signals an onError@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> onExceptionResumeNext(MaybeSource<? extendsT> next)
onError if it encounters anException. This differs fromonErrorResumeNext(io.reactivex.MaybeSource<? extends T>) in that this one does not handleThrowable orError but lets those continue through.

You can use this to prevent exceptions from propagating or to supply fallback data should exceptions be encountered.
onExceptionResumeNext does not operate by default on a particularScheduler.next - the next MaybeSource that will take over if the source Maybe encounters an exception@CheckReturnValue@SchedulerSupport(value="none")public final Maybe<T> onTerminateDetach()
onTerminateDetach does not operate by default on a particularScheduler.@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public final Flowable<T> repeat()

repeat does not operate by default on a particularScheduler.@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public final Flowable<T> repeat(long times)
count times.
repeat does not operate by default on a particularScheduler.times - the number of times the source Maybe items are repeated, a count of 0 will yield an empty sequencecount timesIllegalArgumentException - ifcount is less than zero@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public final Flowable<T> repeatUntil(BooleanSupplier stop)

repeatUntil does not operate by default on a particularScheduler.stop - a boolean supplier that is called when the current Flowable completes and unless it returns false, the current Flowable is resubscribedNullPointerException - ifstop is null@BackpressureSupport(value=FULL)@CheckReturnValue@SchedulerSupport(value="none")public final Flowable<T> repeatWhen(Function<? superFlowable<Object>,? extendsPublisher<?>> handler)
onComplete. AnonComplete notification from the source will result in the emission of avoid item to the Publisher provided as an argument to thenotificationHandler function. If that Publisher callsonComplete oronError thenrepeatWhen will callonComplete oronError on the child subscription. Otherwise, this Publisher will resubscribe to the source Publisher.
Publisher to honor backpressure as well. If this expectation is violated, the operatormay throw anIllegalStateException.repeatWhen does not operate by default on a particularScheduler.handler - receives a Publisher of notifications with which a user can complete or error, aborting the repeat.@CheckReturnValue@SchedulerSupport(value="none")public final Maybe<T> retry()
onError (infinite retry count).
If the source Maybe callsMaybeObserver.onError(java.lang.Throwable), this method will resubscribe to the source Maybe rather than propagating theonError call.
retry does not operate by default on a particularScheduler.@CheckReturnValue@SchedulerSupport(value="none")public final Maybe<T> retry(BiPredicate<? superInteger,? superThrowable> predicate)
onError and the predicate returns true for that specific exception and retry count.
retry does not operate by default on a particularScheduler.predicate - the predicate that determines if a resubscription may happen in case of a specific exception and retry countretry(),ReactiveX operators documentation: Retry@CheckReturnValue@SchedulerSupport(value="none")public final Maybe<T> retry(long count)
onError up to a specified number of retries.
If the source Maybe callsMaybeObserver.onError(java.lang.Throwable), this method will resubscribe to the source Maybe for a maximum ofcount resubscriptions rather than propagating theonError call.
retry does not operate by default on a particularScheduler.count - the number of times to resubscribe if the current Maybe fails@CheckReturnValue@SchedulerSupport(value="none")public final Maybe<T> retry(long times,Predicate<? superThrowable> predicate)
retry does not operate by default on a particularScheduler.times - the number of times to resubscribe if the current Maybe failspredicate - the predicate called with the failure Throwable and should return true to trigger a retry.@CheckReturnValue@SchedulerSupport(value="none")public final Maybe<T> retry(Predicate<? superThrowable> predicate)
retry does not operate by default on a particularScheduler.predicate - the predicate that receives the failure Throwable and should return true to trigger a retry.@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> retryUntil(BooleanSupplier stop)
retryUntil does not operate by default on a particularScheduler.stop - the function that should return true to stop retrying@CheckReturnValue@SchedulerSupport(value="none")public final Maybe<T> retryWhen(Function<? superFlowable<Throwable>,? extendsPublisher<?>> handler)
onError. AnonError notification from the source will result in the emission of aThrowable item to the Publisher provided as an argument to thenotificationHandler function. If that Publisher callsonComplete oronError thenretry will callonComplete oronError on the child subscription. Otherwise, this Publisher will resubscribe to the source Publisher.
Example: This retries 3 times, each time incrementing the number of seconds it waits.
Maybe.create((MaybeEmitter<? super String> s) -> { System.out.println("subscribing"); s.onError(new RuntimeException("always fails")); }, BackpressureStrategy.BUFFER).retryWhen(attempts -> { return attempts.zipWith(Publisher.range(1, 3), (n, i) -> i).flatMap(i -> { System.out.println("delay retry by " + i + " second(s)"); return Flowable.timer(i, TimeUnit.SECONDS); }); }).blockingForEach(System.out::println); Output is: subscribing delay retry by 1 second(s) subscribing delay retry by 2 second(s) subscribing delay retry by 3 second(s) subscribing Note that the innerPublisher returned by the handler function should signal eitheronNext,onError oronComplete in response to the receivedThrowable to indicate the operator should retry or terminate. If the upstream to the operator is asynchronous, signalling onNext followed by onComplete immediately may result in the sequence to be completed immediately. Similarly, if this innerPublisher signalsonError oronComplete while the upstream is active, the sequence is terminated with the same signal immediately.
The following example demonstrates how to retry an asynchronous source with a delay:
Maybe.timer(1, TimeUnit.SECONDS) .doOnSubscribe(s -> System.out.println("subscribing")) .map(v -> { throw new RuntimeException(); }) .retryWhen(errors -> { AtomicInteger counter = new AtomicInteger(); return errors .takeWhile(e -> counter.getAndIncrement() != 3) .flatMap(e -> { System.out.println("delay retry by " + counter.get() + " second(s)"); return Flowable.timer(counter.get(), TimeUnit.SECONDS); }); }) .blockingGet();retryWhen does not operate by default on a particularScheduler.handler - receives a Publisher of notifications with which a user can complete or error, aborting the retry@SchedulerSupport(value="none")public final Disposable subscribe()
onSuccess andonComplete emissions. If the Maybe emits an error, it is wrapped into anOnErrorNotImplementedException and routed to the RxJavaPlugins.onError handler.
subscribe does not operate by default on a particularScheduler.Disposable reference with which the caller can stop receiving items before the Maybe has finished sending them@CheckReturnValue@SchedulerSupport(value="none")public final Disposable subscribe(Consumer<? superT> onSuccess)
If the Maybe emits an error, it is wrapped into anOnErrorNotImplementedException and routed to the RxJavaPlugins.onError handler.
subscribe does not operate by default on a particularScheduler.onSuccess - theConsumer<T> you have designed to accept a success value from the MaybeDisposable reference with which the caller can stop receiving items before the Maybe has finished sending themNullPointerException - ifonSuccess is null@CheckReturnValue@SchedulerSupport(value="none")public final Disposable subscribe(Consumer<? superT> onSuccess,Consumer<? superThrowable> onError)
subscribe does not operate by default on a particularScheduler.onSuccess - theConsumer<T> you have designed to accept a success value from the MaybeonError - theConsumer<Throwable> you have designed to accept any error notification from the MaybeDisposable reference with which the caller can stop receiving items before the Maybe has finished sending themNullPointerException - ifonSuccess is null, or ifonError is null@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Disposable subscribe(Consumer<? superT> onSuccess,Consumer<? superThrowable> onError,Action onComplete)
subscribe does not operate by default on a particularScheduler.onSuccess - theConsumer<T> you have designed to accept a success value from the MaybeonError - theConsumer<Throwable> you have designed to accept any error notification from the MaybeonComplete - theAction you have designed to accept a completion notification from the MaybeDisposable reference with which the caller can stop receiving items before the Maybe has finished sending themNullPointerException - ifonSuccess is null, or ifonError is null, or ifonComplete is null@SchedulerSupport(value="none")public final void subscribe(MaybeObserver<? superT> observer)
MaybeSourcesubscribe in interface MaybeSource<T>observer - the MaybeObserver, not nullprotected abstract void subscribeActual(MaybeObserver<? superT> observer)
MaybeObservers.There is no need to call any of the plugin hooks on the currentMaybe instance or theMaybeObserver; all hooks and basic safeguards have been applied bysubscribe(MaybeObserver) before this method gets called.
observer - the MaybeObserver to handle, not null@CheckReturnValue@NonNull@SchedulerSupport(value="custom")public final Maybe<T> subscribeOn(Scheduler scheduler)
Scheduler.
Scheduler this operator will use.scheduler - theScheduler to perform subscription actions onSchedulerobserveOn(io.reactivex.Scheduler)@CheckReturnValue@SchedulerSupport(value="none")public final <E extendsMaybeObserver<? superT>> E subscribeWith(E observer)
Usage example:
Maybe<Integer> source = Maybe.just(1); CompositeDisposable composite = new CompositeDisposable(); DisposableMaybeObserver<Integer> ds = new DisposableMaybeObserver<>() { // ... }; composite.add(source.subscribeWith(ds));subscribeWith does not operate by default on a particularScheduler.E - the type of the MaybeObserver to use and returnobserver - the MaybeObserver (subclass) to use and return, not nullsubscriberNullPointerException - ifsubscriber is null@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Maybe<T> switchIfEmpty(MaybeSource<? extendsT> other)

switchIfEmpty does not operate by default on a particularScheduler.other - the alternate MaybeSource to subscribe to if the main does not emit any items@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final Single<T> switchIfEmpty(SingleSource<? extendsT> other)

switchIfEmpty does not operate by default on a particularScheduler.History: 2.1.4 - experimental
other - the alternate SingleSource to subscribe to if the main does not emit any items@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U> Maybe<T> takeUntil(MaybeSource<U> other)

takeUntil does not operate by default on a particularScheduler.U - the type of items emitted byotherother - the MaybeSource whose first emitted item will causetakeUntil to stop emitting items from the source Maybeother emits its first item@BackpressureSupport(value=UNBOUNDED_IN)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U> Maybe<T> takeUntil(Publisher<U> other)

Publisher is consumed in an unbounded fashion and is cancelled after the first item emitted.takeUntil does not operate by default on a particularScheduler.U - the type of items emitted byotherother - the Publisher whose first emitted item will causetakeUntil to stop emitting items from the source Publisherother emits its first item@CheckReturnValue@SchedulerSupport(value="io.reactivex:computation")public final Maybe<T> timeout(long timeout,TimeUnit timeUnit)
TimeoutException.
timeout operates by default on thecomputationScheduler.timeout - maximum duration between emitted items before a timeout occurstimeUnit - the unit of time that applies to thetimeout argument.@CheckReturnValue@NonNull@SchedulerSupport(value="io.reactivex:computation")public final Maybe<T> timeout(long timeout,TimeUnit timeUnit,MaybeSource<? extendsT> fallback)

timeout operates by default on thecomputationScheduler.timeout - maximum duration between items before a timeout occurstimeUnit - the unit of time that applies to thetimeout argumentfallback - the fallback MaybeSource to use in case of a timeout@CheckReturnValue@NonNull@SchedulerSupport(value="custom")public final Maybe<T> timeout(long timeout,TimeUnit timeUnit,Scheduler scheduler,MaybeSource<? extendsT> fallback)

Scheduler this operator will use.timeout - maximum duration between items before a timeout occurstimeUnit - the unit of time that applies to thetimeout argumentfallback - the MaybeSource to use as the fallback in case of a timeoutscheduler - theScheduler to run the timeout timers on@CheckReturnValue@SchedulerSupport(value="custom")public final Maybe<T> timeout(long timeout,TimeUnit timeUnit,Scheduler scheduler)
TimeoutException.
Scheduler this operator will use.timeout - maximum duration between items before a timeout occurstimeUnit - the unit of time that applies to thetimeout argumentscheduler - the Scheduler to run the timeout timers on@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U> Maybe<T> timeout(MaybeSource<U> timeoutIndicator)
Maybe didn't signal an event before thetimeoutIndicatorMaybeSource signals, aTimeoutException is signaled instead.timeout does not operate by default on a particularScheduler.U - the value type of thetimeoutIndicator - theMaybeSource that indicates the timeout by signaling onSuccess or onComplete.@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U> Maybe<T> timeout(MaybeSource<U> timeoutIndicator,MaybeSource<? extendsT> fallback)
Maybe didn't signal an event before thetimeoutIndicatorMaybeSource signals, the currentMaybe is disposed and thefallbackMaybeSource subscribed to as a continuation.timeout does not operate by default on a particularScheduler.U - the value type of thetimeoutIndicator - theMaybeSource that indicates the timeout by signalingonSuccess oronComplete.fallback - theMaybeSource that is subscribed to if the currentMaybe times out@BackpressureSupport(value=UNBOUNDED_IN)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U> Maybe<T> timeout(Publisher<U> timeoutIndicator)
Maybe source didn't signal an event before thetimeoutIndicatorPublisher signals, aTimeoutException is signaled instead.U - the value type of thetimeoutIndicator - theMaybeSource that indicates the timeout by signalingonSuccess oronComplete.@BackpressureSupport(value=UNBOUNDED_IN)@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U> Maybe<T> timeout(Publisher<U> timeoutIndicator,MaybeSource<? extendsT> fallback)
Maybe didn't signal an event before thetimeoutIndicatorPublisher signals, the currentMaybe is disposed and thefallbackMaybeSource subscribed to as a continuation.U - the value type of thetimeoutIndicator - theMaybeSource that indicates the timeout by signalingonSuccess oronCompletefallback - theMaybeSource that is subscribed to if the currentMaybe times out@CheckReturnValue@NonNull@SchedulerSupport(value="custom")public final Maybe<T> unsubscribeOn(Scheduler scheduler)
unsubscribeOn calls dispose() of the upstream on theScheduler you specify.scheduler - the target scheduler where to execute the disposalNullPointerException - if scheduler is null@CheckReturnValue@NonNull@SchedulerSupport(value="none")public final <U,R> Maybe<R> zipWith(MaybeSource<? extends U> other,BiFunction<? superT,? super U,? extends R> zipper)

If either this or the other MaybeSource is empty or signals an error, the resulting Maybe will terminate immediately and dispose the other source.
zipWith does not operate by default on a particularScheduler.U - the type of items emitted by theother MaybeSourceR - the type of items emitted by the resulting Maybeother - the other MaybeSourcezipper - a function that combines the pairs of items from the two MaybeSources to generate the items to be emitted by the resulting Maybe@CheckReturnValue@SchedulerSupport(value="none")public final TestObserver<T> test()
test does not operate by default on a particularScheduler.@CheckReturnValue@SchedulerSupport(value="none")public final TestObserver<T> test(boolean cancelled)
test does not operate by default on a particularScheduler.cancelled - if true, the TestObserver will be cancelled before subscribing to this Maybe.