diff --git a/src/main/java/io/reactivex/rxjava3/core/Maybe.java b/src/main/java/io/reactivex/rxjava3/core/Maybe.java index f8cbdcdbe7..b376890db0 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Maybe.java +++ b/src/main/java/io/reactivex/rxjava3/core/Maybe.java @@ -2602,7 +2602,7 @@ public static Maybe zipArray(@NonNull Function - * + * *
*
Scheduler:
*
{@code ambWith} does not operate by default on a particular {@link Scheduler}.
@@ -2626,6 +2626,8 @@ public final Maybe ambWith(@NonNull MaybeSource other) { /** * Waits in a blocking fashion until the current {@code Maybe} signals a success value (which is returned), * {@code null} if completed or an exception (which is propagated). + *

+ * *

*
Scheduler:
*
{@code blockingGet} does not operate by default on a particular {@link Scheduler}.
@@ -2648,6 +2650,8 @@ public final T blockingGet() { /** * Waits in a blocking fashion until the current {@code Maybe} signals a success value (which is returned), * defaultValue if completed or an exception (which is propagated). + *

+ * *

*
Scheduler:
*
{@code blockingGet} does not operate by default on a particular {@link Scheduler}.
@@ -2803,7 +2807,7 @@ public final void blockingSubscribe(@NonNull MaybeObserver observer) * Returns a {@code Maybe} that subscribes to this {@code Maybe} lazily, caches its event * and replays it, to all the downstream subscribers. *

- * + * *

* The operator subscribes only when the first downstream subscriber subscribes and maintains * a single subscription towards this {@code Maybe}. @@ -2849,6 +2853,8 @@ public final Maybe cast(@NonNull Class clazz) { /** * Transform a {@code Maybe} by applying a particular {@link MaybeTransformer} function to it. *

+ * + *

* This method operates on the {@code Maybe} itself whereas {@link #lift} operates on the {@code Maybe}'s {@link MaybeObserver}s. *

* If the operator you are creating is designed to act on the individual item emitted by a {@code Maybe}, use @@ -2958,7 +2964,7 @@ public final Maybe concatMapSingle(@NonNull Function - * + * *

*
Backpressure:
*
The operator honors backpressure from downstream.
@@ -3009,7 +3015,7 @@ public final Single contains(@NonNull Object item) { * Returns a {@link Single} that counts the total number of items emitted (0 or 1) by the current {@code Maybe} and emits * this count as a 64-bit {@link Long}. *

- * + * *

*
Scheduler:
*
{@code count} does not operate by default on a particular {@link Scheduler}.
@@ -3029,7 +3035,7 @@ public final Single count() { * Returns a {@link Single} that emits the item emitted by the current {@code Maybe} or a specified default item * if the current {@code Maybe} is empty. *

- * + * *

*
Scheduler:
*
{@code defaultIfEmpty} does not operate by default on a particular {@link Scheduler}.
@@ -3095,7 +3101,7 @@ public final Single defaultIfEmpty(@NonNull T defaultItem) { * specified delay. * An error signal will not be delayed. *

- * + * *

*
Scheduler:
*
This version of {@code delay} operates by default on the {@code computation} {@link Scheduler}.
@@ -3121,7 +3127,7 @@ public final Maybe delay(long time, @NonNull TimeUnit unit) { * Returns a {@code Maybe} that signals the events emitted by the current {@code Maybe} shifted forward in time by a * specified delay. *

- * + * *

*
Scheduler:
*
This version of {@code delay} operates by default on the {@code computation} {@link Scheduler}.
@@ -3148,7 +3154,7 @@ public final Maybe delay(long time, @NonNull TimeUnit unit, boolean delayErro * specified delay. * An error signal will not be delayed. *

- * + * *

*
Scheduler:
*
you specify the {@link Scheduler} where the non-blocking wait and emission happens
@@ -3173,7 +3179,7 @@ public final Maybe delay(long time, @NonNull TimeUnit unit, @NonNull Schedule * Returns a {@code Maybe} that signals the events emitted by the current {@code Maybe} shifted forward in time by a * specified delay running on the specified {@link Scheduler}. *

- * + * *

*
Scheduler:
*
you specify which {@code Scheduler} this operator will use.
@@ -3203,7 +3209,7 @@ public final Maybe delay(long time, @NonNull TimeUnit unit, @NonNull Schedule /** * Delays the emission of this {@code Maybe} until the given {@link Publisher} signals an item or completes. *

- * + * *

*
Backpressure:
*
The {@code delayIndicator} is consumed in an unbounded manner but is cancelled after @@ -3313,6 +3319,8 @@ public final Maybe delaySubscription(long time, @NonNull TimeUnit unit, @NonN * Calls the specified {@link Consumer} with the success item after this item has been emitted to the downstream. *

Note that the {@code onAfterSuccess} action is shared between subscriptions and as such * should be thread-safe. + *

+ * *

*
Scheduler:
*
{@code doAfterSuccess} does not operate by default on a particular {@link Scheduler}.
@@ -3336,7 +3344,7 @@ public final Maybe doAfterSuccess(@NonNull Consumer onAfterSuccess * {@link MaybeObserver#onComplete onSuccess}, * {@link MaybeObserver#onComplete onComplete} or {@link MaybeObserver#onError onError}. *

- * + * *

*
Scheduler:
*
{@code doAfterTerminate} does not operate by default on a particular {@link Scheduler}.
@@ -3365,7 +3373,10 @@ public final Maybe doAfterTerminate(@NonNull Action onAfterTerminate) { /** * Calls the specified action after this {@code Maybe} signals {@code onSuccess}, {@code onError} or {@code onComplete} or gets disposed by * the downstream. - *

In case of a race between a terminal event and a dispose call, the provided {@code onFinally} action + *

+ * + *

+ * In case of a race between a terminal event and a dispose call, the provided {@code onFinally} action * is executed once per subscription. *

Note that the {@code onFinally} action is shared between subscriptions and as such * should be thread-safe. @@ -3390,6 +3401,8 @@ public final Maybe doFinally(@NonNull Action onFinally) { /** * Calls the shared {@link Action} if a {@link MaybeObserver} subscribed to the current {@code Maybe} * disposes the common {@link Disposable} it received via {@code onSubscribe}. + *

+ * *

*
Scheduler:
*
{@code doOnDispose} does not operate by default on a particular {@link Scheduler}.
@@ -3524,6 +3537,8 @@ public final Maybe doOnLifecycle(@NonNull Consumer onSubs /** * Calls the shared {@link Consumer} with the {@link Disposable} sent through the {@code onSubscribe} for each * {@link MaybeObserver} that subscribes to the current {@code Maybe}. + *

+ * *

*
Scheduler:
*
{@code doOnSubscribe} does not operate by default on a particular {@link Scheduler}.
@@ -3550,7 +3565,7 @@ public final Maybe doOnSubscribe(@NonNull Consumer onSubs * Returns a {@code Maybe} instance that calls the given onTerminate callback * just before this {@code Maybe} completes normally or with an exception. *

- * + * *

* This differs from {@code doAfterTerminate} in that this happens before the {@code onComplete} or * {@code onError} notification. @@ -3782,7 +3797,7 @@ public final Observable flattenAsObservable(@NonNull Function - * + * *

*
Scheduler:
*
{@code flatMapObservable} does not operate by default on a particular {@link Scheduler}.
@@ -3807,7 +3822,7 @@ public final Observable flatMapObservable(@NonNull Function - * + * *
*
Backpressure:
*
The returned {@code Flowable} honors the downstream backpressure.
@@ -3927,7 +3942,7 @@ public final Completable ignoreElement() { /** * Returns a {@link Single} that emits {@code true} if the current {@code Maybe} is empty, otherwise {@code false}. *

- * + * *

*
Scheduler:
*
{@code isEmpty} does not operate by default on a particular {@link Scheduler}.
@@ -4150,7 +4165,7 @@ public final Single> materialize() { /** * Flattens this {@code Maybe} and another {@link MaybeSource} into a single {@link Flowable}, without any transformation. *

- * + * *

* You can combine items emitted by multiple {@code Maybe}s so that they appear as a single {@code Flowable}, by * using the {@code mergeWith} method. @@ -4231,6 +4246,8 @@ public final Maybe ofType(@NonNull Class clazz) { /** * Calls the specified converter function during assembly time and returns its resulting value. *

+ * + *

* This allows fluent conversion to any other type. *

*
Scheduler:
@@ -4252,6 +4269,8 @@ public final R to(@NonNull MaybeConverter converter) { /** * Converts this {@code Maybe} into a backpressure-aware {@link Flowable} instance composing cancellation * through. + *

+ * *

*
Backpressure:
*
The returned {@code Flowable} honors the backpressure of the downstream.
@@ -4298,6 +4317,8 @@ public final Future toFuture() { /** * Converts this {@code Maybe} into an {@link Observable} instance composing disposal * through. + *

+ * *

*
Scheduler:
*
{@code toObservable} does not operate by default on a particular {@link Scheduler}.
@@ -4318,11 +4339,14 @@ public final Observable toObservable() { /** * Converts this {@code Maybe} into a {@link Single} instance composing disposal * through and turning an empty {@code Maybe} into a signal of {@link NoSuchElementException}. + *

+ * *

*
Scheduler:
*
{@code toSingle} does not operate by default on a particular {@link Scheduler}.
*
* @return the new {@code Single} instance + * @see #defaultIfEmpty(Object) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -4504,7 +4528,7 @@ public final Maybe onTerminateDetach() { /** * Returns a {@link Flowable} that repeats the sequence of items emitted by the current {@code Maybe} indefinitely. *

- * + * *

*
Backpressure:
*
The operator honors downstream backpressure.
@@ -4527,7 +4551,7 @@ public final Flowable repeat() { * Returns a {@link Flowable} that repeats the sequence of items emitted by the current {@code Maybe} at most * {@code count} times. *

- * + * *

*
Backpressure:
*
This operator honors downstream backpressure.
@@ -4555,7 +4579,7 @@ public final Flowable repeat(long times) { * Returns a {@link Flowable} that repeats the sequence of items emitted by the current {@code Maybe} until * the provided stop function returns {@code true}. *

- * + * *

*
Backpressure:
*
This operator honors downstream backpressure.
@@ -4587,7 +4611,7 @@ public final Flowable repeatUntil(@NonNull BooleanSupplier stop) { * call {@code onComplete} or {@code onError} on the child observer. Otherwise, this operator will * resubscribe to the current {@code Maybe}. *

- * + * *

*
Backpressure:
*
The operator honors downstream backpressure and expects the source {@code Publisher} to honor backpressure as well. @@ -4614,7 +4638,7 @@ public final Flowable repeatWhen(@NonNull Function, * Returns a {@code Maybe} that mirrors the current {@code Maybe}, resubscribing to it if it calls {@code onError} * (infinite retry count). *

- * + * *

* If the current {@code Maybe} calls {@link MaybeObserver#onError}, this operator will resubscribe to the current * {@code Maybe} rather than propagating the {@code onError} call. @@ -4637,7 +4661,7 @@ public final Maybe retry() { * Returns a {@code Maybe} that mirrors the current {@code Maybe}, resubscribing to it if it calls {@code onError} * and the predicate returns {@code true} for that specific exception and retry count. *

- * + * *

*
Scheduler:
*
{@code retry} does not operate by default on a particular {@link Scheduler}.
@@ -4662,7 +4686,7 @@ public final Maybe retry(@NonNull BiPredicate - * + * *

* If the current {@code Maybe} calls {@link MaybeObserver#onError}, this operator will resubscribe to the current * {@code Maybe} for a maximum of {@code count} resubscriptions rather than propagating the @@ -4687,7 +4711,8 @@ public final Maybe retry(long times) { /** * Retries at most {@code times} or until the predicate returns {@code false}, whichever happens first. - * + *

+ * *

*
Scheduler:
*
{@code retry} does not operate by default on a particular {@link Scheduler}.
@@ -4707,6 +4732,8 @@ public final Maybe retry(long times, @NonNull Predicate pr /** * Retries the current {@code Maybe} if it fails and the predicate returns {@code true}. + *

+ * *

*
Scheduler:
*
{@code retry} does not operate by default on a particular {@link Scheduler}.
@@ -4751,7 +4778,7 @@ public final Maybe retryUntil(@NonNull BooleanSupplier stop) { * {@code onComplete} or {@code onError} on the child subscription. Otherwise, this operator will * resubscribe to the current {@code Maybe}. *

- * + * *

* Example: * @@ -5167,7 +5194,7 @@ public final Maybe subscribeOn(@NonNull Scheduler scheduler) { * Returns a {@code Maybe} that emits the items emitted by the current {@code Maybe} or the items of an alternate * {@link MaybeSource} if the current {@code Maybe} is empty. *

- * + * *

*
Scheduler:
*
{@code switchIfEmpty} does not operate by default on a particular {@link Scheduler}.
@@ -5190,7 +5217,7 @@ public final Maybe switchIfEmpty(@NonNull MaybeSource other) { * Returns a {@link Single} that emits the items emitted by the current {@code Maybe} or the item of an alternate * {@link SingleSource} if the current {@code Maybe} is empty. *

- * + * *

*
Scheduler:
*
{@code switchIfEmpty} does not operate by default on a particular {@link Scheduler}.
@@ -5214,7 +5241,7 @@ public final Single switchIfEmpty(@NonNull SingleSource other) { * Returns a {@code Maybe} that emits the items emitted by the current {@code Maybe} until a second {@link MaybeSource} * emits an item. *

- * + * *

*
Scheduler:
*
{@code takeUntil} does not operate by default on a particular {@link Scheduler}.
@@ -5241,7 +5268,7 @@ public final Maybe takeUntil(@NonNull MaybeSource other) { * Returns a {@code Maybe} that emits the item emitted by the current {@code Maybe} until a second {@link Publisher} * emits an item. *

- * + * *

*
Backpressure:
*
The {@code Publisher} is consumed in an unbounded fashion and is cancelled after the first item @@ -5499,7 +5526,7 @@ public final Maybe> timestamp(@NonNull TimeUnit unit, @NonNull Schedule * item. If the next item isn't emitted within the specified timeout duration starting from its predecessor, * the resulting {@code Maybe} terminates and notifies {@link MaybeObserver}s of a {@link TimeoutException}. *

- * + * *

*
Scheduler:
*
This version of {@code timeout} operates by default on the {@code computation} {@link Scheduler}.
@@ -5525,7 +5552,7 @@ public final Maybe timeout(long timeout, @NonNull TimeUnit unit) { * item. If the next item isn't emitted within the specified timeout duration starting from its predecessor, * the current {@code Maybe} is disposed and resulting {@code Maybe} begins instead to mirror a fallback {@link MaybeSource}. *

- * + * *

*
Scheduler:
*
This version of {@code timeout} operates by default on the {@code computation} {@link Scheduler}.
@@ -5555,7 +5582,7 @@ public final Maybe timeout(long timeout, @NonNull TimeUnit unit, @NonNull May * starting from its predecessor, the current {@code Maybe} is disposed and resulting {@code Maybe} begins instead * to mirror a fallback {@link MaybeSource}. *

- * + * *

*
Scheduler:
*
You specify which {@code Scheduler} this operator will use.
@@ -5587,7 +5614,7 @@ public final Maybe timeout(long timeout, @NonNull TimeUnit unit, @NonNull Sch * specified timeout duration starting from its predecessor, the resulting {@code Maybe} terminates and * notifies {@link MaybeObserver}s of a {@link TimeoutException}. *

- * + * *

*
Scheduler:
*
You specify which {@code Scheduler} this operator will use.
@@ -5613,6 +5640,8 @@ public final Maybe timeout(long timeout, @NonNull TimeUnit unit, @NonNull Sch /** * If the current {@code Maybe} didn't signal an event before the {@code timeoutIndicator} {@link MaybeSource} signals, a * {@link TimeoutException} is signaled instead. + *

+ * *

*
Scheduler:
*
{@code timeout} does not operate by default on a particular {@link Scheduler}.
@@ -5635,6 +5664,8 @@ public final Maybe timeout(@NonNull MaybeSource timeoutIndicator) { * If the current {@code Maybe} didn't signal an event before the {@code timeoutIndicator} {@link MaybeSource} signals, * the current {@code Maybe} is disposed and the {@code fallback} {@code MaybeSource} subscribed to * as a continuation. + *

+ * *

*
Scheduler:
*
{@code timeout} does not operate by default on a particular {@link Scheduler}.
@@ -5658,6 +5689,8 @@ public final Maybe timeout(@NonNull MaybeSource timeoutIndicator, @Non /** * If the current {@code Maybe} source didn't signal an event before the {@code timeoutIndicator} {@link Publisher} signals, a * {@link TimeoutException} is signaled instead. + *

+ * *

*
Backpressure:
*
The {@code timeoutIndicator} {@code Publisher} is consumed in an unbounded manner and @@ -5684,6 +5717,8 @@ public final Maybe timeout(@NonNull Publisher timeoutIndicator) { * If the current {@code Maybe} didn't signal an event before the {@code timeoutIndicator} {@link Publisher} signals, * the current {@code Maybe} is disposed and the {@code fallback} {@link MaybeSource} subscribed to * as a continuation. + *

+ * *

*
Backpressure:
*
The {@code timeoutIndicator} {@code Publisher} is consumed in an unbounded manner and