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.observers.DisposableMaybeObserver
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static < the value type T> Maybe | Returns: the new Maybe instancethe Iterable sequence of sources. A subscription to each source will
occur in the same order as in the Iterable. sources)Runs multiple MaybeSources and signals the events of the first one that signals (disposing the rest). |
| public static < the value type T> Maybe | Returns: the new Maybe instancethe array of sources. A subscription to each source will
occur in the same order as in the array. sources)Runs multiple MaybeSources and signals the events of the first one that signals (disposing the rest). |
| public final Maybe | Returns: a Maybe that emits the same sequence as whichever of the source MaybeSources first signalleda MaybeSource competing to react first. A subscription to this provided source will occur after
subscribing to the current source. other)Mirrors the MaybeSource (current or provided) that first signals an event. |
| public final < the resulting object type R> R | Returns: the converted valuethe function that receives the current Maybe instance and returns a value converter)Calls the specified converter function during assembly time and returns its resulting value. |
| public final T | Returns: the success valueWaits in a blocking fashion until the current Maybe signals a success value (which is returned), null if completed or an exception (which is propagated). |
| public final T | Returns: the success valuethe default item to return if this Maybe is empty 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). |
| public final Maybe | Returns: a Maybe that, when first subscribed to, caches all of its items and notifications for the benefit of subsequent subscribersReturns a Maybe that subscribes to this Maybe lazily, caches its event and replays it, to all the downstream subscribers. |
| public final < the target type U> Maybe | |
| public final < the value type of the Maybe returned by the transformer function R> Maybe | Returns: a Maybe, transformed by the transformer functionthe transformer function, not null transformer)Transform a Maybe by applying a particular Transformer function to it. |
| public static < the value type T> Flowable | Returns: the new Flowable instancethe Iterable sequence of MaybeSource instances sources)Concatenate the single values, in a non-overlapping fashion, of the MaybeSource sources provided by an Iterable sequence. |
| public static < the common value type T> Flowable | Returns: a Flowable that emits items emitted by the two source MaybeSources, one after the other.a MaybeSource to be concatenated source1, MaybeSource<? extends T> a MaybeSource to be concatenated source2)Returns a Flowable that emits the items emitted by two MaybeSources, one after the other. |
| public static < the common value type T> Flowable | Returns: a Flowable that emits items emitted by the three source MaybeSources, one after the other.a MaybeSource to be concatenated source1, MaybeSource<? extends T> a MaybeSource to be concatenated source2, MaybeSource<? extends T> a MaybeSource to be concatenated source3)Returns a Flowable that emits the items emitted by three MaybeSources, one after the other. |
| public static < the common value type T> Flowable | Returns: a Flowable that emits items emitted by the four source MaybeSources, one after the other.a MaybeSource to be concatenated source1, MaybeSource<? extends T> a MaybeSource to be concatenated source2, MaybeSource<? extends T> a MaybeSource to be concatenated source3, MaybeSource<? extends T> a MaybeSource to be concatenated source4)Returns a Flowable that emits the items emitted by four MaybeSources, one after the other. |
| public static < the value type T> Flowable | Returns: the new Flowable instancethe Publisher of MaybeSource instances sources)Concatenate the single values, in a non-overlapping fashion, of the MaybeSource sources provided by a Publisher sequence. |
| public static < the value type T> Flowable | Returns: the new Flowable instancethe Publisher of MaybeSource instances sources, int the number of MaybeSources to prefetch from the Publisher prefetch)Concatenate the single values, in a non-overlapping fashion, of the MaybeSource sources provided by a Publisher sequence. |
| public static < the value type T> Flowable | Returns: the new Flowable instancethe array of MaybeSource instances sources)Concatenate the single values, in a non-overlapping fashion, of the MaybeSource sources in the array. |
| public static < the common base value type T> Flowable | Returns: the new Flowable instancethe array of sources sources)Concatenates a variable number of MaybeSource sources and delays errors from any of them till all terminate. |
| public static < the value type T> Flowable | Returns: the new Flowable instance with the specified concatenation behaviora sequence of MaybeSources that need to be eagerly concatenated sources)Concatenates a sequence of MaybeSource eagerly into a single stream of values. |
| public static < the common element base type T> Flowable | Returns: the new Flowable with the concatenating behaviorthe Iterable sequence of MaybeSources 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. |
| public static < the common element base type T> Flowable | Returns: the new Publisher with the concatenating behaviorthe Publisher sequence of Publishers 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. |
| public static < the value type T> Flowable | Returns: the new Flowable instance with the specified concatenation behaviora sequence of MaybeSource that need to be eagerly concatenated sources)Concatenates a sequence of MaybeSources eagerly into a single stream of values. |
| public static < the value type T> Flowable | Returns: the new Publisher instance with the specified concatenation behaviora sequence of Publishers that need to be eagerly concatenated sources)Concatenates a Publisher sequence of MaybeSources eagerly into a single stream of values. |
| public final < the result value type R> Maybe | Returns: the Maybe returned fromfunc when applied to the item emitted by the source Maybea function that, when applied to the item emitted by the source Maybe, returns a MaybeSource 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. |
| public final Flowable | Returns: a Flowable that emits items emitted by the two source MaybeSources, one after the other, without interleaving thema MaybeSource to be concatenated after the current other)Returns a Flowable that emits the items emitted from the current MaybeSource, then the next, one after the other, without interleaving them. |
| public final Single | Returns: a Single that emitstrue if the specified item is emitted by the source Maybe,
or false if the source Maybe completes without emitting that itemthe item to search for in the emissions from the source Maybe, not null item)Returns a Single that emits a Boolean that indicates whether the source Maybe emitted a specified item. |
| public final Single | Returns: a Single that emits a single item: the number of items emitted by the source Maybe as a 64-bit Long itemReturns 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. |
| public static < the value type T> Maybe | Returns: the new Maybe instancethe emitter that is called when a MaybeObserver subscribes to the returned onSubscribe)MaybeProvides an API (via a cold Maybe) that bridges the reactive world with the callback-style world. |
| public final Maybe | Returns: a Maybe that emits either the specified default item if the source Maybe emits no items, or the items emitted by the source Maybethe item to emit if the source Maybe emits no items defaultItem)Returns a Maybe that emits the item emitted by the source Maybe or a specified default item if the source Maybe is empty. |
| public static < the value type T> Maybe | Returns: the new Maybe instancethe Callable that is called for each individual MaybeObserver and
returns a MaybeSource instance to subscribe to maybeSupplier)Calls a Callable for each individual MaybeObserver to return the actual MaybeSource source to be subscribed to. |
| public final Maybe | |
| public final Maybe | Returns: the new Maybe instancethe delay to shift the source by delay, TimeUnit the time unit of unit, Scheduler delaythe scheduler)Scheduler to use for delayingReturns a Maybe that signals the events emitted by the source Maybe shifted forward in time by a specified delay running on the specified Scheduler. |
| public final < the subscription delay value type (ignored) U, the item delay value type (ignored) V> Maybe | |
| public final < the value type of the other Publisher, irrelevant U> Maybe | Returns: a Maybe that delays the subscription to this Maybe until the other Publisher emits an element or completes normally.the other Publisher that should trigger the subscription
to this Publisher. subscriptionIndicator)Returns a Maybe that delays the subscription to this Maybe until the other Publisher emits an element or completes normally. |
| public final Maybe | Returns: a Maybe that delays the subscription to the source Maybe by the given amountthe time to delay the subscription delay, TimeUnit the time unit of unit)delayReturns a Maybe that delays the subscription to the source Maybe by a given amount of time. |
| public final Maybe | Returns: a Maybe that delays the subscription to the source Maybe by a given amount, waiting and subscribing on the given Schedulerthe time to delay the subscription delay, TimeUnit the time unit of unit, Scheduler delaythe Scheduler on which the waiting and subscription will happen 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. |
| public final Maybe | Returns: the new Maybe instancethe Consumer that will be called after emitting an item from upstream to the downstream onAfterSuccess)Calls the specified consumer with the success item after this item has been emitted to the downstream. |
| public final Maybe | Returns: a Maybe that emits the same items as the source Maybe, then invokes theActionan onAfterTerminate)Action to be invoked when the source Maybe finishesRegisters an |
| public final Maybe | |
| public final Maybe | Returns: the new Maybe with the side-effecting behavior appliedthe action to invoke when the source Maybe calls onComplete)onCompleteModifies the source Maybe so that it invokes an action when it calls |
| public final Maybe | Returns: the new Maybe instancethe action called when the subscription is disposed onDispose)Calls the shared |
| public final Maybe | |
| public final Maybe | Returns: the new Maybe instancethe callback to call with the terminal event tuple 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. |
| public final Maybe | Returns: the new Maybe instancethe consumer called with the Disposable sent via onSubscribe onSubscribe)Calls the shared consumer with the Disposable sent through the onSubscribe for each MaybeObserver that subscribes to the current Maybe. |
| public final Maybe | Returns: the new Maybe instancethe consumer called with the success value of onSuccess onSuccess)Calls the shared consumer with the success value sent via onSuccess for each MaybeObserver that subscribes to the current Maybe. |
| public final Maybe | Returns: the new Maybe instancethe action to invoke when the consumer calls onTerminate)onComplete or onErrorReturns a Maybe instance that calls the given onTerminate callback just before this Maybe completes normally or with an exception. |
| public static < the value type T> Maybe | Returns: the new Maybe instanceReturns a (singleton) Maybe instance that calls |
| public static < the type of the item (ostensibly) emitted by the Maybe T> Maybe | |
| public static < the type of the items (ostensibly) emitted by the Maybe T> Maybe | Returns: a Maybe that invokes theMaybeObserver's onError method when
the MaybeObserver subscribes to ita Callable factory to return a Throwable for each individual MaybeObserver supplier)Returns a Maybe that invokes a |
| public final Maybe | Returns: a Maybe that emit the item emitted by the source Maybe that the filter evaluates astruea function that evaluates the item emitted by the source Maybe, returning predicate)true
if it passes the filterFilters the success item of the Maybe via a predicate function and emitting it if the predicate returns true, completing otherwise. |
| public final < the result value type R> Maybe | Returns: the Maybe returned fromfunc when applied to the item emitted by the source Maybea function that, when applied to the item emitted by the source Maybe, returns a MaybeSource 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. |
| public final < the result type R> Maybe | Returns: the new Maybe instancea function that returns a MaybeSource to merge for the onSuccess item emitted by this Maybe onSuccessMapper, Function<? super Throwable, ? extends MaybeSource<? extends R>> a function that returns a MaybeSource to merge for an onError notification from this Maybe onErrorMapper, Callable<? extends MaybeSource<? extends R>> a function that returns a MaybeSource to merge for an onComplete notification this Maybe onCompleteSupplier)Maps the onSuccess, onError or onComplete signals of this Maybe into MaybeSource and emits that MaybeSource's signals. |
| public final < the type of items emitted by the MaybeSource returned by the U, mapper functionthe type of items emitted by the resulting Maybe R> Maybe | Returns: the new Maybe instancea function that returns a MaybeSource for the item emitted by the source Maybe mapper, BiFunction<? super T, ? super U, ? extends R> 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 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. |
| public final Completable | Returns: the Completable returned frommapper when applied to the item emitted by the source Maybea function that, when applied to the item emitted by the source Maybe, returns a
Completable mapper)Returns a |
| public final < the result value type R> Observable | Returns: the Observable returned fromfunc when applied to the item emitted by the source Maybea function that, when applied to the item emitted by the source Maybe, returns an ObservableSource 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. |
| public final < the result value type R> Flowable | Returns: the Flowable returned fromfunc when applied to the item emitted by the source Maybea function that, when applied to the item emitted by the source Maybe, returns a
Flowable 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. |
| public final < the result value type R> Single | Returns: the Single returned frommapper when applied to the item emitted by the source Maybea function that, when applied to the item emitted by the source Maybe, returns a
Single mapper)Returns a |
| public final < the result value type R> Maybe | Returns: the new Maybe instancea function that, when applied to the item emitted by the source Maybe, returns a
Single mapper)Returns a |
| public final < the type of item emitted by the resulting Iterable U> Flowable | Returns: the new Flowable instancea function that returns an Iterable sequence of values for when given an item emitted by the
source Maybe mapper)Maps the success value of the upstream |
| public final < the type of item emitted by the resulting Iterable U> Observable | Returns: the new Observable instancea function that returns an Iterable sequence of values for when given an item emitted by the
source Maybe mapper)Maps the success value of the upstream |
| public static < the target type T> Maybe | Returns: the new Maybe instancethe runnable to run for each subscriber run)Returns a Maybe instance that runs the given Action for each subscriber and emits either its exception or simply completes. |
| public static < the type of the item emitted by the T> MaybeMaybe. | Returns: a new Maybe instanceReturns a |
| public static < the target type T> Maybe | Returns: the new Maybe instancethe CompletableSource to convert from completableSource)Wraps a CompletableSource into a Maybe. |
| public static < the type of object that the T> MaybeFuture returns, and also the type of item to be emitted by
the resulting Maybe | Returns: a Maybe that emits the item from the sourceFuturethe source future)FutureConverts a |
| public static < the type of object that the T> MaybeFuture returns, and also the type of item to be emitted by
the resulting Maybe | |
| public static < the target type T> Maybe | Returns: the new Maybe instancethe runnable to run for each subscriber run)Returns a Maybe instance that runs the given Action for each subscriber and emits either its exception or simply completes. |
| public static < the target type T> Maybe | Returns: the new Maybe instancethe SingleSource to convert from singleSource)Wraps a SingleSource into a Maybe. |
| public final Maybe | |
| public final Completable | Returns: an empty Completable that only callsonComplete or onError, based on which one is
called by the source MaybeIgnores the item emitted by the source Maybe and only calls |
| public final Single | Returns: a Single that emits a BooleanReturns a Single that emits |
| public static < the type of that item T> Maybe | Returns: aMaybe that emits itemthe item to emit item)Returns a |
| public final < the output value type R> Maybe | Returns: the new Maybe 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> Maybe | Returns: a Maybe that emits the item from the source Maybe, transformed by the specified functiona function to apply to the item emitted by the Maybe 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. |
| public final Single | Returns: the new Single instanceMaps the signal types of this Maybe into a |
| public static < the common and resulting value type T> Flowable | Returns: the new Flowable instancethe Iterable sequence of MaybeSource sources sources)Merges an Iterable sequence of MaybeSource instances into a single Flowable sequence, running all MaybeSources at once. |
| public static < the common and resulting value type T> Flowable | Returns: the new Flowable instancethe Flowable sequence of MaybeSource sources sources)Merges a Flowable sequence of MaybeSource instances into a single Flowable sequence, running all MaybeSources at once. |
| public static < the common and resulting value type T> Flowable | Returns: the new Flowable instancethe Flowable sequence of MaybeSource sources sources, int the maximum number of concurrently running MaybeSources maxConcurrency)Merges a Flowable sequence of MaybeSource instances into a single Flowable sequence, running at most maxConcurrency MaybeSources at once. |
| public static < the value type of the sources and the output T> Maybe | Returns: aMaybe that emits the item that is the result of flattening the MaybeSource emitted
by sourcea source)MaybeSource that emits a MaybeSourceFlattens a |
| public static < the common value type T> Flowable | Returns: a Flowable that emits all of the items emitted by the source MaybeSourcesa MaybeSource to be merged source1, MaybeSource<? extends T> a MaybeSource to be merged source2)Flattens two MaybeSources into a single Flowable, without any transformation. |
| public static < the common value type T> Flowable | Returns: a Flowable that emits all of the items emitted by the source MaybeSourcesa MaybeSource to be merged source1, MaybeSource<? extends T> a MaybeSource to be merged source2, MaybeSource<? extends T> a MaybeSource to be merged source3)Flattens three MaybeSources into a single Flowable, without any transformation. |
| public static < the common value type T> Flowable | Returns: a Flowable that emits all of the items emitted by the source MaybeSourcesa MaybeSource to be merged source1, MaybeSource<? extends T> a MaybeSource to be merged source2, MaybeSource<? extends T> a MaybeSource to be merged source3, MaybeSource<? extends T> a MaybeSource to be merged source4)Flattens four MaybeSources into a single Flowable, without any transformation. |
| public static < the common and resulting value type T> Flowable | Returns: the new Flowable instancethe array sequence of MaybeSource sources sources)Merges an array sequence of MaybeSource instances into a single Flowable sequence, running all MaybeSources at once. |
| public static < the common element base type T> Flowable | Returns: a Flowable that emits items that are the result of flattening the items emitted by the MaybeSources in the Iterablethe Iterable of MaybeSources 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. |
| public static < the common element base type T> Flowable | Returns: a Flowable that emits items that are the result of flattening the items emitted by the MaybeSources in the Iterablethe Iterable of MaybeSources 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. |
| public static < the common element base type T> Flowable | Returns: a Flowable that emits all of the items emitted by the Publishers emitted by thesource Publishera Publisher that emits MaybeSources 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. |
| public static < the common element base type T> Flowable | Returns: a Flowable that emits all of the items emitted by the Publishers emitted by thesource Publishera Publisher that emits MaybeSources sources, int the maximum number of active inner MaybeSources to be merged at a time 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. |
| public static < the common element base type T> Flowable | Returns: a Flowable that emits all of the items that are emitted by the two source MaybeSourcesa MaybeSource to be merged source1, MaybeSource<? extends T> a MaybeSource to be merged 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. |
| public static < the common element base type T> Flowable | Returns: a Flowable that emits all of the items that are emitted by the source MaybeSourcesa MaybeSource to be merged source1, MaybeSource<? extends T> a MaybeSource to be merged source2, MaybeSource<? extends T> a MaybeSource to be merged 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. |
| public static < the common element base type T> Flowable | Returns: a Flowable that emits all of the items that are emitted by the source MaybeSourcesa MaybeSource to be merged source1, MaybeSource<? extends T> a MaybeSource to be merged source2, MaybeSource<? extends T> a MaybeSource to be merged source3, MaybeSource<? extends T> a MaybeSource to be merged 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. |
| public final Flowable | Returns: a new Flowable instancea MaybeSource to be merged other)Flattens this and another Maybe into a single Flowable, without any transformation. |
| public static < the type of items (not) emitted by the Maybe T> Maybe | Returns: a Maybe that never emits any items or sends any notifications to aMaybeObserverReturns a Maybe that never sends any items or notifications to a |
| public final Maybe | |
| public final < the output type U> Maybe | |
| public final Maybe | Returns: the new Maybe instanceReturns a Maybe instance that if this Maybe emits an error, it will emit an onComplete and swallow the throwable. |
| public final Maybe | Returns: the new Maybe instancethe predicate to call when an Throwable is emitted which should return true
if the Throwable should be swallowed and replaced with an onComplete. 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. |
| public final Maybe | Returns: the new Maybe instancethe next next)MaybeSource that will take over if the source Maybe encounters
an errorInstructs a Maybe to pass control to another |
| public final Maybe | Returns: the new Maybe instancea function that returns a MaybeSource that will take over if the source Maybe encounters
an error resumeFunction)Instructs a Maybe to pass control to another Maybe rather than invoking
|
| public final Maybe | Returns: the new Maybe instancea function that returns a single value that will be emitted as success value
the current Maybe signals an onError event valueSupplier)Instructs a Maybe to emit an item (returned by a specified function) rather than invoking
|
| public final Maybe | Returns: the new Maybe instancethe value that is emitted as onSuccess in case this Maybe signals an onError item)Instructs a Maybe to emit an item (returned by a specified function) rather than invoking
|
| public final Maybe | Returns: the new Maybe instancethe next MaybeSource that will take over if the source Maybe encounters
an exception next)Instructs a Maybe to pass control to another MaybeSource rather than invoking
|
| public final Maybe | Returns: a Maybe which nulls out references to the upstream producer and downstream MaybeObserver if the sequence is terminated or downstream calls dispose()Nulls out references to the upstream producer and downstream MaybeObserver if the sequence is terminated or downstream calls dispose(). |
| public final Flowable | Returns: a Flowable that emits the items emitted by the source Maybe repeatedly and in sequenceReturns a Flowable that repeats the sequence of items emitted by the source Maybe indefinitely. |
| public final Flowable | Returns: a Flowable that repeats the sequence of items emitted by the source Maybe at mostcount timesthe number of times the source Maybe items are repeated, a count of 0 will yield an empty
sequence times)Returns a Flowable that repeats the sequence of items emitted by the source Maybe at most
|
| public final Flowable | Returns: the new Flowable instancea boolean supplier that is called when the current Flowable completes and unless it returns
false, the current Flowable is resubscribed stop)Returns a Flowable that repeats the sequence of items emitted by the source Maybe until the provided stop function returns true. |
| public final Flowable | Returns: the source Publisher modified with repeat logicreceives a Publisher of notifications with which a user can complete or error, aborting the repeat. handler)Returns a Flowable that emits the same values as the source Publisher with the exception of an
|
| public final Maybe | Returns: the new Maybe instanceReturns a Maybe that mirrors the source Maybe, resubscribing to it if it calls |
| public final Maybe | Returns: the new Maybe instancethe predicate that determines if a resubscription may happen in case of a specific exception
and retry count predicate)Returns a Maybe that mirrors the source Maybe, resubscribing to it if it calls |
| public final Maybe | Returns: the new Maybe instancethe number of times to resubscribe if the current Maybe fails count)Returns a Maybe that mirrors the source Maybe, resubscribing to it if it calls |
| public final Maybe | Returns: the new Maybe instancethe number of times to resubscribe if the current Maybe fails times, Predicate<? super Throwable> the predicate called with the failure Throwable and should return true to trigger a retry. predicate)Retries at most times or until the predicate returns false, whichever happens first. |
| public final Maybe | |
| public final Maybe | Returns: the new Maybe instancethe function that should return true to stop retrying stop)Retries until the given stop function returns true. |
| public final Maybe | Returns: the new Maybe instancereceives a Publisher of notifications with which a user can complete or error, aborting the
retry handler)Returns a Maybe that emits the same values as the source Maybe with the exception of an
|
| public static < the type of items emitted by each MaybeSource T> Single | Returns: a Single that emits a Boolean value that indicates whether the two sequences are the samethe first MaybeSource to compare source1, MaybeSource<? extends T> the second MaybeSource to compare 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. |
| public static < the type of items emitted by each MaybeSource T> Single | Returns: a Single that emits a Boolean value that indicates whether the two MaybeSource sequences are the same according to the specified functionthe first MaybeSource to compare source1, MaybeSource<? extends T> the second MaybeSource to compare source2, BiPredicate<? super T, ? super T> a function used to compare items emitted by each MaybeSource 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. |
| public final Disposable | Returns: aDisposable reference with which the caller can stop receiving items before
the Maybe has finished sending themSubscribes to a Maybe and ignores |
| public final Disposable | Returns: aDisposable reference with which the caller can stop receiving items before
the Maybe has finished sending themthe onSuccess)Consumer<T> you have designed to accept a success value from the MaybeSubscribes to a Maybe and provides a callback to handle the items it emits. |
| public final Disposable | Returns: aDisposable reference with which the caller can stop receiving items before
the Maybe has finished sending themthe onSuccess, 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 Maybe and provides callbacks to handle the items it emits and any error notification it issues. |
| public final Disposable | Returns: aDisposable reference with which the caller can stop receiving items before
the Maybe has finished sending themthe onSuccess, Consumer<? super Throwable> Consumer<T> you have designed to accept a success value from the Maybethe onError, 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 Maybe and provides callbacks to handle the items it emits and any error or completion notification it issues. |
| public final void | subscribe(MaybeObserver<? super T>
the MaybeObserver, not null observer)Implements io. |
| protected abstract void | subscribeActual(MaybeObserver<? super T>
the MaybeObserver to handle, not null observer)Implement this method in subclasses to handle the incoming |
| public final Maybe | Returns: the new Maybe instance that its subscriptions happen on the specifiedSchedulerthe scheduler)Scheduler to perform subscription actions onAsynchronously subscribes subscribers to this Maybe on the specified |
| public final < the type of the MaybeObserver to use and return E extends MaybeObserver | Returns: the inputsubscriberthe MaybeObserver (subclass) to use and return, not null observer)Subscribes a given MaybeObserver (subclass) to this Maybe and returns the given MaybeObserver as is. |
| public final Maybe | Returns: a Maybe that emits the items emitted by the source Maybe or the items of an alternate MaybeSource if the source Maybe is empty.the alternate MaybeSource to subscribe to if the main does not emit any items 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. |
| public final Single | Returns: a Single that emits the items emitted by the source Maybe or the item of an alternate SingleSource if the source Maybe is empty.the alternate SingleSource to subscribe to if the main does not emit any items 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. |
| public final < the type of items emitted by U> Maybeother | Returns: a Maybe that emits the items emitted by the source Maybe until such time asother emits its first itemthe MaybeSource whose first emitted item will cause other)takeUntil to stop emitting items
from the source MaybeReturns a Maybe that emits the items emitted by the source Maybe until a second MaybeSource emits an item. |
| public final < the type of items emitted by U> Maybeother | Returns: a Maybe that emits the items emitted by the source Maybe until such time asother emits its first itemthe Publisher whose first emitted item will cause other)takeUntil to stop emitting items
from the source PublisherReturns a Maybe that emits the item emitted by the source Maybe until a second Publisher emits an item. |
| public final TestObserver | |
| public final TestObserver | Returns: the new TestObserver instanceif true, the TestObserver will be cancelled before subscribing to this
Maybe. cancelled)Creates a TestObserver optionally in cancelled state, then subscribes it to this Maybe. |
| public final Maybe | |
| public final Maybe | Returns: the new Maybe instancemaximum duration between items before a timeout occurs timeout, TimeUnit the unit of time that applies to the timeUnit, MaybeSource<? extends T> timeout argumentthe fallback MaybeSource to use in case of a timeout fallback)Returns a Maybe that mirrors the source Maybe but applies a timeout policy for each emitted item. |
| public final Maybe | Returns: the new Maybe instancemaximum duration between items before a timeout occurs timeout, TimeUnit the unit of time that applies to the timeUnit, Scheduler timeout argumentthe scheduler, MaybeSource<? extends T> Scheduler to run the timeout timers onthe MaybeSource to use as the fallback in case of a timeout fallback)Returns a Maybe that mirrors the source Maybe but applies a timeout policy for each emitted item using a specified Scheduler. |
| public final Maybe | Returns: the new Maybe instancemaximum duration between items before a timeout occurs timeout, TimeUnit the unit of time that applies to the timeUnit, Scheduler timeout argumentthe Scheduler to run the timeout timers on 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. |
| public final < the value type of the U> Maybe | Returns: the new Maybe instancethe timeoutIndicator)MaybeSource that indicates the timeout by signaling onSuccess
or onComplete.If the current |
| public final < the value type of the U> Maybe | Returns: the new Maybe instancethe timeoutIndicator, 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> Maybe | Returns: the new Maybe instancethe timeoutIndicator)MaybeSource that indicates the timeout by signaling onSuccess
or onComplete.If the current |
| public final < the value type of the U> Maybe | Returns: the new Maybe instancethe timeoutIndicator, 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 Maybe | |
| public static Maybe | Returns: a Maybe that emits0L after a specified delay, on a specified Schedulerthe initial delay before emitting a single 0L delay, TimeUnit time units to use for unit, Scheduler delaythe scheduler)Scheduler to use for scheduling the itemReturns a Maybe that emits |
| public final < the result type R> R | Returns: the value returned by the convert functionthe function that is called with the current Maybe instance during
assembly time that should return some value to be the result convert)Calls the specified converter function with the current Maybe instance during assembly time and returns its result. |
| public final Flowable | Returns: the new Flowable instanceConverts this Maybe into a backpressure-aware Flowable instance composing cancellation through. |
| public final Observable | Returns: the new Observable instanceConverts this Maybe into an Observable instance composing disposal through. |
| public final Single | Returns: the new Single instancethe default item to signal in Single if this Maybe is empty 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. |
| public final Single | Returns: the new Single instanceConverts this Maybe into a Single instance composing disposal through and turning an empty Maybe into a signal of NoSuchElementException. |
| public static < the value type T> Maybe | Returns: the new Maybe instancethe function that is called with the subscribing MaybeObserver onSubscribe)Advanced use only: creates a Maybe instance without any safeguards by using a callback that is called with a MaybeObserver. |
| public final Maybe | Returns: the new Maybe instancethe target scheduler where to execute the disposal scheduler)Returns a Maybe which makes sure when a MaybeObserver disposes the Disposable, that call is propagated up on the specified scheduler. |
| public static < the element type of the generated MaybeSource T, the type of the resource associated with the output sequence D> Maybe | Returns: the Maybe whose lifetime controls the lifetime of the dependent resource objectthe factory function to create a resource object that depends on the Maybe resourceSupplier, Function<? super D, ? extends MaybeSource<? extends T>> the factory function to create a MaybeSource sourceSupplier, Consumer<? super D> the function that will dispose of the resource resourceDisposer)Constructs a Maybe that creates a dependent resource object which is disposed of when the upstream terminates or the downstream calls dispose(). |
| public static < the element type of the generated MaybeSource T, the type of the resource associated with the output sequence D> Maybe | Returns: the Maybe whose lifetime controls the lifetime of the dependent resource objectthe factory function to create a resource object that depends on the Maybe resourceSupplier, Function<? super D, ? extends MaybeSource<? extends T>> the factory function to create a MaybeSource sourceSupplier, Consumer<? super D> the function that will dispose of the resource resourceDisposer, boolean if eager)true then disposal will happen either on a dispose() call or just before emission of
a terminal event (onComplete or onError).Constructs a Maybe that creates a dependent resource object which is disposed of just before
termination if you have set |
| public static < the value type T> Maybe | Returns: the Maybe wrapper or the source cast to Maybe (if possible)the source to wrap source)Wraps a MaybeSource instance into a new Maybe instance if not already a Maybe instance. |
| public static < the common value type T, the zipped result type R> Maybe | Returns: a Maybe that emits the zipped resultsan Iterable of source MaybeSources sources, Function<? super Object[], ? extends R> 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 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. |
| public static < the value type of the first source T1, the value type of the second source T2, the zipped result type R> Maybe | Returns: a Maybe that emits the zipped resultsthe first source MaybeSource source1, MaybeSource<? extends T2> a second source MaybeSource source2, BiFunction<? super T1, ? super T2, ? extends R> 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 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. |
| 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> Maybe | Returns: a Maybe that emits the zipped resultsthe first source MaybeSource source1, MaybeSource<? extends T2> a second source MaybeSource source2, MaybeSource<? extends T3> a third source MaybeSource source3, Function3<? super T1, ? super T2, ? super T3, ? extends R> 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 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. |
| 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> Maybe | Returns: a Maybe that emits the zipped resultsthe first source MaybeSource source1, MaybeSource<? extends T2> a second source MaybeSource source2, MaybeSource<? extends T3> a third source MaybeSource source3, MaybeSource<? extends T4> a fourth source MaybeSource source4, Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> 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 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. |
| 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> Maybe | Returns: a Maybe that emits the zipped resultsthe first source MaybeSource source1, MaybeSource<? extends T2> a second source MaybeSource source2, MaybeSource<? extends T3> a third source MaybeSource source3, MaybeSource<? extends T4> a fourth source MaybeSource source4, MaybeSource<? extends T5> a fifth source MaybeSource source5, Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> 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 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. |
| 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> Maybe | Returns: a Maybe that emits the zipped resultsthe first source MaybeSource source1, MaybeSource<? extends T2> a second source MaybeSource source2, MaybeSource<? extends T3> a third source MaybeSource source3, MaybeSource<? extends T4> a fourth source MaybeSource source4, MaybeSource<? extends T5> a fifth source MaybeSource source5, MaybeSource<? extends T6> a sixth source MaybeSource source6, Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> 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 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. |
| 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> Maybe | Returns: a Maybe that emits the zipped resultsthe first source MaybeSource source1, MaybeSource<? extends T2> a second source MaybeSource source2, MaybeSource<? extends T3> a third source MaybeSource source3, MaybeSource<? extends T4> a fourth source MaybeSource source4, MaybeSource<? extends T5> a fifth source MaybeSource source5, MaybeSource<? extends T6> a sixth source MaybeSource source6, MaybeSource<? extends T7> a seventh source MaybeSource source7, Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> 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 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. |
| 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> Maybe | Returns: a Maybe that emits the zipped resultsthe first source MaybeSource source1, MaybeSource<? extends T2> a second source MaybeSource source2, MaybeSource<? extends T3> a third source MaybeSource source3, MaybeSource<? extends T4> a fourth source MaybeSource source4, MaybeSource<? extends T5> a fifth source MaybeSource source5, MaybeSource<? extends T6> a sixth source MaybeSource source6, MaybeSource<? extends T7> a seventh source MaybeSource source7, MaybeSource<? extends T8> an eighth source MaybeSource source8, Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> 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 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. |
| 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> Maybe | Returns: a Maybe that emits the zipped resultsthe first source MaybeSource source1, MaybeSource<? extends T2> a second source MaybeSource source2, MaybeSource<? extends T3> a third source MaybeSource source3, MaybeSource<? extends T4> a fourth source MaybeSource source4, MaybeSource<? extends T5> a fifth source MaybeSource source5, MaybeSource<? extends T6> a sixth source MaybeSource source6, MaybeSource<? extends T7> a seventh source MaybeSource source7, MaybeSource<? extends T8> an eighth source MaybeSource source8, MaybeSource<? extends T9> a ninth source MaybeSource source9, Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends R> 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 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. |
| public static < the common element type T, the result type R> Maybe | Returns: a Maybe that emits the zipped resultsa 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 zipper, MaybeSource<? extends T>... an array of source MaybeSources 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. |
| public final < the type of items emitted by the U, other MaybeSourcethe type of items emitted by the resulting Maybe R> Maybe | Returns: the new Maybe instancethe other MaybeSource other, BiFunction<? super T, ? super U, ? extends R> a function that combines the pairs of items from the two MaybeSources to generate the items to
be emitted by the resulting Maybe 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. |