Maybe class represents a deferred computation and emission of a single value, no value at all or an exception.
The Maybe class implements the MaybeSource base interface and the default consumer
type it interacts with is the MaybeObserver via the subscribe(MaybeObserver) method.
The Maybe operates with the following sequential protocol:
onSubscribe (onSuccess | onError | onComplete)?
Note that onSuccess, onError and onComplete are mutually exclusive events; unlike Observable,
onSuccess is never followed by onError or onComplete.
Like Observable, a running Maybe can be stopped through the Disposable instance
provided to consumers through MaybeObserver#onSubscribe.
Like an Observable, a Maybe is lazy, can be either "hot" or "cold", synchronous or
asynchronous. Maybe instances returned by the methods of this class are cold
and there is a standard hot implementation in the form of a subject:
MaybeSubject.
The documentation for this class makes use of marble diagrams. The following legend explains these diagrams:
See Flowable or Observable 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 via subscribe(MaybeObserver) can't be disposed
from the outside (hence the
void return of the subscribe(MaybeObserver) method) and it is the
responsibility of the implementor of the MaybeObserver to allow this to happen.
RxJava supports such usage with the standard
DisposableMaybeObserver instance.
For convenience, the subscribeWith(MaybeObserver) method is provided as well to
allow working with a MaybeObserver (or subclass) instance to be applied with in
a fluent manner (such as in the example above).
io.reactivex.rxjava3.observers.DisposableMaybeObserver
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static < the value type T> @NonNull Maybe | Returns: the newMaybe instancethe sources)Iterable sequence of sources. A subscription to each source will
occur in the same order as in the Iterable.Runs multiple |
| public static < the value type T> @NonNull Maybe | Returns: the newMaybe instancethe array of sources. A subscription to each source will
occur in the same order as in the array. sources)Runs multiple |
| public final @NonNull Maybe | Returns: the newMaybe instancea other)MaybeSource competing to react first. A subscription to this provided source will occur after
subscribing to the current source.Mirrors the |
| public final T | Returns: the success valueWaits in a blocking fashion until the current |
| public final T | Returns: the success valuethe default item to return if this defaultValue)Maybe is emptyWaits in a blocking fashion until the current |
| public final void | blockingSubscribe()
Subscribes to the current |
| public final void | blockingSubscribe(@NonNull Consumer<? super T>
the onSuccess)Consumer to call if the current Maybe succeedsSubscribes to the current |
| public final void | blockingSubscribe(@NonNull Consumer<? super T>
the onSuccess, @NonNull Consumer<? super Throwable> Consumer to call if the current Maybe succeedsthe onError)Consumer to call if the current Maybe signals an errorSubscribes to the current |
| public final void | blockingSubscribe(@NonNull Consumer<? super T>
the onSuccess, @NonNull Consumer<? super Throwable> Consumer to call if the current Maybe succeedsthe onError, @NonNull Action Consumer to call if the current Maybe signals an errorthe onComplete)Action to call if the current Maybe completes without a valueSubscribes to the current |
| public final void | blockingSubscribe(@NonNull MaybeObserver<? super T>
the observer)MaybeObserver to call methods on the current threadSubscribes to the current |
| public final @NonNull Maybe | Returns: the newMaybe instanceReturns a |
| public final < the target type U> @NonNull Maybe | Returns: the newMaybe instancethe type token to use for casting the success result from the current clazz)MaybeCasts the success value of the current |
| public final < the value type of the R> @NonNull MaybeMaybe returned by the transformer function | Returns: the newMaybe instancethe transformer function, not transformer)nullTransform a |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instancethe sources)Iterable sequence of MaybeSource instancesConcatenate the single values, in a non-overlapping fashion, of the |
| public static < the common value type T> @NonNull Flowable | Returns: the newFlowable instancea source1, @NonNull MaybeSource<? extends T> MaybeSource to be concatenateda source2)MaybeSource to be concatenatedReturns a |
| public static < the common value type T> @NonNull Flowable | Returns: the newFlowable instancea source1, @NonNull MaybeSource<? extends T> MaybeSource to be concatenateda source2, @NonNull MaybeSource<? extends T> MaybeSource to be concatenateda source3)MaybeSource to be concatenatedReturns a |
| public static < the common value type T> @NonNull Flowable | Returns: the newFlowable instancea source1, @NonNull MaybeSource<? extends T> MaybeSource to be concatenateda source2, @NonNull MaybeSource<? extends T> MaybeSource to be concatenateda source3, @NonNull MaybeSource<? extends T> MaybeSource to be concatenateda source4)MaybeSource to be concatenatedReturns a |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instancethe sources)Publisher of MaybeSource instancesConcatenate the single values, in a non-overlapping fashion, of the |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instancethe sources, int Publisher of MaybeSource instancesthe number of prefetch)MaybeSources to prefetch from the PublisherConcatenate the single values, in a non-overlapping fashion, of the |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instancethe array of sources)MaybeSource instancesConcatenate the single values, in a non-overlapping fashion, of the |
| public static < the common base value type T> @NonNull Flowable | Returns: the newFlowable instancethe array of sources sources)Concatenates a variable number of |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instance with the specified concatenation behaviora sequence of sources)MaybeSources that need to be eagerly concatenatedConcatenates a sequence of |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instance with the specified concatenation behaviora sequence of sources)MaybeSources that need to be eagerly concatenatedConcatenates a sequence of |
| public static < the common element base type T> @NonNull Flowable | Returns: the newFlowable with the concatenating behaviorthe sources)Iterable sequence of MaybeSourcesConcatenates the |
| public static < the common element base type T> @NonNull Flowable | Returns: the newFlowable with the concatenating behaviorthe sources)Publisher sequence of MaybeSourcesConcatenates the |
| public static < the common element base type T> @NonNull Flowable | Returns: the newFlowable with the concatenating behaviorthe sources, int Publisher sequence of MaybeSourcesThe number of upstream items to prefetch so that fresh items are
ready to be mapped when a previous prefetch)MaybeSource terminates.
The operator replenishes after half of the prefetch amount has been consumed
and turned into MaybeSources.Concatenates the |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instance with the specified concatenation behaviora sequence of sources)MaybeSource that need to be eagerly concatenatedConcatenates a sequence of |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instance with the specified concatenation behaviora sequence of sources, int MaybeSource that need to be eagerly concatenatedthe maximum number of concurrently running inner maxConcurrency)MaybeSources; Integer#MAX_VALUE
is interpreted as all inner MaybeSources can be active at the same timeConcatenates a sequence of |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instance with the specified concatenation behaviora sequence of sources)MaybeSources that need to be eagerly concatenatedConcatenates a |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instance with the specified concatenation behaviora sequence of sources, int MaybeSources that need to be eagerly concatenatedthe maximum number of concurrently running inner maxConcurrency)MaybeSources; Integer#MAX_VALUE
is interpreted as all inner MaybeSources can be active at the same timeConcatenates a |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instance with the specified concatenation behaviora sequence of sources)MaybeSource that need to be eagerly concatenatedConcatenates a sequence of |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instance with the specified concatenation behaviora sequence of sources, int MaybeSource that need to be eagerly concatenatedthe maximum number of concurrently running inner maxConcurrency)MaybeSources; Integer#MAX_VALUE
is interpreted as all inner MaybeSources can be active at the same timeConcatenates a sequence of |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instance with the specified concatenation behaviora sequence of sources)MaybeSources that need to be eagerly concatenatedConcatenates a |
| public static < the value type T> @NonNull Flowable | Returns: the newFlowable instance with the specified concatenation behaviora sequence of sources, int MaybeSources that need to be eagerly concatenatedthe maximum number of concurrently running inner maxConcurrency)MaybeSources; Integer#MAX_VALUE
is interpreted as all inner MaybeSources can be active at the same timeConcatenates a |
| public final < the result value type R> @NonNull Maybe | Returns: the newMaybe instancea function that, when applied to the item emitted by the current mapper)Maybe, returns a MaybeSourceReturns a |
| public final @NonNull Completable | Returns: the newCompletable instancea function that, when applied to the item emitted by the current mapper)Maybe, returns a
CompletableReturns a |
| public final < the result value type R> @NonNull Maybe | Returns: the newMaybe instancea function that, when applied to the item emitted by the current mapper)Maybe, returns a
SingleReturns a |
| public final @NonNull Flowable | Returns: the newFlowable instancea other)MaybeSource to be concatenated after the currentReturns a |
| public final @NonNull Single | |
| public final @NonNull Single | |
| public static < the value type T> @NonNull Maybe | Returns: the newMaybe instancethe emitter that is called when a onSubscribe)MaybeObserver subscribes to the returned MaybeProvides an API (via a cold |
| public final @NonNull Single | Returns: the newSingle instancethe item to emit if the current defaultItem)Maybe emits no itemsReturns a |
| public static < the value type T> @NonNull Maybe | Returns: the newMaybe instancethe supplier)Supplier that is called for each individual MaybeObserver and
returns a MaybeSource instance to subscribe toCalls a |
| public final @NonNull Maybe | |
| public final @NonNull Maybe | Returns: the newMaybe instancethe delay to shift the source by time, @NonNull TimeUnit the unit, boolean TimeUnit in which time is definedif delayError)true, both success and error signals are delayed. if false, only success signals are delayed.Returns a |
| public final @NonNull Maybe | Returns: the newMaybe instancethe delay to shift the source by time, @NonNull TimeUnit the unit, @NonNull Scheduler TimeUnit in which time is definedthe scheduler)Scheduler to use for delayingReturns a |
| public final @NonNull Maybe | Returns: the newMaybe instancethe delay to shift the source by time, @NonNull TimeUnit the unit, @NonNull Scheduler TimeUnit in which time is definedthe scheduler, boolean Scheduler to use for delayingif delayError)true, both success and error signals are delayed. if false, only success signals are delayed.Returns a |
| public final < the subscription delay value type (ignored) U> @NonNull Maybe | Returns: the newMaybe instancethe delayIndicator)Publisher that gets subscribed to when this Maybe signals an event and that
signal is emitted when the Publisher signals an item or completesDelays the emission of this |
| public final < the value type of the other U> @NonNull MaybePublisher, irrelevant | Returns: the newMaybe instancethe other subscriptionIndicator)Publisher that should trigger the subscription
to this Publisher.Returns a |
| public final @NonNull Maybe | Returns: the newMaybe instancethe time to delay the subscription time, @NonNull TimeUnit the time unit of unit)delayReturns a |
| public final @NonNull Maybe | Returns: the newMaybe instancethe time to delay the subscription time, @NonNull TimeUnit the time unit of unit, @NonNull Scheduler delaythe scheduler)Scheduler on which the waiting and subscription will happenReturns a |
| public final < the result type R> @NonNull Maybe | Returns: the newMaybe instancethe function called with the success item and should
return a selector)Notification instance.Maps the |
| public final @NonNull Maybe | Returns: the newMaybe instancethe onAfterSuccess)Consumer that will be called after emitting an item from upstream to the downstreamCalls the specified |
| public final @NonNull Maybe | Returns: the newMaybe instancean onAfterTerminate)Action to be invoked when the current Maybe finishesRegisters an |
| public final @NonNull Maybe | |
| public final @NonNull Maybe | Returns: the newMaybe with the side-effecting behavior appliedthe action to invoke when the current onComplete)Maybe calls onCompleteInvokes an |
| public final @NonNull Maybe | Returns: the newMaybe instancethe action called when the subscription is disposed onDispose)Calls the shared |
| public final @NonNull Maybe | |
| public final @NonNull Maybe | Returns: the newMaybe instancethe callback to call with the success value or the exception, whichever is not onEvent)nullCalls the given |
| public final @NonNull Maybe | Returns: the newMaybe instancecalled when the downstream disposes the onDispose)Disposable via dispose()Calls the appropriate |
| public final @NonNull Maybe | Returns: the newMaybe instancethe onSubscribe)Consumer called with the Disposable sent via onSubscribeCalls the shared |
| public final @NonNull Maybe | Returns: the newMaybe instancethe onSuccess)Consumer called with the success value of the upstreamCalls the shared |
| public final @NonNull Maybe | Returns: the newMaybe instancethe action to invoke when the consumer calls onTerminate)onComplete or onErrorReturns a |
| public static < the value type T> @NonNull Maybe | Returns: the sharedMaybe instanceReturns a (singleton) |
| public static < the type of the item (ostensibly) emitted by the T> @NonNull MaybeMaybe | |
| public static < the type of the items (ostensibly) emitted by the T> @NonNull MaybeMaybe | |
| public final @NonNull Maybe | Returns: the newMaybe instancea function that evaluates the item emitted by the current predicate)Maybe, returning true
if it passes the filterFilters the success item of the |
| public final < the result value type R> @NonNull Maybe | Returns: the newMaybe instancea function that, when applied to the item emitted by the current mapper)Maybe, returns a MaybeSourceReturns a |
| public final < the result type R> @NonNull Maybe | Returns: the newMaybe instancea function that returns a onSuccessMapper, @NonNull Function<? super Throwable, ? extends MaybeSource<? extends R>> MaybeSource to merge for the onSuccess item emitted by this Maybea function that returns a onErrorMapper, @NonNull Supplier<? extends MaybeSource<? extends R>> MaybeSource to merge for an onError notification from this Maybea function that returns a onCompleteSupplier)MaybeSource to merge for an onComplete notification this MaybeMaps the |
| public final < the type of items emitted by the U, MaybeSource returned by the mapper functionthe type of items emitted by the resulting R> @NonNull MaybeMaybe | Returns: the newMaybe instancea function that returns a mapper, @NonNull BiFunction<? super T, ? super U, ? extends R> MaybeSource for the item emitted by the current Maybea function that combines one item emitted by each of the source and collection combiner)MaybeSource and
returns an item to be emitted by the resulting MaybeSourceReturns a |
| public final @NonNull Completable | Returns: the newCompletable instancea function that, when applied to the item emitted by the current mapper)Maybe, returns a
CompletableReturns a |
| public final < the result value type R> @NonNull Observable | Returns: the newObservable instancea function that, when applied to the item emitted by the current mapper)Maybe, returns an ObservableSourceReturns an |
| public final < the result value type R> @NonNull Flowable | Returns: the newFlowable instancea function that, when applied to the item emitted by the current mapper)Maybe, returns a
FlowableReturns a |
| public final < the result value type R> @NonNull Maybe | Returns: the newMaybe instancea function that, when applied to the item emitted by the current mapper)Maybe, returns a
SingleReturns a |
| public final < the type of item emitted by the inner U> @NonNull FlowableIterable | Returns: the newFlowable instancea function that returns an mapper)Iterable sequence of values for when given an item emitted by the
current MaybeMaps the success value of the current |
| public final < the type of item emitted by the resulting U> @NonNull ObservableIterable | Returns: the newObservable instancea function that returns an mapper)Iterable sequence of values for when given an item emitted by the
current MaybeMaps the success value of the current |
| public final < the element type of the R> @NonNull FlowableStream and the output Flowable | Returns: the newFlowable instancethe function that receives the upstream success item and should
return a mapper)Stream of values to emit.Maps the upstream succecss value into a Java |
| public final < the element type of the R> @NonNull ObservableStream and the output Observable | Returns: the newObservable instancethe function that receives the upstream success item and should
return a mapper)Stream of values to emit.Maps the upstream succecss value into a Java |
| public static < the target type T> @NonNull Maybe | Returns: the newMaybe instancethe action)Action to run for each MaybeObserverReturns a |
| public static < the type of the item emitted by the T> @NonNull MaybeMaybe. | Returns: the newMaybe instancea callable)Callable instance whose execution should be deferred and performed for each individual
MaybeObserver that subscribes to the returned Maybe.Returns a |
| public static < the target type T> @NonNull Maybe | Returns: the newMaybe instancethe completableSource)CompletableSource to convert fromWraps a |
| public static < the element type of the T> @NonNull MaybeCompletionStage | Returns: the newMaybe instancethe stage)CompletionStage to convert to Maybe and signal its terminal value or errorSignals the completion value or error of the given (hot) |
| public static < the type of object that the T> @NonNull MaybeFuture returns, and also the type of item to be emitted by
the resulting Maybe | Returns: the newMaybe instancethe source future)FutureConverts a |
| public static < the type of object that the T> @NonNull MaybeFuture returns, and also the type of item to be emitted by
the resulting Maybe | |
| public static < the target type T> @NonNull Maybe | Returns: the newMaybe instancethe source)ObservableSource to convert fromWraps an |
| public static < the element type of the optional value T> @NonNull Maybe | Returns: the newMaybe instancethe optional value to convert into a optional)MaybeConverts the existing value of the provided optional into a |
| public static < the target type T> @NonNull Maybe | Returns: the newMaybe instancethe source)Publisher to convert fromWraps a |
| public static < the target type T> @NonNull Maybe | Returns: the newMaybe instancethe run)Runnable to run for each MaybeObserverReturns a |
| public static < the target type T> @NonNull Maybe | Returns: the newMaybe instancethe single)SingleSource to convert fromWraps a |
| public static < the type of the item emitted by the T> @NonNull MaybeMaybe. | Returns: the newMaybe instancea supplier)Supplier instance whose execution should be deferred and performed for each individual
MaybeObserver that subscribes to the returned Maybe.Returns a |
| public final @NonNull Maybe | |
| public final @NonNull Completable | Returns: the newCompletable instanceReturns a |
| public final @NonNull Single | |
| public static < the type of that item T> @NonNull Maybe | Returns: the newMaybe instancethe item to emit item)Returns a |
| public final < the output value type R> @NonNull Maybe | Returns: the newMaybe instancethe lift)MaybeOperator that receives the downstream's MaybeObserver and should return
a MaybeObserver with custom behavior to be used as the consumer for the current
Maybe.This method requires advanced knowledge about building operators, please consider
other standard composition methods first;
Returns a |
| public final < the result value type R> @NonNull Maybe | |
| public final < the non- R> @NonNull Maybenull output type | Returns: the newMaybe instancethe function that receives the upstream success item and should return a non-empty mapper)Optional
to emit as the success output or an empty Optional to complete the MaybeMaps the upstream success value into an |
| public final @NonNull Single | Returns: the newSingle instanceMaps the signal types of this |
| public static < the common and resulting value type T> @NonNull Flowable | Returns: the newFlowable instancethe sources)Iterable sequence of MaybeSource sourcesMerges an |
| public static < the common and resulting value type T> @NonNull Flowable | Returns: the newFlowable instancethe sources)Flowable sequence of MaybeSource sourcesMerges a |
| public static < the common and resulting value type T> @NonNull Flowable | Returns: the newFlowable instancethe sources, int Flowable sequence of MaybeSource sourcesthe maximum number of concurrently running maxConcurrency)MaybeSourcesMerges a |
| public static < the value type of the sources and the output T> @NonNull Maybe | Returns: the newMaybe instancea source)MaybeSource that emits a MaybeSourceFlattens a |
| public static < the common value type T> @NonNull Flowable | Returns: the newFlowable instancea source1, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source2)MaybeSource to be mergedFlattens two |
| public static < the common value type T> @NonNull Flowable | Returns: the newFlowable instancea source1, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source2, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source3)MaybeSource to be mergedFlattens three |
| public static < the common value type T> @NonNull Flowable | Returns: the newFlowable instancea source1, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source2, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source3, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source4)MaybeSource to be mergedFlattens four |
| public static < the common and resulting value type T> @NonNull Flowable | Returns: the newFlowable instancethe array sequence of sources)MaybeSource sourcesMerges an array of |
| public static < the common element base type T> @NonNull Flowable | Returns: the newFlowable instancethe array of sources)MaybeSourcesFlattens an array of |
| public static < the common element base type T> @NonNull Flowable | Returns: the newFlowable instancethe sources)Iterable of MaybeSourcesFlattens an |
| public static < the common element base type T> @NonNull Flowable | Returns: the newFlowable instancea sources)Publisher that emits MaybeSourcesFlattens a |
| public static < the common element base type T> @NonNull Flowable | Returns: the newFlowable instancea sources, int Publisher that emits MaybeSourcesthe maximum number of active inner maxConcurrency)MaybeSources to be merged at a timeFlattens a |
| public static < the common element base type T> @NonNull Flowable | Returns: the newFlowable instancea source1, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source2)MaybeSource to be mergedFlattens two |
| public static < the common element base type T> @NonNull Flowable | Returns: the newFlowable instancea source1, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source2, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source3)MaybeSource to be mergedFlattens three |
| public static < the common element base type T> @NonNull Flowable | Returns: the newFlowable instancea source1, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source2, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source3, @NonNull MaybeSource<? extends T> MaybeSource to be mergeda source4)MaybeSource to be mergedFlattens four |
| public final @NonNull Flowable | Returns: the newFlowable instancea other)MaybeSource to be mergedFlattens this |
| public static < the type of items (not) emitted by the T> @NonNull MaybeMaybe | Returns: the sharedMaybe instanceReturns a |
| public final @NonNull Maybe | |
| public final < the output type U> @NonNull Maybe | |
| public final @NonNull Maybe | Returns: the newMaybe instanceReturns a |
| public final @NonNull Maybe | Returns: the newMaybe instancethe predicate to call when an predicate)Throwable is emitted which should return true
if the Throwable should be swallowed and replaced with an onComplete.Returns a |
| public final @NonNull Maybe | Returns: the newMaybe instancea function that returns a fallbackSupplier)MaybeSource that will take over if the current Maybe encounters
an errorResumes the flow with a |
| public final @NonNull Maybe | Returns: the newMaybe instancethe next fallback)MaybeSource that will take over if the current Maybe encounters
an errorResumes the flow with the given |
| public final @NonNull Maybe | Returns: the newMaybe instancea function that returns a single value that will be emitted as success value
the current itemSupplier)Maybe signals an onError eventEnds the flow with a success item returned by a function for the |
| public final @NonNull Maybe | Returns: the newMaybe instancethe value that is emitted as item)onSuccess in case the current Maybe signals an onErrorEnds the flow with the given success item when the current |
| public final @NonNull Maybe | Returns: the newMaybe instance
the sequence is terminated or downstream calls dispose()Nulls out references to the upstream producer and downstream |
| public final @NonNull Flowable | |
| public final @NonNull Flowable | |
| public final @NonNull Flowable | Returns: the newFlowable instancea boolean supplier that is called when the current stop)Flowable completes and unless it returns
false, the current Flowable is resubscribedReturns a |
| public final @NonNull Flowable | Returns: the newFlowable instancereceives a handler)Publisher of notifications with which a user can complete or error, aborting the repeat.Returns a |
| public final @NonNull Maybe | Returns: the newMaybe instanceReturns a |
| public final @NonNull Maybe | Returns: the newMaybe instancethe predicate that determines if a resubscription may happen in case of a specific exception
and retry count predicate)Returns a |
| public final @NonNull Maybe | Returns: the newMaybe instancethe number of times to resubscribe if the current times)Maybe failsReturns a |
| public final @NonNull Maybe | Returns: the newMaybe instancethe number of times to resubscribe if the current times, @NonNull Predicate<? super Throwable> Maybe failsthe predicate called with the failure predicate)Throwable and should return true to trigger a retry.Retries at most |
| public final @NonNull Maybe | |
| public final @NonNull Maybe | Returns: the newMaybe instancethe function that should return stop)true to stop retryingRetries until the given stop function returns |
| public final @NonNull Maybe | Returns: the newMaybe instancereceives a handler)Publisher of notifications with which a user can complete or error, aborting the
retryReturns a |
| public final void | safeSubscribe(@NonNull MaybeObserver<? super T>
the potentially misbehaving observer)MaybeObserverWraps the given |
| public static < the type of items emitted by each T> @NonNull SingleMaybeSource | Returns: the newSingle instancethe first source1, @NonNull MaybeSource<? extends T> MaybeSource to comparethe second source2)MaybeSource to compareReturns a |
| public static < the type of items emitted by each T> @NonNull SingleMaybeSource | Returns: the newSingle instancethe first source1, @NonNull MaybeSource<? extends T> MaybeSource to comparethe second source2, @NonNull BiPredicate<? super T, ? super T> MaybeSource to comparea function used to compare items emitted by each isEqual)MaybeSourceReturns a |
| public final @NonNull Flowable | Returns: the newFlowable instancethe other other)CompletableSource to run firstReturns a |
| public final @NonNull Flowable | Returns: the newFlowable instancethe other other)SingleSource to run firstReturns a |
| public final @NonNull Flowable | Returns: the newFlowable instancethe other other)MaybeSource to run firstReturns a |
| public final @NonNull Observable | Returns: the newObservable instancethe other other)ObservableSource to run firstReturns an |
| public final @NonNull Flowable | |
| public final @NonNull Disposable | Returns: the newDisposable instance that can be used for disposing the subscription at any timeSubscribes to a |
| public final @NonNull Disposable | Returns: the newDisposable instance that can be used for disposing the subscription at any timethe onSuccess)Consumer<T> you have designed to accept a success value from the MaybeSubscribes to a |
| public final @NonNull Disposable | Returns: the newDisposable instance that can be used for disposing the subscription at any timethe onSuccess, @NonNull Consumer<? super Throwable> Consumer<T> you have designed to accept a success value from the Maybethe onError)Consumer<Throwable> you have designed to accept any error notification from the
MaybeSubscribes to a |
| public final @NonNull Disposable | Returns: the newDisposable instance that can be used for disposing the subscription at any timethe onSuccess, @NonNull Consumer<? super Throwable> Consumer<T> you have designed to accept a success value from the Maybethe onError, @NonNull Action Consumer<Throwable> you have designed to accept any error notification from the
Maybethe onComplete)Action you have designed to accept a completion notification from the
MaybeSubscribes to a |
| public final @NonNull Disposable | Returns: theDisposable that allows disposing the particular subscription.the callback for upstream items onSuccess, @NonNull Consumer<? super Throwable> the callback for an upstream error onError, @NonNull Action the callback for an upstream completion without any value or error onComplete, @NonNull DisposableContainer the container)DisposableContainer (such as CompositeDisposable) to add and remove the
created Disposable MaybeObserverWraps the given onXXX callbacks into a |
| public final void | |
| protected abstract void | subscribeActual(@NonNull MaybeObserver<? super T>
the observer)MaybeObserver to handle, not nullImplement this method in subclasses to handle the incoming |
| public final @NonNull Maybe | Returns: the newMaybe instancethe scheduler)Scheduler to perform subscription actions onAsynchronously subscribes subscribers to this |
| public final < the type of the E extends MaybeObserverMaybeObserver to use and return | Returns: the inputobserverthe observer)MaybeObserver (subclass) to use and return, not nullSubscribes a given |
| public final @NonNull Maybe | Returns: the newMaybe instancethe alternate other)MaybeSource to subscribe to if the main does not emit any itemsReturns a |
| public final @NonNull Single | Returns: the newSingle instancethe alternate other)SingleSource to subscribe to if the main does not emit any itemsReturns a |
| public static < the element type of the T> @NonNull FlowableMaybeSources | Returns: the newFlowable instancethe sources)Publisher sequence of inner MaybeSources to switch betweenSwitches between |
| public static < the element type of the T> @NonNull FlowableMaybeSources | Returns: the newFlowable instancethe sources)Publisher sequence of inner MaybeSources to switch betweenSwitches between |
| public final < the type of items emitted by U> @NonNull Maybeother | Returns: the newMaybe instancethe other)MaybeSource whose first emitted item will cause takeUntil to stop emitting items
from the current MaybeReturns a |
| public final < the type of items emitted by U> @NonNull Maybeother | |
| public final @NonNull TestObserver | |
| public final @NonNull TestObserver | Returns: the newTestObserver instanceif dispose)true, the TestObserver will be disposed before subscribing to this
Maybe.Creates a |
| public final @NonNull Maybe | Returns: the newMaybe instanceMeasures the time (in milliseconds) between the subscription and success item emission
of the current |
| public final @NonNull Maybe | Returns: the newMaybe instancethe scheduler)Scheduler used for providing the current timeMeasures the time (in milliseconds) between the subscription and success item emission
of the current |
| public final @NonNull Maybe | Returns: the newMaybe instancethe time unit for measurement unit)Measures the time between the subscription and success item emission
of the current |
| public final @NonNull Maybe | Returns: the newMaybe instancethe time unit for measurement unit, @NonNull Scheduler the scheduler)Scheduler used for providing the current timeMeasures the time between the subscription and success item emission
of the current |
| public final @NonNull Maybe | |
| public final @NonNull Maybe | Returns: the newMaybe instancemaximum duration between items before a timeout occurs timeout, @NonNull TimeUnit the unit of time that applies to the unit, @NonNull MaybeSource<? extends T> timeout argumentthe fallback fallback)MaybeSource to use in case of a timeoutReturns a |
| public final @NonNull Maybe | Returns: the newMaybe instancemaximum duration between items before a timeout occurs timeout, @NonNull TimeUnit the unit of time that applies to the unit, @NonNull Scheduler timeout argumentthe scheduler, @NonNull MaybeSource<? extends T> Scheduler to run the timeout timers onthe fallback)MaybeSource to use as the fallback in case of a timeoutReturns a |
| public final @NonNull Maybe | Returns: the newMaybe instancemaximum duration between items before a timeout occurs timeout, @NonNull TimeUnit the unit of time that applies to the unit, @NonNull Scheduler timeout argumentthe scheduler)Scheduler to run the timeout timers onReturns a |
| public final < the value type of the U> @NonNull Maybe | Returns: the newMaybe instancethe timeoutIndicator)MaybeSource that indicates the timeout by signaling onSuccess
or onComplete.If the current |
| public final < the value type of the U> @NonNull Maybe | Returns: the newMaybe instancethe timeoutIndicator, @NonNull MaybeSource<? extends T> MaybeSource that indicates the timeout by signaling onSuccess
or onComplete.the fallback)MaybeSource that is subscribed to if the current Maybe times outIf the current |
| public final < the value type of the U> @NonNull Maybe | Returns: the newMaybe instancethe timeoutIndicator)Publisher that indicates the timeout by signaling onSuccess
or onComplete.If the current |
| public final < the value type of the U> @NonNull Maybe | Returns: the newMaybe instancethe timeoutIndicator, @NonNull MaybeSource<? extends T> MaybeSource that indicates the timeout by signaling onSuccess
or onCompletethe fallback)MaybeSource that is subscribed to if the current Maybe times outIf the current |
| public static @NonNull Maybe | |
| public static @NonNull Maybe | |
| public final @NonNull Maybe | |
| public final @NonNull Maybe | Returns: the newMaybe instancethe scheduler)Scheduler used for providing the current timeCombines the success value from the current |
| public final @NonNull Maybe | |
| public final @NonNull Maybe | Returns: the newMaybe instancethe time unit for measurement unit, @NonNull Scheduler the scheduler)Scheduler used for providing the current timeCombines the success value from the current |
| public final < the resulting object type R> R | Returns: the converted valuethe function that receives the current converter)Maybe instance and returns a valueCalls the specified converter function during assembly time and returns its resulting value. |
| public final @NonNull CompletionStage | Returns: the newCompletionStage instanceSignals the upstream success item (or a |
| public final @NonNull CompletionStage | Returns: the newCompletionStage instancethe item to signal if the upstream is empty defaultItem)Signals the upstream success item (or the default item if the upstream is empty) via
a |
| public final @NonNull Flowable | Returns: the newFlowable instanceConverts this |
| public final @NonNull Future | |
| public final @NonNull Observable | Returns: the newObservable instanceConverts this |
| public final @NonNull Single | Returns: the newSingle instanceConverts this |
| public static < the value type T> @NonNull Maybe | Returns: the newMaybe instancethe function that is called with the subscribing onSubscribe)MaybeObserverAdvanced use only: creates a |
| public final @NonNull Maybe | Returns: the newMaybe instancethe target scheduler where to execute the disposal scheduler)Returns a |
| public static < the element type of the generated T, MaybeSourcethe type of the resource associated with the output sequence D> @NonNull Maybe | Returns: the newMaybe instancethe factory function to create a resource object that depends on the resourceSupplier, @NonNull Function<? super D, ? extends MaybeSource<? extends T>> Maybethe factory function to create a sourceSupplier, @NonNull Consumer<? super D> MaybeSourcethe function that will dispose of the resource resourceCleanup)Constructs a |
| public static < the element type of the generated T, MaybeSourcethe type of the resource associated with the output sequence D> @NonNull Maybe | Returns: the newMaybe instancethe factory function to create a resource object that depends on the resourceSupplier, @NonNull Function<? super D, ? extends MaybeSource<? extends T>> Maybethe factory function to create a sourceSupplier, @NonNull Consumer<? super D> MaybeSourcethe function that will dispose of the resource resourceCleanup, boolean If eager)true then resource disposal will happen either on a dispose() call before the upstream is disposed
or just before the emission of a terminal event (onSuccess, onComplete or onError).
If false the resource disposal will happen either on a dispose() call after the upstream is disposed
or just after the emission of a terminal event (onSuccess, onComplete or onError).Constructs a |
| public static < the value type T> @NonNull Maybe | Returns: the new wrapped or castMaybe instancethe source to wrap source)Wraps a |
| public static < the common value type T, the zipped result type R> @NonNull Maybe | Returns: the newMaybe instancean sources, @NonNull Function<? super Object[], ? extends R> Iterable of source MaybeSourcesa function that, when applied to an item emitted by each of the source zipper)MaybeSources, results in
an item that will be emitted by the resulting MaybeReturns a |
| public static < the value type of the first source T1, the value type of the second source T2, the zipped result type R> @NonNull Maybe | Returns: the newMaybe instancethe first source source1, @NonNull MaybeSource<? extends T2> MaybeSourcea second source source2, @NonNull BiFunction<? super T1, ? super T2, ? extends R> MaybeSourcea function that, when applied to an item emitted by each of the source zipper)MaybeSources, results
in an item that will be emitted by the resulting MaybeReturns a |
| public static < the value type of the first source T1, the value type of the second source T2, the value type of the third source T3, the zipped result type R> @NonNull Maybe | Returns: the newMaybe instancethe first source source1, @NonNull MaybeSource<? extends T2> MaybeSourcea second source source2, @NonNull MaybeSource<? extends T3> MaybeSourcea third source source3, @NonNull Function3<? super T1, ? super T2, ? super T3, ? extends R> MaybeSourcea function that, when applied to an item emitted by each of the source zipper)MaybeSources, results in
an item that will be emitted by the resulting MaybeReturns a |
| public static < the value type of the first source T1, the value type of the second source T2, the value type of the third source T3, the value type of the fourth source T4, the zipped result type R> @NonNull Maybe | Returns: the newMaybe instancethe first source source1, @NonNull MaybeSource<? extends T2> MaybeSourcea second source source2, @NonNull MaybeSource<? extends T3> MaybeSourcea third source source3, @NonNull MaybeSource<? extends T4> MaybeSourcea fourth source source4, @NonNull Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> MaybeSourcea function that, when applied to an item emitted by each of the source zipper)MaybeSources, results in
an item that will be emitted by the resulting MaybeReturns a |
| public static < the value type of the first source T1, the value type of the second source T2, the value type of the third source T3, the value type of the fourth source T4, the value type of the fifth source T5, the zipped result type R> @NonNull Maybe | Returns: the newMaybe instancethe first source source1, @NonNull MaybeSource<? extends T2> MaybeSourcea second source source2, @NonNull MaybeSource<? extends T3> MaybeSourcea third source source3, @NonNull MaybeSource<? extends T4> MaybeSourcea fourth source source4, @NonNull MaybeSource<? extends T5> MaybeSourcea fifth source source5, @NonNull Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> MaybeSourcea function that, when applied to an item emitted by each of the source zipper)MaybeSources, results in
an item that will be emitted by the resulting MaybeReturns a |
| public static < the value type of the first source T1, the value type of the second source T2, the value type of the third source T3, the value type of the fourth source T4, the value type of the fifth source T5, the value type of the sixth source T6, the zipped result type R> @NonNull Maybe | Returns: the newMaybe instancethe first source source1, @NonNull MaybeSource<? extends T2> MaybeSourcea second source source2, @NonNull MaybeSource<? extends T3> MaybeSourcea third source source3, @NonNull MaybeSource<? extends T4> MaybeSourcea fourth source source4, @NonNull MaybeSource<? extends T5> MaybeSourcea fifth source source5, @NonNull MaybeSource<? extends T6> MaybeSourcea sixth source source6, @NonNull Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> MaybeSourcea function that, when applied to an item emitted by each of the source zipper)MaybeSources, results in
an item that will be emitted by the resulting MaybeReturns a |
| public static < the value type of the first source T1, the value type of the second source T2, the value type of the third source T3, the value type of the fourth source T4, the value type of the fifth source T5, the value type of the sixth source T6, the value type of the seventh source T7, the zipped result type R> @NonNull Maybe | Returns: the newMaybe instancethe first source source1, @NonNull MaybeSource<? extends T2> MaybeSourcea second source source2, @NonNull MaybeSource<? extends T3> MaybeSourcea third source source3, @NonNull MaybeSource<? extends T4> MaybeSourcea fourth source source4, @NonNull MaybeSource<? extends T5> MaybeSourcea fifth source source5, @NonNull MaybeSource<? extends T6> MaybeSourcea sixth source source6, @NonNull MaybeSource<? extends T7> MaybeSourcea seventh source source7, @NonNull Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> MaybeSourcea function that, when applied to an item emitted by each of the source zipper)MaybeSources, results in
an item that will be emitted by the resulting MaybeReturns a |
| public static < the value type of the first source T1, the value type of the second source T2, the value type of the third source T3, the value type of the fourth source T4, the value type of the fifth source T5, the value type of the sixth source T6, the value type of the seventh source T7, the value type of the eighth source T8, the zipped result type R> @NonNull Maybe | Returns: the newMaybe instancethe first source source1, @NonNull MaybeSource<? extends T2> MaybeSourcea second source source2, @NonNull MaybeSource<? extends T3> MaybeSourcea third source source3, @NonNull MaybeSource<? extends T4> MaybeSourcea fourth source source4, @NonNull MaybeSource<? extends T5> MaybeSourcea fifth source source5, @NonNull MaybeSource<? extends T6> MaybeSourcea sixth source source6, @NonNull MaybeSource<? extends T7> MaybeSourcea seventh source source7, @NonNull MaybeSource<? extends T8> MaybeSourcean eighth source source8, @NonNull Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> MaybeSourcea function that, when applied to an item emitted by each of the source zipper)MaybeSources, results in
an item that will be emitted by the resulting MaybeReturns a |
| public static < the value type of the first source T1, the value type of the second source T2, the value type of the third source T3, the value type of the fourth source T4, the value type of the fifth source T5, the value type of the sixth source T6, the value type of the seventh source T7, the value type of the eighth source T8, the value type of the ninth source T9, the zipped result type R> @NonNull Maybe | Returns: the newMaybe instancethe first source source1, @NonNull MaybeSource<? extends T2> MaybeSourcea second source source2, @NonNull MaybeSource<? extends T3> MaybeSourcea third source source3, @NonNull MaybeSource<? extends T4> MaybeSourcea fourth source source4, @NonNull MaybeSource<? extends T5> MaybeSourcea fifth source source5, @NonNull MaybeSource<? extends T6> MaybeSourcea sixth source source6, @NonNull MaybeSource<? extends T7> MaybeSourcea seventh source source7, @NonNull MaybeSource<? extends T8> MaybeSourcean eighth source source8, @NonNull MaybeSource<? extends T9> MaybeSourcea ninth source source9, @NonNull Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends R> MaybeSourcea function that, when applied to an item emitted by each of the source zipper)MaybeSources, results in
an item that will be emitted by the resulting MaybeReturns a |
| public static < the common element type T, the result type R> @NonNull Maybe | Returns: the newMaybe instancea function that, when applied to an item emitted by each of the source zipper, @NonNull MaybeSource<? extends T>... MaybeSources, results in
an item that will be emitted by the resulting Maybean array of source sources)MaybeSourcesReturns a |
| public final < the type of items emitted by the U, other MaybeSourcethe type of items emitted by the resulting R> @NonNull MaybeMaybe | Returns: the newMaybe instancethe other other, @NonNull BiFunction<? super T, ? super U, ? extends R> MaybeSourcea function that combines the pairs of items from the two zipper)MaybeSources to generate the items to
be emitted by the resulting MaybeWaits until this and the other |