diff --git a/src/main/java/io/reactivex/rxjava3/core/Single.java b/src/main/java/io/reactivex/rxjava3/core/Single.java index 28177cc9e3..ed676e44fb 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Single.java +++ b/src/main/java/io/reactivex/rxjava3/core/Single.java @@ -20,9 +20,8 @@ import org.reactivestreams.Publisher; import io.reactivex.rxjava3.annotations.*; -import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.disposables.Disposable; -import io.reactivex.rxjava3.exceptions.Exceptions; +import io.reactivex.rxjava3.exceptions.*; import io.reactivex.rxjava3.functions.*; import io.reactivex.rxjava3.internal.functions.*; import io.reactivex.rxjava3.internal.fuseable.*; @@ -43,7 +42,7 @@ * The {@code Single} class implements the Reactive Pattern for a single value response. *

* {@code Single} behaves similarly to {@link Observable} except that it can only emit either a single successful - * value or an error (there is no "onComplete" notification as there is for an {@link Observable}). + * value or an error (there is no {@code onComplete} notification as there is for an {@code Observable}). *

* The {@code Single} class implements the {@link SingleSource} base interface and the default consumer * type it interacts with is the {@link SingleObserver} via the {@link #subscribe(SingleObserver)} method. @@ -68,7 +67,7 @@ *

* *

- * See {@link Flowable} or {@link Observable} for the + * See {@link Flowable} or {@code Observable} for the * implementation of the Reactive Pattern for a stream or vector of values. *

* For more information see the ReactiveX @@ -110,14 +109,14 @@ * allow working with a {@code SingleObserver} (or subclass) instance to be applied with in * a fluent manner (such as in the example above). * @param - * the type of the item emitted by the Single + * the type of the item emitted by the {@code Single} * @since 2.0 * @see io.reactivex.rxjava3.observers.DisposableSingleObserver */ public abstract class Single implements SingleSource { /** - * Runs multiple SingleSources and signals the events of the first one that signals (disposing + * Runs multiple {@link SingleSource}s and signals the events of the first one that signals (disposing * the rest). *

* @@ -126,9 +125,10 @@ public abstract class Single implements SingleSource { *

{@code amb} does not operate by default on a particular {@link Scheduler}.
* * @param the value type - * @param sources the Iterable sequence of sources. A subscription to each source will - * occur in the same order as in this Iterable. - * @return the new Single instance + * @param sources the {@link Iterable} sequence of sources. A subscription to each source will + * occur in the same order as in this {@code Iterable}. + * @return the new {@code Single} instance + * @throws NullPointerException if {@code sources} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -140,7 +140,7 @@ public static Single amb(@NonNull Iterable * @@ -151,7 +151,7 @@ public static Single amb(@NonNull Iterable the value type * @param sources the array of sources. A subscription to each source will * occur in the same order as in this array. - * @return the new Single instance + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -171,19 +171,19 @@ public static Single ambArray(@NonNull SingleSource... sourc } /** - * Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided by - * an Iterable sequence. + * Concatenate the single values, in a non-overlapping fashion, of the {@link SingleSource}s provided by + * an {@link Iterable} sequence. *

* *

*
Backpressure:
- *
The returned {@code Flowable} honors the backpressure of the downstream consumer.
+ *
The returned {@link Flowable} honors the backpressure of the downstream consumer.
*
Scheduler:
*
{@code concat} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type - * @param sources the Iterable sequence of SingleSource instances - * @return the new Flowable instance + * @param sources the {@code Iterable} sequence of {@code SingleSource} instances + * @return the new {@code Flowable} instance * @since 2.0 */ @CheckReturnValue @@ -195,8 +195,8 @@ public static Flowable concat(@NonNull Iterable * *
@@ -204,8 +204,9 @@ public static Flowable concat(@NonNull Iterable{@code concat} does not operate by default on a particular {@link Scheduler}. *
* @param the value type - * @param sources the ObservableSource of SingleSource instances - * @return the new Observable instance + * @param sources the {@code ObservableSource} of {@code SingleSource} instances + * @return the new {@link Observable} instance + * @throws NullPointerException if {@code sources} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -218,20 +219,20 @@ public static Observable concat(@NonNull ObservableSource * *
*
Backpressure:
- *
The returned {@code Flowable} honors the backpressure of the downstream consumer + *
The returned {@link Flowable} honors the backpressure of the downstream consumer * and the sources {@code Publisher} is expected to honor it as well.
*
Scheduler:
*
{@code concat} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type - * @param sources the Publisher of SingleSource instances - * @return the new Flowable instance + * @param sources the {@code Publisher} of {@code SingleSource} instances + * @return the new {@code Flowable} instance * @since 2.0 */ @CheckReturnValue @@ -243,21 +244,23 @@ public static Flowable concat(@NonNull Publisher * *
*
Backpressure:
- *
The returned {@code Flowable} honors the backpressure of the downstream consumer + *
The returned {@link Flowable} honors the backpressure of the downstream consumer * and the sources {@code Publisher} is expected to honor it as well.
*
Scheduler:
*
{@code concat} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type - * @param sources the Publisher of SingleSource instances - * @param prefetch the number of SingleSources to prefetch from the Publisher - * @return the new Flowable instance + * @param sources the {@code Publisher} of {@code SingleSource} instances + * @param prefetch the number of {@code SingleSource}s to prefetch from the {@code Publisher} + * @return the new {@code Flowable} instance + * @throws NullPointerException if {@code sources} is {@code null} + * @throws IllegalArgumentException if {@code prefetch} is non-positive * @since 2.0 */ @CheckReturnValue @@ -272,7 +275,7 @@ public static Flowable concat(@NonNull Publisher * *
@@ -284,10 +287,11 @@ public static Flowable concat(@NonNull Publisher the common value type * @param source1 - * a Single to be concatenated + * a {@code SingleSource} to be concatenated * @param source2 - * a Single to be concatenated - * @return a Flowable that emits items emitted by the two source Singles, one after the other. + * a {@code SingleSource} to be concatenated + * @return a {@code Flowable} that emits items emitted by the two source {@code SingleSource}s, one after the other. + * @throws NullPointerException if {@code source1} or {@code source2} is {@code null} * @see ReactiveX operators documentation: Concat */ @CheckReturnValue @@ -303,7 +307,7 @@ public static Flowable concat( } /** - * Returns a Flowable that emits the items emitted by three Singles, one after the other. + * Returns a {@link Flowable} that emits the items emitted by three {@link SingleSource}s, one after the other. *

* *

@@ -315,12 +319,13 @@ public static Flowable concat( * * @param the common value type * @param source1 - * a Single to be concatenated + * a {@code SingleSource} to be concatenated * @param source2 - * a Single to be concatenated + * a {@code SingleSource} to be concatenated * @param source3 - * a Single to be concatenated - * @return a Flowable that emits items emitted by the three source Singles, one after the other. + * a {@code SingleSource} to be concatenated + * @return a {@code Flowable} that emits items emitted by the three source {@code SingleSource}s, one after the other. + * @throws NullPointerException if {@code source1}, {@code source2} or {@code source3} is {@code null} * @see ReactiveX operators documentation: Concat */ @CheckReturnValue @@ -338,7 +343,7 @@ public static Flowable concat( } /** - * Returns a Flowable that emits the items emitted by four Singles, one after the other. + * Returns a {@link Flowable} that emits the items emitted by four {@link SingleSource}s, one after the other. *

* *

@@ -350,14 +355,15 @@ public static Flowable concat( * * @param the common value type * @param source1 - * a Single to be concatenated + * a {@code SingleSource} to be concatenated * @param source2 - * a Single to be concatenated + * a {@code SingleSource} to be concatenated * @param source3 - * a Single to be concatenated + * a {@code SingleSource} to be concatenated * @param source4 - * a Single to be concatenated - * @return a Flowable that emits items emitted by the four source Singles, one after the other. + * a {@code SingleSource} to be concatenated + * @return a {@code Flowable} that emits items emitted by the four source {@code SingleSource}s, one after the other. + * @throws NullPointerException if {@code source1}, {@code source2}, {@code source3} or {@code source4} is {@code null} * @see ReactiveX operators documentation: Concat */ @CheckReturnValue @@ -376,19 +382,19 @@ public static Flowable concat( } /** - * Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided in + * Concatenate the single values, in a non-overlapping fashion, of the {@link SingleSource}s provided in * an array. *

* *

*
Backpressure:
- *
The returned {@code Flowable} honors the backpressure of the downstream consumer.
+ *
The returned {@link Flowable} honors the backpressure of the downstream consumer.
*
Scheduler:
*
{@code concatArray} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type - * @param sources the array of SingleSource instances - * @return the new Flowable instance + * @param sources the array of {@code SingleSource} instances + * @return the new {@code Flowable} instance * @since 2.0 */ @CheckReturnValue @@ -402,13 +408,13 @@ public static Flowable concatArray(@NonNull SingleSource... } /** - * Concatenates a sequence of SingleSource eagerly into a single stream of values. + * Concatenates a sequence of {@link SingleSource} eagerly into a single stream of values. *

* *

* Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the - * source SingleSources. The operator buffers the value emitted by these SingleSources and then drains them - * in order, each one after the previous one completes. + * source {@code SingleSource}s. The operator buffers the value emitted by these {@code SingleSource}s and then drains them + * in order, each one after the previous one succeeds. *

*
Backpressure:
*
The operator honors backpressure from downstream.
@@ -416,8 +422,8 @@ public static Flowable concatArray(@NonNull SingleSource... *
This method does not operate by default on a particular {@link Scheduler}.
*
* @param the value type - * @param sources a sequence of Single that need to be eagerly concatenated - * @return the new Flowable instance with the specified concatenation behavior + * @param sources a sequence of {@code SingleSource}s that need to be eagerly concatenated + * @return the new {@link Flowable} instance with the specified concatenation behavior */ @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @@ -429,24 +435,24 @@ public static Flowable concatArrayEager(@NonNull SingleSource * *

* Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the - * emitted source Publishers as they are observed. The operator buffers the values emitted by these - * Publishers and then drains them in order, each one after the previous one completes. + * emitted source {@code SingleSource}s as they are observed. The operator buffers the values emitted by these + * {@code SingleSource}s and then drains them in order, each one after the previous one succeeds. *

*
Backpressure:
- *
Backpressure is honored towards the downstream and the outer Publisher is + *
Backpressure is honored towards the downstream and the outer {@code Publisher} is * expected to support backpressure. Violating this assumption, the operator will * signal {@link io.reactivex.rxjava3.exceptions.MissingBackpressureException}.
*
Scheduler:
*
This method does not operate by default on a particular {@link Scheduler}.
*
* @param the value type - * @param sources a sequence of Publishers that need to be eagerly concatenated - * @return the new Publisher instance with the specified concatenation behavior + * @param sources a sequence of {@code SingleSource}s that need to be eagerly concatenated + * @return the new {@link Flowable} instance with the specified concatenation behavior */ @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @@ -457,13 +463,13 @@ public static Flowable concatEager(@NonNull Publisher * *

* Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the - * source SingleSources. The operator buffers the values emitted by these SingleSources and then drains them - * in order, each one after the previous one completes. + * source {@code SingleSource}s. The operator buffers the values emitted by these {@code SingleSource}s and then drains them + * in order, each one after the previous one succeeds. *

*
Backpressure:
*
Backpressure is honored towards the downstream.
@@ -471,8 +477,8 @@ public static Flowable concatEager(@NonNull PublisherThis method does not operate by default on a particular {@link Scheduler}. *
* @param the value type - * @param sources a sequence of SingleSource that need to be eagerly concatenated - * @return the new Flowable instance with the specified concatenation behavior + * @param sources an {@code Iterable} sequence of {@code SingleSource} that need to be eagerly concatenated + * @return the new {@link Flowable} instance with the specified concatenation behavior */ @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @@ -483,7 +489,7 @@ public static Flowable concatEager(@NonNull Iterable * *

@@ -512,15 +518,16 @@ public static Flowable concatEager(@NonNull Iterable *

Scheduler:
*
{@code create} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type - * @param source the emitter that is called when a SingleObserver subscribes to the returned {@code Single} - * @return the new Single instance + * @param source the emitter that is called when a {@code SingleObserver} subscribes to the returned {@code Single} + * @return the new {@code Single} instance + * @throws NullPointerException if {@code source} is {@code null} * @see SingleOnSubscribe * @see Cancellable */ @@ -543,8 +550,9 @@ public static Flowable concatEager(@NonNull Iterable * @param the value type * @param singleSupplier the {@code Supplier} that is called for each individual {@code SingleObserver} and - * returns a SingleSource instance to subscribe to - * @return the new Single instance + * returns a {@code SingleSource} instance to subscribe to + * @throws NullPointerException if {@code singleSupplier} is {@code null} + * @return the new {@code Single} instance */ @CheckReturnValue @NonNull @@ -555,7 +563,7 @@ public static Single defer(@NonNull Supplier * *
@@ -563,9 +571,10 @@ public static Single defer(@NonNull Supplier{@code error} does not operate by default on a particular {@link Scheduler}. *
* @param the value type - * @param errorSupplier the Supplier that is called for each individual SingleObserver and - * returns a Throwable instance to be emitted. - * @return the new Single instance + * @param errorSupplier the {@link Supplier} that is called for each individual {@code SingleObserver} and + * returns a {@code Throwable} instance to be emitted. + * @throws NullPointerException if {@code errorSupplier} is {@code null} + * @return the new {@code Single} instance */ @CheckReturnValue @NonNull @@ -576,7 +585,7 @@ public static Single error(@NonNull Supplier errorSu } /** - * Returns a Single that invokes a subscriber's {@link SingleObserver#onError onError} method when the + * Returns a {@code Single} that invokes a subscriber's {@link SingleObserver#onError onError} method when the * subscriber subscribes to it. *

* @@ -586,11 +595,12 @@ public static Single error(@NonNull Supplier errorSu *

* * @param exception - * the particular Throwable to pass to {@link SingleObserver#onError onError} + * the particular {@link Throwable} to pass to {@link SingleObserver#onError onError} * @param - * the type of the item (ostensibly) emitted by the Single - * @return a Single that invokes the subscriber's {@link SingleObserver#onError onError} method when + * the type of the item (ostensibly) emitted by the {@code Single} + * @return the new {@code Single} that invokes the subscriber's {@link SingleObserver#onError onError} method when * the subscriber subscribes to it + * @throws NullPointerException if {@code exception} is {@code null} * @see ReactiveX operators documentation: Throw */ @CheckReturnValue @@ -602,9 +612,10 @@ public static Single error(@NonNull Throwable exception) { } /** - * Returns a {@link Single} that invokes passed function and emits its result for each new SingleObserver that subscribes. + * Returns a {@code Single} that invokes the given {@link Callable} for each incoming {@link SingleObserver} + * and emits its value or exception to them. *

- * Allows you to defer execution of passed function until SingleObserver subscribes to the {@link Single}. + * Allows you to defer execution of passed function until {@code SingleObserver} subscribes to the {@code Single}. * It makes passed function "lazy". * Result of the function invocation will be emitted by the {@link Single}. *

@@ -613,7 +624,7 @@ public static Single error(@NonNull Throwable exception) { *

Scheduler:
*
{@code fromCallable} does not operate by default on a particular {@link Scheduler}.
*
Error handling:
- *
If the {@link Callable} throws an exception, the respective {@link Throwable} is + *
If the {@code Callable} throws an exception, the respective {@link Throwable} is * delivered to the downstream via {@link SingleObserver#onError(Throwable)}, * except when the downstream has disposed this {@code Single} source. * In this latter case, the {@code Throwable} is delivered to the global error handler via @@ -622,10 +633,11 @@ public static Single error(@NonNull Throwable exception) { *
* * @param callable - * function which execution should be deferred, it will be invoked when SingleObserver will subscribe to the {@link Single}. + * function which execution should be deferred, it will be invoked when {@code SingleObserver} will subscribe to the {@link Single}. * @param - * the type of the item emitted by the {@link Single}. - * @return a {@link Single} whose {@link SingleObserver}s' subscriptions trigger an invocation of the given function. + * the type of the item emitted by the {@code Single}. + * @return the new {@code Single} whose {@code SingleObserver}s' subscriptions trigger an invocation of the given function. + * @throws NullPointerException if {@code callable} is {@code null} * @see #defer(Supplier) * @see #fromSupplier(Supplier) */ @@ -638,27 +650,32 @@ public static Single error(@NonNull Throwable exception) { } /** - * Converts a {@link Future} into a {@code Single}. + * Converts a {@link Future} into a {@code Single} and awaits its outcome in a blocking fashion. *

* *

- * You can convert any object that supports the {@link Future} interface into a Single that emits the return - * value of the {@link Future#get} method of that object, by passing the object into the {@code from} - * method. + * The operator calls {@link Future#get()}, which is a blocking method, on the subscription thread. + * It is recommended applying {@link #subscribeOn(Scheduler)} to move this blocking wait to a + * background thread, and if the {@link Scheduler} supports it, interrupt the wait when the flow + * is disposed. *

- * Important note: This Single is blocking; you cannot dispose it. + * A non-{@code null} value is then emitted via {@code onSuccess} or any exception is emitted via + * {@code onError}. If the {@code Future} completes with {@code null}, a {@link NullPointerException} + * is signaled. *

*
Scheduler:
- *
{@code fromFuture} does not operate by default on a particular {@link Scheduler}.
+ *
{@code fromFuture} does not operate by default on a particular {@code Scheduler}.
*
* * @param future - * the source {@link Future} + * the source {@code Future} * @param - * the type of object that the {@link Future} returns, and also the type of item to be emitted by + * the type of object that the {@code Future} returns, and also the type of item to be emitted by * the resulting {@code Single} - * @return a {@code Single} that emits the item from the source {@link Future} + * @return the new {@code Single} that emits the item from the source {@code Future} * @see ReactiveX operators documentation: From + * @see #fromFuture(Future, long, TimeUnit) + * @see #fromCompletionStage(CompletionStage) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -668,30 +685,34 @@ public static Single error(@NonNull Throwable exception) { } /** - * Converts a {@link Future} into a {@code Single}, with a timeout on the Future. + * Converts a {@link Future} into a {@code Single} and awaits its outcome, or timeout, in a blocking fashion. *

* *

- * You can convert any object that supports the {@link Future} interface into a {@code Single} that emits - * the return value of the {@link Future#get} method of that object, by passing the object into the - * {@code from} method. *

- * Important note: This {@code Single} is blocking; you cannot dispose it. + * The operator calls {@link Future#get(long, TimeUnit)}, which is a blocking method, on the subscription thread. + * It is recommended applying {@link #subscribeOn(Scheduler)} to move this blocking wait to a + * background thread, and if the {@link Scheduler} supports it, interrupt the wait when the flow + * is disposed. + *

+ * A non-{@code null} value is then emitted via {@code onSuccess} or any exception is emitted via + * {@code onError}. If the {@code Future} completes with {@code null}, a {@link NullPointerException} + * is signaled. *

*
Scheduler:
- *
{@code fromFuture} does not operate by default on a particular {@link Scheduler}.
+ *
{@code fromFuture} does not operate by default on a particular {@code Scheduler}.
*
* * @param future - * the source {@link Future} + * the source {@code Future} * @param timeout * the maximum time to wait before calling {@code get} * @param unit * the {@link TimeUnit} of the {@code timeout} argument * @param - * the type of object that the {@link Future} returns, and also the type of item to be emitted by + * the type of object that the {@code Future} returns, and also the type of item to be emitted by * the resulting {@code Single} - * @return a {@code Single} that emits the item from the source {@link Future} + * @return the new {@code Single} that emits the item from the source {@code Future} * @see ReactiveX operators documentation: From */ @CheckReturnValue @@ -702,11 +723,11 @@ public static Single error(@NonNull Throwable exception) { } /** - * Converts a {@link Future} into a {@code Single}, with a timeout on the Future. + * Converts a {@link Future} into a {@code Single}, with a timeout on the {@code Future}. *

* *

- * You can convert any object that supports the {@link Future} interface into a {@code Single} that emits + * You can convert any object that supports the {@code Future} interface into a {@code Single} that emits * the return value of the {@link Future#get} method of that object, by passing the object into the * {@code from} method. *

@@ -717,17 +738,17 @@ public static Single error(@NonNull Throwable exception) { * * * @param future - * the source {@link Future} + * the source {@code Future} * @param timeout * the maximum time to wait before calling {@code get} * @param unit * the {@link TimeUnit} of the {@code timeout} argument * @param scheduler - * the Scheduler to use for the blocking wait + * the {@code Scheduler} to use for the blocking wait * @param - * the type of object that the {@link Future} returns, and also the type of item to be emitted by + * the type of object that the {@code Future} returns, and also the type of item to be emitted by * the resulting {@code Single} - * @return a {@code Single} that emits the item from the source {@link Future} + * @return the new {@code Single} that emits the item from the source {@code Future} * @see ReactiveX operators documentation: From */ @CheckReturnValue @@ -742,23 +763,23 @@ public static Single error(@NonNull Throwable exception) { *

* *

- * You can convert any object that supports the {@link Future} interface into a {@code Single} that emits + * You can convert any object that supports the {@code Future} interface into a {@code Single} that emits * the return value of the {@link Future#get} method of that object, by passing the object into the * {@code from} method. *

*
Scheduler:
- *
You specify which {@link Scheduler} this operator will use.
+ *
You specify which {@code Scheduler} this operator will use.
*
* * @param future - * the source {@link Future} + * the source {@code Future} * @param scheduler - * the {@link Scheduler} to wait for the Future on. Use a Scheduler such as - * {@link Schedulers#io()} that can block and wait on the Future + * the {@code Scheduler} to wait for the {@code Future} on. Use a {@code Scheduler} such as + * {@link Schedulers#io()} that can block and wait on the {@code Future} * @param - * the type of object that the {@link Future} returns, and also the type of item to be emitted by + * the type of object that the {@code Future} returns, and also the type of item to be emitted by * the resulting {@code Single} - * @return a {@code Single} that emits the item from the source {@link Future} + * @return the new {@code Single} that emits the item from the source {@code Future} * @see ReactiveX operators documentation: From */ @CheckReturnValue @@ -769,22 +790,23 @@ public static Single error(@NonNull Throwable exception) { } /** - * Wraps a specific Publisher into a Single and signals its single element or error. - *

If the source Publisher is empty, a NoSuchElementException is signalled. If - * the source has more than one element, an IndexOutOfBoundsException is signalled. + * Wraps a specific {@link Publisher} into a {@code Single} and signals its single element or error. + *

+ * *

- * The {@link Publisher} must follow the - * Reactive-Streams specification. + * If the source {@code Publisher} is empty, a {@link NoSuchElementException} is signaled. If + * the source has more than one element, an {@link IndexOutOfBoundsException} is signaled. + *

+ * The {@code Publisher} must follow the + * Reactive Streams specification. * Violating the specification may result in undefined behavior. *

* If possible, use {@link #create(SingleOnSubscribe)} to create a * source-like {@code Single} instead. *

- * Note that even though {@link Publisher} appears to be a functional interface, it + * Note that even though {@code Publisher} appears to be a functional interface, it * is not recommended to implement it through a lambda as the specification requires * state management that is not achievable with a stateless lambda. - *

- * *

*
Backpressure:
*
The {@code publisher} is consumed in an unbounded fashion but will be cancelled @@ -793,8 +815,9 @@ public static Single error(@NonNull Throwable exception) { *
{@code fromPublisher} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type - * @param publisher the source Publisher instance, not null - * @return the new Single instance + * @param publisher the source {@code Publisher} instance, not {@code null} + * @return the new {@code Single} instance + * @throws NullPointerException if {@code publisher} is {@code null} * @see #create(SingleOnSubscribe) */ @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @@ -807,20 +830,22 @@ public static Single fromPublisher(@NonNull Publisher publis } /** - * Wraps a specific ObservableSource into a Single and signals its single element or error. - *

If the ObservableSource is empty, a NoSuchElementException is signalled. - * If the source has more than one element, an IndexOutOfBoundsException is signalled. + * Wraps a specific {@link ObservableSource} into a {@code Single} and signals its single element or error. *

* + *

+ * If the {@code ObservableSource} is empty, a {@link NoSuchElementException} is signaled. + * If the source has more than one element, an {@link IndexOutOfBoundsException} is signaled. *

*
Scheduler:
*
{@code fromObservable} does not operate by default on a particular {@link Scheduler}.
*
* - * @param observableSource the source Observable, not null + * @param observableSource the source sequence to wrap, not {@code null} * @param - * the type of the item emitted by the {@link Single}. - * @return the new Single instance + * the type of the item emitted by the {@code Single}. + * @return the new {@code Single} instance + * @throws NullPointerException if {@code observableSource} is {@code null} */ @CheckReturnValue @NonNull @@ -831,10 +856,10 @@ public static Single fromObservable(@NonNull ObservableSource - * Allows you to defer execution of passed function until SingleObserver subscribes to the {@link Single}. + * Allows you to defer execution of passed function until a {@code SingleObserver} subscribes to the {@link Single}. * It makes passed function "lazy". * Result of the function invocation will be emitted by the {@link Single}. *

@@ -852,10 +877,11 @@ public static Single fromObservable(@NonNull ObservableSource * * @param supplier - * function which execution should be deferred, it will be invoked when SingleObserver will subscribe to the {@link Single}. + * function which execution should be deferred, it will be invoked when {@code SingleObserver} subscribes to the {@code Single}. * @param - * the type of the item emitted by the {@link Single}. - * @return a {@link Single} whose {@link SingleObserver}s' subscriptions trigger an invocation of the given function. + * the type of the item emitted by the {@code Single}. + * @return the new {@code Single} whose {@code SingleObserver}s' subscriptions trigger an invocation of the given function. + * @throws NullPointerException if {@code supplier} is {@code null} * @see #defer(Supplier) * @see #fromCallable(Callable) * @since 3.0.0 @@ -884,7 +910,8 @@ public static Single fromObservable(@NonNull ObservableSource * the type of that item - * @return a {@code Single} that emits {@code item} + * @return the new {@code Single} that emits {@code item} + * @throws NullPointerException if {@code item} is {@code null} * @see ReactiveX operators documentation: Just */ @CheckReturnValue @@ -896,8 +923,8 @@ public static Single fromObservable(@NonNull ObservableSource * *

@@ -906,13 +933,13 @@ public static Single fromObservable(@NonNull ObservableSourceScheduler: *
{@code merge} does not operate by default on a particular {@link Scheduler}.
*
Error handling:
- *
If any of the source {@code SingleSource}s signal a {@code Throwable} via {@code onError}, the resulting + *
If any of the source {@code SingleSource}s signal a {@link Throwable} via {@code onError}, the resulting * {@code Flowable} terminates with that {@code Throwable} and all other source {@code SingleSource}s are disposed. * If more than one {@code SingleSource} signals an error, the resulting {@code Flowable} may terminate with the * first one's error or, depending on the concurrency of the sources, may terminate with a - * {@code CompositeException} containing two or more of the various error signals. + * {@link CompositeException} containing two or more of the various error signals. * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via - * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * {@link RxJavaPlugins#onError(Throwable)} method as {@link UndeliverableException} errors. Similarly, {@code Throwable}s * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a * (composite) error will be sent to the same global error handler. * Use {@link #mergeDelayError(Iterable)} to merge sources and terminate only when all source {@code SingleSource}s @@ -920,8 +947,9 @@ public static Single fromObservable(@NonNull ObservableSource *
* @param the common and resulting value type - * @param sources the Iterable sequence of SingleSource sources - * @return the new Flowable instance + * @param sources the {@code Iterable} sequence of {@code SingleSource} sources + * @return the new {@code Flowable} instance + * @throws NullPointerException if {@code sources} is {@code null} * @since 2.0 * @see #mergeDelayError(Iterable) */ @@ -934,8 +962,8 @@ public static Flowable merge(@NonNull Iterable * *
@@ -944,13 +972,13 @@ public static Flowable merge(@NonNull IterableScheduler: *
{@code merge} does not operate by default on a particular {@link Scheduler}.
*
Error handling:
- *
If any of the source {@code SingleSource}s signal a {@code Throwable} via {@code onError}, the resulting + *
If any of the source {@code SingleSource}s signal a {@link Throwable} via {@code onError}, the resulting * {@code Flowable} terminates with that {@code Throwable} and all other source {@code SingleSource}s are disposed. * If more than one {@code SingleSource} signals an error, the resulting {@code Flowable} may terminate with the * first one's error or, depending on the concurrency of the sources, may terminate with a - * {@code CompositeException} containing two or more of the various error signals. + * {@link CompositeException} containing two or more of the various error signals. * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via - * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * {@link RxJavaPlugins#onError(Throwable)} method as {@link UndeliverableException} errors. Similarly, {@code Throwable}s * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a * (composite) error will be sent to the same global error handler. * Use {@link #mergeDelayError(Publisher)} to merge sources and terminate only when all source {@code SingleSource}s @@ -958,8 +986,9 @@ public static Flowable merge(@NonNull Iterable *
* @param the common and resulting value type - * @param sources the Flowable sequence of SingleSource sources - * @return the new Flowable instance + * @param sources the {@code Publisher} emitting a sequence of {@code SingleSource}s + * @return the new {@code Flowable} instance + * @throws NullPointerException if {@code sources} is {@code null} * @see #mergeDelayError(Publisher) * @since 2.0 */ @@ -974,15 +1003,15 @@ public static Flowable merge(@NonNull Publisher * *
*
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
- *
The resulting {@code Single} emits the outer source's or the inner {@code SingleSource}'s {@code Throwable} as is. - * Unlike the other {@code merge()} operators, this operator won't and can't produce a {@code CompositeException} because there is + *
The resulting {@code Single} emits the outer source's or the inner {@code SingleSource}'s {@link Throwable} as is. + * Unlike the other {@code merge()} operators, this operator won't and can't produce a {@link CompositeException} because there is * only one possibility for the outer or the inner {@code SingleSource} to emit an {@code onError} signal. * Therefore, there is no need for a {@code mergeDelayError(SingleSource>)} operator. *
@@ -991,8 +1020,9 @@ public static Flowable merge(@NonNull Publisher the value type of the sources and the output * @param source * a {@code Single} that emits a {@code Single} - * @return a {@code Single} that emits the item that is the result of flattening the {@code Single} emitted + * @return the new {@code Single} that emits the item that is the result of flattening the {@code Single} emitted * by {@code source} + * @throws NullPointerException if {@code source} is {@code null} * @see ReactiveX operators documentation: Merge */ @CheckReturnValue @@ -1004,11 +1034,11 @@ public static Single merge(@NonNull SingleSource * *

- * You can combine items emitted by multiple Singles so that they appear as a single Flowable, by + * You can combine items emitted by multiple {@code SingleSource}s so that they appear as a single {@code Flowable}, by * using the {@code merge} method. *

*
Backpressure:
@@ -1016,13 +1046,13 @@ public static Single merge(@NonNull SingleSourceScheduler: *
{@code merge} does not operate by default on a particular {@link Scheduler}.
*
Error handling:
- *
If any of the source {@code SingleSource}s signal a {@code Throwable} via {@code onError}, the resulting + *
If any of the source {@code SingleSource}s signal a {@link Throwable} via {@code onError}, the resulting * {@code Flowable} terminates with that {@code Throwable} and all other source {@code SingleSource}s are disposed. * If more than one {@code SingleSource} signals an error, the resulting {@code Flowable} may terminate with the * first one's error or, depending on the concurrency of the sources, may terminate with a - * {@code CompositeException} containing two or more of the various error signals. + * {@link CompositeException} containing two or more of the various error signals. * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via - * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * {@link RxJavaPlugins#onError(Throwable)} method as {@link UndeliverableException} errors. Similarly, {@code Throwable}s * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a * (composite) error will be sent to the same global error handler. * Use {@link #mergeDelayError(SingleSource, SingleSource)} to merge sources and terminate only when all source {@code SingleSource}s @@ -1032,10 +1062,11 @@ public static Single merge(@NonNull SingleSource the common value type * @param source1 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source2 - * a SingleSource to be merged - * @return a Flowable that emits all of the items emitted by the source Singles + * a {@code SingleSource} to be merged + * @return the new {@code Flowable} that emits all of the items emitted by the source {@code SingleSource}s + * @throws NullPointerException if {@code source1} or {@code source2} is {@code null} * @see ReactiveX operators documentation: Merge * @see #mergeDelayError(SingleSource, SingleSource) */ @@ -1052,11 +1083,11 @@ public static Flowable merge( } /** - * Flattens three Singles into a single Flowable, without any transformation. + * Flattens three {@link SingleSource}s into one {@link Flowable} sequence, without any transformation. *

* *

- * You can combine items emitted by multiple Singles so that they appear as a single Flowable, by using + * You can combine items emitted by multiple {@code SingleSource}s so that they appear as a single {@code Flowable}, by * the {@code merge} method. *

*
Backpressure:
@@ -1064,13 +1095,13 @@ public static Flowable merge( *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
*
Error handling:
- *
If any of the source {@code SingleSource}s signal a {@code Throwable} via {@code onError}, the resulting + *
If any of the source {@code SingleSource}s signal a {@link Throwable} via {@code onError}, the resulting * {@code Flowable} terminates with that {@code Throwable} and all other source {@code SingleSource}s are disposed. * If more than one {@code SingleSource} signals an error, the resulting {@code Flowable} may terminate with the * first one's error or, depending on the concurrency of the sources, may terminate with a - * {@code CompositeException} containing two or more of the various error signals. + * {@link CompositeException} containing two or more of the various error signals. * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via - * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * {@link RxJavaPlugins#onError(Throwable)} method as {@link UndeliverableException} errors. Similarly, {@code Throwable}s * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a * (composite) error will be sent to the same global error handler. * Use {@link #mergeDelayError(SingleSource, SingleSource, SingleSource)} to merge sources and terminate only when all source {@code SingleSource}s @@ -1080,12 +1111,13 @@ public static Flowable merge( * * @param the common value type * @param source1 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source2 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source3 - * a SingleSource to be merged - * @return a Flowable that emits all of the items emitted by the source Singles + * a {@code SingleSource} to be merged + * @return the new {@code Flowable} that emits all of the items emitted by the source {@code SingleSource}s + * @throws NullPointerException if {@code source1}, {@code source2} or {@code source3} is {@code null} * @see ReactiveX operators documentation: Merge * @see #mergeDelayError(SingleSource, SingleSource, SingleSource) */ @@ -1104,11 +1136,11 @@ public static Flowable merge( } /** - * Flattens four Singles into a single Flowable, without any transformation. + * Flattens four {@link SingleSource}s into one {@link Flowable} sequence, without any transformation. *

* *

- * You can combine items emitted by multiple Singles so that they appear as a single Flowable, by using + * You can combine items emitted by multiple {@code SingleSource}s so that they appear as a single {@code Flowable}, by * the {@code merge} method. *

*
Backpressure:
@@ -1116,13 +1148,13 @@ public static Flowable merge( *
Scheduler:
*
{@code merge} does not operate by default on a particular {@link Scheduler}.
*
Error handling:
- *
If any of the source {@code SingleSource}s signal a {@code Throwable} via {@code onError}, the resulting + *
If any of the source {@code SingleSource}s signal a {@link Throwable} via {@code onError}, the resulting * {@code Flowable} terminates with that {@code Throwable} and all other source {@code SingleSource}s are disposed. * If more than one {@code SingleSource} signals an error, the resulting {@code Flowable} may terminate with the * first one's error or, depending on the concurrency of the sources, may terminate with a - * {@code CompositeException} containing two or more of the various error signals. + * {@link CompositeException} containing two or more of the various error signals. * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via - * {@link RxJavaPlugins#onError(Throwable)} method as {@code UndeliverableException} errors. Similarly, {@code Throwable}s + * {@link RxJavaPlugins#onError(Throwable)} method as {@link UndeliverableException} errors. Similarly, {@code Throwable}s * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a * (composite) error will be sent to the same global error handler. * Use {@link #mergeDelayError(SingleSource, SingleSource, SingleSource, SingleSource)} to merge sources and terminate only when all source {@code SingleSource}s @@ -1132,14 +1164,15 @@ public static Flowable merge( * * @param the common value type * @param source1 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source2 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source3 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source4 - * a SingleSource to be merged - * @return a Flowable that emits all of the items emitted by the source Singles + * a {@code SingleSource} to be merged + * @return the new {@code Flowable} that emits all of the items emitted by the source {@code SingleSource}s + * @throws NullPointerException if {@code source1}, {@code source2}, {@code source3} or {@code source4} is {@code null} * @see ReactiveX operators documentation: Merge * @see #mergeDelayError(SingleSource, SingleSource, SingleSource, SingleSource) */ @@ -1159,8 +1192,8 @@ public static Flowable merge( } /** - * Merges an Iterable sequence of SingleSource instances into a single Flowable sequence, - * running all SingleSources at once and delaying any error(s) until all sources succeed or fail. + * Merges an {@link Iterable} sequence of {@link SingleSource} instances into one {@link Flowable} sequence, + * running all {@code SingleSource}s at once and delaying any error(s) until all sources succeed or fail. *

* *

@@ -1171,8 +1204,9 @@ public static Flowable merge( *
*

History: 2.1.9 - experimental * @param the common and resulting value type - * @param sources the Iterable sequence of SingleSource sources - * @return the new Flowable instance + * @param sources the {@code Iterable} sequence of {@code SingleSource}s + * @return the new {@code Flowable} instance + * @throws NullPointerException if {@code sources} is {@code null} * @see #merge(Iterable) * @since 2.2 */ @@ -1185,8 +1219,8 @@ public static Flowable mergeDelayError(@NonNull Iterable * *

@@ -1197,10 +1231,11 @@ public static Flowable mergeDelayError(@NonNull Iterable *

History: 2.1.9 - experimental * @param the common and resulting value type - * @param sources the Flowable sequence of SingleSource sources - * @return the new Flowable instance - * @see #merge(Publisher) + * @param sources the {@code Flowable} sequence of {@code SingleSource}s + * @return the new {@code Flowable} instance + * @throws NullPointerException if {@code sources} is {@code null} * @since 2.2 + * @see #merge(Publisher) */ @CheckReturnValue @NonNull @@ -1213,12 +1248,12 @@ public static Flowable mergeDelayError(@NonNull Publisher * *

- * You can combine items emitted by multiple Singles so that they appear as a single Flowable, by + * You can combine items emitted by multiple {@code SingleSource}s so that they appear as one {@code Flowable}, by * using the {@code mergeDelayError} method. *

*
Backpressure:
@@ -1229,10 +1264,11 @@ public static Flowable mergeDelayError(@NonNull PublisherHistory: 2.1.9 - experimental * @param the common value type * @param source1 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source2 - * a SingleSource to be merged - * @return a Flowable that emits all of the items emitted by the source Singles + * a {@code SingleSource} to be merged + * @return the new {@code Flowable} that emits all of the items emitted by the source {@code SingleSource}s + * @throws NullPointerException if {@code source1} or {@code source2} is {@code null} * @see ReactiveX operators documentation: Merge * @see #merge(SingleSource, SingleSource) * @since 2.2 @@ -1250,12 +1286,12 @@ public static Flowable mergeDelayError( } /** - * Flattens three Singles into a single Flowable, without any transformation, delaying + * Flattens two {@link SingleSource}s into one {@link Flowable}, without any transformation, delaying * any error(s) until all sources succeed or fail. *

* *

- * You can combine items emitted by multiple Singles so that they appear as a single Flowable, by using + * You can combine items emitted by multiple {@code SingleSource}s so that they appear as one {@code Flowable}, by * the {@code mergeDelayError} method. *

*
Backpressure:
@@ -1266,12 +1302,13 @@ public static Flowable mergeDelayError( *

History: 2.1.9 - experimental * @param the common value type * @param source1 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source2 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source3 - * a SingleSource to be merged - * @return a Flowable that emits all of the items emitted by the source Singles + * a {@code SingleSource} to be merged + * @return the new {@code Flowable} that emits all of the items emitted by the source {@code SingleSource}s + * @throws NullPointerException if {@code source1}, {@code source2} or {@code source3} is {@code null} * @see ReactiveX operators documentation: Merge * @see #merge(SingleSource, SingleSource, SingleSource) * @since 2.2 @@ -1291,12 +1328,12 @@ public static Flowable mergeDelayError( } /** - * Flattens four Singles into a single Flowable, without any transformation, delaying + * Flattens two {@link SingleSource}s into one {@link Flowable}, without any transformation, delaying * any error(s) until all sources succeed or fail. *

* *

- * You can combine items emitted by multiple Singles so that they appear as a single Flowable, by using + * You can combine items emitted by multiple {@code SingleSource}s so that they appear as one {@code Flowable}, by * the {@code mergeDelayError} method. *

*
Backpressure:
@@ -1307,14 +1344,15 @@ public static Flowable mergeDelayError( *

History: 2.1.9 - experimental * @param the common value type * @param source1 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source2 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source3 - * a SingleSource to be merged + * a {@code SingleSource} to be merged * @param source4 - * a SingleSource to be merged - * @return a Flowable that emits all of the items emitted by the source Singles + * a {@code SingleSource} to be merged + * @return the new {@code Flowable} that emits all of the items emitted by the source {@code SingleSource}s + * @throws NullPointerException if {@code source1}, {@code source2}, {@code source3} or {@code source4} is {@code null} * @see ReactiveX operators documentation: Merge * @see #merge(SingleSource, SingleSource, SingleSource, SingleSource) * @since 2.2 @@ -1335,7 +1373,7 @@ public static Flowable mergeDelayError( } /** - * Returns a singleton instance of a never-signaling Single (only calls onSubscribe). + * Returns a singleton instance of a never-signaling {@code Single} (only calls {@code onSubscribe}). *

* *

@@ -1355,7 +1393,7 @@ public static Single never() { } /** - * Signals success with 0L value after the given delay for each SingleObserver. + * Signals success with 0L value after the given delay when a {@link SingleObserver} subscribes. *

* *

@@ -1364,7 +1402,7 @@ public static Single never() { *
* @param delay the delay amount * @param unit the time unit of the delay - * @return the new Single instance + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -1375,20 +1413,21 @@ public static Single timer(long delay, @NonNull TimeUnit unit) { } /** - * Signals success with 0L value after the given delay for each SingleObserver. + * Signals success with 0L value on the specified {@link Scheduler} after the given + * delay when a {@link SingleObserver} subscribes. *

* *

*
Scheduler:
- *
you specify the {@link Scheduler} to signal on.
+ *
you specify the {@code Scheduler} to signal on.
*
* @param delay the delay amount * @param unit the time unit of the delay - * @param scheduler the scheduler where the single 0L will be emitted - * @return the new Single instance + * @param scheduler the {@code Scheduler} where the single 0L will be emitted + * @return the new {@code Single} instance * @throws NullPointerException - * if unit is null, or - * if scheduler is null + * if {@code unit} is {@code null}, or + * if {@code scheduler} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -1401,7 +1440,7 @@ public static Single timer(long delay, @NonNull TimeUnit unit, @NonNull Sc } /** - * Compares two SingleSources and emits true if they emit the same value (compared via Object.equals). + * Compares two {@link SingleSource}s and emits {@code true} if they emit the same value (compared via {@link Object#equals(Object)}). *

* *

@@ -1409,9 +1448,10 @@ public static Single timer(long delay, @NonNull TimeUnit unit, @NonNull Sc *
{@code equals} does not operate by default on a particular {@link Scheduler}.
*
* @param the common value type - * @param first the first SingleSource instance - * @param second the second SingleSource instance - * @return the new Single instance + * @param first the first {@code SingleSource} instance + * @param second the second {@code SingleSource} instance + * @return the new {@code Single} instance + * @throws NullPointerException if {@code first} or {@code second} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -1424,8 +1464,8 @@ public static Single equals(@NonNull SingleSource firs } /** - * Advanced use only: creates a Single instance without - * any safeguards by using a callback that is called with a SingleObserver. + * Advanced use only: creates a {@code Single} instance without + * any safeguards by using a callback that is called with a {@link SingleObserver}. *

* *

@@ -1433,8 +1473,9 @@ public static Single equals(@NonNull SingleSource firs *
{@code unsafeCreate} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type - * @param onSubscribe the function that is called with the subscribing SingleObserver - * @return the new Single instance + * @param onSubscribe the function that is called with the subscribing {@code SingleObserver} + * @return the new {@code Single} instance + * @throws NullPointerException if {@code onSubscribe} is {@code null} * @throws IllegalArgumentException if {@code source} is a subclass of {@code Single}; such * instances don't need conversion and is possibly a port remnant from 1.x or one should use {@link #hide()} * instead. @@ -1452,7 +1493,7 @@ public static Single unsafeCreate(@NonNull SingleSource onSubscribe) { } /** - * Allows using and disposing a resource while running a SingleSource instance generated from + * Allows using and disposing a resource while running a {@link SingleSource} instance generated from * that resource (similar to a try-with-resources). *

* @@ -1460,16 +1501,16 @@ public static Single unsafeCreate(@NonNull SingleSource onSubscribe) { *

Scheduler:
*
{@code using} does not operate by default on a particular {@link Scheduler}.
*
- * @param the value type of the SingleSource generated + * @param the value type of the {@code SingleSource} generated * @param the resource type - * @param resourceSupplier the Supplier called for each SingleObserver to generate a resource Object + * @param resourceSupplier the {@link Supplier} called for each {@link SingleObserver} to generate a resource object * @param singleFunction the function called with the returned resource - * Object from {@code resourceSupplier} and should return a SingleSource instance + * object from {@code resourceSupplier} and should return a {@code SingleSource} instance * to be run by the operator * @param disposer the consumer of the generated resource that is called exactly once for - * that particular resource when the generated SingleSource terminates + * that particular resource when the generated {@code SingleSource} terminates * (successfully or with an error) or gets disposed. - * @return the new Single instance + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -1482,7 +1523,7 @@ public static Single using(@NonNull Supplier resourceSupplier, } /** - * Allows using and disposing a resource while running a SingleSource instance generated from + * Allows using and disposing a resource while running a {@link SingleSource} instance generated from * that resource (similar to a try-with-resources). *

* @@ -1490,21 +1531,22 @@ public static Single using(@NonNull Supplier resourceSupplier, *

Scheduler:
*
{@code using} does not operate by default on a particular {@link Scheduler}.
*
- * @param the value type of the SingleSource generated + * @param the value type of the {@code SingleSource} generated * @param the resource type - * @param resourceSupplier the Supplier called for each SingleObserver to generate a resource Object + * @param resourceSupplier the {@link Supplier} called for each {@link SingleObserver} to generate a resource object * @param singleFunction the function called with the returned resource - * Object from {@code resourceSupplier} and should return a SingleSource instance + * object from {@code resourceSupplier} and should return a {@code SingleSource} instance * to be run by the operator * @param disposer the consumer of the generated resource that is called exactly once for - * that particular resource when the generated SingleSource terminates + * that particular resource when the generated {@code SingleSource} terminates * (successfully or with an error) or gets disposed. * @param eager * If {@code true} then resource disposal will happen either on a {@code dispose()} call before the upstream is disposed * or just before the emission of a terminal event ({@code onSuccess} or {@code onError}). * If {@code false} the resource disposal will happen either on a {@code dispose()} call after the upstream is disposed * or just after the emission of a terminal event ({@code onSuccess} or {@code onError}). - * @return the new Single instance + * @return the new {@code Single} instance + * @throws NullPointerException if {@code resourceSupplier}, {@code singleFunction} or {@code disposer} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -1523,7 +1565,7 @@ public static Single using( } /** - * Wraps a SingleSource instance into a new Single instance if not already a Single + * Wraps a {@link SingleSource} instance into a new {@code Single} instance if not already a {@code Single} * instance. *

* @@ -1533,7 +1575,8 @@ public static Single using( *

* @param the value type * @param source the source to wrap - * @return the Single wrapper or the source cast to Single (if possible) + * @return the {@code Single} wrapper or the source cast to {@code Single} (if possible) + * @throws NullPointerException if {@code source} is {@code null} */ @CheckReturnValue @NonNull @@ -1547,20 +1590,20 @@ public static Single wrap(@NonNull SingleSource source) { } /** - * Waits until all SingleSource sources provided by the Iterable sequence signal a success + * Waits until all {@link SingleSource} sources provided by the {@link Iterable} sequence signal a success * value and calls a zipper function with an array of these values to return a result - * to be emitted to downstream. + * to be emitted to the downstream. *

- * If the {@code Iterable} of {@link SingleSource}s is empty a {@link NoSuchElementException} error is signalled after subscription. + * If the {@code Iterable} of {@code SingleSource}s is empty a {@link NoSuchElementException} error is signaled after subscription. *

* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the * implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a - * {@code Function} passed to the method would trigger a {@code ClassCastException}. + * {@code Function} passed to the method would trigger a {@link ClassCastException}. * *

* *

- * If any of the SingleSources signal an error, all other SingleSources get disposed and the + * If any of the {@code SingleSources} signal an error, all other {@code SingleSource}s get disposed and the * error emitted to downstream immediately. *

*
Scheduler:
@@ -1568,25 +1611,27 @@ public static Single wrap(@NonNull SingleSource source) { *
* @param the common value type * @param the result value type - * @param sources the Iterable sequence of SingleSource instances. An empty sequence will result in an - * {@code onError} signal of {@link NoSuchElementException}. - * @param zipper the function that receives an array with values from each SingleSource + * @param sources the {@code Iterable} sequence of {@code SingleSource} instances. An empty sequence will result in an + * {@code onError} signal of {@code NoSuchElementException}. + * @param zipper the function that receives an array with values from each {@code SingleSource} * and should return a value to be emitted to downstream - * @return the new Single instance + * @return the new {@code Single} instance + * @throws NullPointerException if {@code zipper} or {@code sources} is {@code null} * @since 2.0 */ @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single zip(@NonNull Iterable> sources, @NonNull Function zipper) { + public static Single zip(@NonNull Iterable> sources, + @NonNull Function zipper) { Objects.requireNonNull(zipper, "zipper is null"); Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new SingleZipIterable<>(sources, zipper)); } /** - * Returns a Single that emits the results of a specified combiner function applied to two items emitted by - * two other Singles. + * Returns a {@code Single} that emits the results of a specified combiner function applied to two items emitted by + * two other {@link SingleSource}s. *

* *

@@ -1594,17 +1639,18 @@ public static Single zip(@NonNull Iterable{@code zip} does not operate by default on a particular {@link Scheduler}.
*
* - * @param the first source Single's value type - * @param the second source Single's value type + * @param the first source {@code SingleSource}'s value type + * @param the second source {@code SingleSource}'s value type * @param the result value type * @param source1 - * the first source Single + * the first source {@code SingleSource} * @param source2 - * a second source Single + * a second source {@code SingleSource} * @param zipper - * a function that, when applied to the item emitted by each of the source Singles, results in an - * item that will be emitted by the resulting Single - * @return a Single that emits the zipped results + * a function that, when applied to the item emitted by each of the source {@code SingleSource}s, results in an + * item that will be emitted by the resulting {@code Single} + * @return the new {@code Single} that emits the zipped results + * @throws NullPointerException if {@code source1}, {@code source2} or {@code zipper} is {@code null} * @see ReactiveX operators documentation: Zip */ @CheckReturnValue @@ -1621,8 +1667,8 @@ public static Single zip( } /** - * Returns a Single that emits the results of a specified combiner function applied to three items emitted - * by three other Singles. + * Returns a {@code Single} that emits the results of a specified combiner function applied to three items emitted + * by three other {@link SingleSource}s. *

* *

@@ -1630,20 +1676,21 @@ public static Single zip( *
{@code zip} does not operate by default on a particular {@link Scheduler}.
*
* - * @param the first source Single's value type - * @param the second source Single's value type - * @param the third source Single's value type + * @param the first source {@code SingleSource}'s value type + * @param the second source {@code SingleSource}'s value type + * @param the third source {@code SingleSource}'s value type * @param the result value type * @param source1 - * the first source Single + * the first source {@code SingleSource} * @param source2 - * a second source Single + * a second source {@code SingleSource} * @param source3 - * a third source Single + * a third source {@code SingleSource} * @param zipper - * a function that, when applied to the item emitted by each of the source Singles, results in an - * item that will be emitted by the resulting Single - * @return a Single that emits the zipped results + * a function that, when applied to the item emitted by each of the source {@code SingleSource}s, results in an + * item that will be emitted by the resulting {@code Single} + * @return the new {@code Single} that emits the zipped results + * @throws NullPointerException if {@code source1}, {@code source2}, {@code source3} or {@code zipper} is {@code null} * @see ReactiveX operators documentation: Zip */ @CheckReturnValue @@ -1662,8 +1709,8 @@ public static Single zip( } /** - * Returns a Single that emits the results of a specified combiner function applied to four items - * emitted by four other Singles. + * Returns a {@code Single} that emits the results of a specified combiner function applied to four items + * emitted by four other {@link SingleSource}s. *

* *

@@ -1671,23 +1718,24 @@ public static Single zip( *
{@code zip} does not operate by default on a particular {@link Scheduler}.
*
* - * @param the first source Single's value type - * @param the second source Single's value type - * @param the third source Single's value type - * @param the fourth source Single's value type + * @param the first source {@code SingleSource}'s value type + * @param the second source {@code SingleSource}'s value type + * @param the third source {@code SingleSource}'s value type + * @param the fourth source {@code SingleSource}'s value type * @param the result value type * @param source1 - * the first source Single + * the first source {@code SingleSource} * @param source2 - * a second source Single + * a second source {@code SingleSource} * @param source3 - * a third source Single + * a third source {@code SingleSource} * @param source4 - * a fourth source Single + * a fourth source {@code SingleSource} * @param zipper - * a function that, when applied to the item emitted by each of the source Singles, results in an - * item that will be emitted by the resulting Single - * @return a Single that emits the zipped results + * a function that, when applied to the item emitted by each of the source {@code SingleSource}s, results in an + * item that will be emitted by the resulting {@code Single} + * @return the new {@code Single} that emits the zipped results + * @throws NullPointerException if {@code source1}, {@code source2}, {@code source3}, {@code source4} or {@code zipper} is {@code null} * @see ReactiveX operators documentation: Zip */ @CheckReturnValue @@ -1707,8 +1755,8 @@ public static Single zip( } /** - * Returns a Single that emits the results of a specified combiner function applied to five items - * emitted by five other Singles. + * Returns a {@code Single} that emits the results of a specified combiner function applied to five items + * emitted by five other {@link SingleSource}s. *

* *

@@ -1716,26 +1764,28 @@ public static Single zip( *
{@code zip} does not operate by default on a particular {@link Scheduler}.
*
* - * @param the first source Single's value type - * @param the second source Single's value type - * @param the third source Single's value type - * @param the fourth source Single's value type - * @param the fifth source Single's value type + * @param the first source {@code SingleSource}'s value type + * @param the second source {@code SingleSource}'s value type + * @param the third source {@code SingleSource}'s value type + * @param the fourth source {@code SingleSource}'s value type + * @param the fifth source {@code SingleSource}'s value type * @param the result value type * @param source1 - * the first source Single + * the first source {@code SingleSource} * @param source2 - * a second source Single + * a second source {@code SingleSource} * @param source3 - * a third source Single + * a third source {@code SingleSource} * @param source4 - * a fourth source Single + * a fourth source {@code SingleSource} * @param source5 - * a fifth source Single + * a fifth source {@code SingleSource} * @param zipper - * a function that, when applied to the item emitted by each of the source Singles, results in an - * item that will be emitted by the resulting Single - * @return a Single that emits the zipped results + * a function that, when applied to the item emitted by each of the source {@code SingleSource}s, results in an + * item that will be emitted by the resulting {@code Single} + * @return the new {@code Single} that emits the zipped results + * @throws NullPointerException if {@code source1}, {@code source2}, {@code source3}, {@code source4} + * {@code source5} or {@code zipper} is {@code null} * @see ReactiveX operators documentation: Zip */ @CheckReturnValue @@ -1757,8 +1807,8 @@ public static Single zip( } /** - * Returns a Single that emits the results of a specified combiner function applied to six items - * emitted by six other Singles. + * Returns a {@code Single} that emits the results of a specified combiner function applied to six items + * emitted by six other {@link SingleSource}s. *

* *

@@ -1766,29 +1816,31 @@ public static Single zip( *
{@code zip} does not operate by default on a particular {@link Scheduler}.
*
* - * @param the first source Single's value type - * @param the second source Single's value type - * @param the third source Single's value type - * @param the fourth source Single's value type - * @param the fifth source Single's value type - * @param the sixth source Single's value type + * @param the first source {@code SingleSource}'s value type + * @param the second source {@code SingleSource}'s value type + * @param the third source {@code SingleSource}'s value type + * @param the fourth source {@code SingleSource}'s value type + * @param the fifth source {@code SingleSource}'s value type + * @param the sixth source {@code SingleSource}'s value type * @param the result value type * @param source1 - * the first source Single + * the first source {@code SingleSource} * @param source2 - * a second source Single + * a second source {@code SingleSource} * @param source3 - * a third source Single + * a third source {@code SingleSource} * @param source4 - * a fourth source Single + * a fourth source {@code SingleSource} * @param source5 - * a fifth source Single + * a fifth source {@code SingleSource} * @param source6 - * a sixth source Single + * a sixth source {@code SingleSource} * @param zipper - * a function that, when applied to the item emitted by each of the source Singles, results in an - * item that will be emitted by the resulting Single - * @return a Single that emits the zipped results + * a function that, when applied to the item emitted by each of the source {@code SingleSource}s, results in an + * item that will be emitted by the resulting {@code Single} + * @return the new {@code Single} that emits the zipped results + * @throws NullPointerException if {@code source1}, {@code source2}, {@code source3}, {@code source4} + * {@code source5}, {@code source6} or {@code zipper} is {@code null} * @see ReactiveX operators documentation: Zip */ @CheckReturnValue @@ -1811,8 +1863,8 @@ public static Single zip( } /** - * Returns a Single that emits the results of a specified combiner function applied to seven items - * emitted by seven other Singles. + * Returns a {@code Single} that emits the results of a specified combiner function applied to seven items + * emitted by seven other {@link SingleSource}s. *

* *

@@ -1820,32 +1872,34 @@ public static Single zip( *
{@code zip} does not operate by default on a particular {@link Scheduler}.
*
* - * @param the first source Single's value type - * @param the second source Single's value type - * @param the third source Single's value type - * @param the fourth source Single's value type - * @param the fifth source Single's value type - * @param the sixth source Single's value type - * @param the seventh source Single's value type + * @param the first source {@code SingleSource}'s value type + * @param the second source {@code SingleSource}'s value type + * @param the third source {@code SingleSource}'s value type + * @param the fourth source {@code SingleSource}'s value type + * @param the fifth source {@code SingleSource}'s value type + * @param the sixth source {@code SingleSource}'s value type + * @param the seventh source {@code SingleSource}'s value type * @param the result value type * @param source1 - * the first source Single + * the first source {@code SingleSource} * @param source2 - * a second source Single + * a second source {@code SingleSource} * @param source3 - * a third source Single + * a third source {@code SingleSource} * @param source4 - * a fourth source Single + * a fourth source {@code SingleSource} * @param source5 - * a fifth source Single + * a fifth source {@code SingleSource} * @param source6 - * a sixth source Single + * a sixth source {@code SingleSource} * @param source7 - * a seventh source Single + * a seventh source {@code SingleSource} * @param zipper - * a function that, when applied to the item emitted by each of the source Singles, results in an - * item that will be emitted by the resulting Single - * @return a Single that emits the zipped results + * a function that, when applied to the item emitted by each of the source {@code SingleSource}s, results in an + * item that will be emitted by the resulting {@code Single} + * @return the new {@code Single} that emits the zipped results + * @throws NullPointerException if {@code source1}, {@code source2}, {@code source3}, {@code source4} + * {@code source5}, {@code source6}, {@code source7} or {@code zipper} is {@code null} * @see ReactiveX operators documentation: Zip */ @CheckReturnValue @@ -1870,8 +1924,8 @@ public static Single zip( } /** - * Returns a Single that emits the results of a specified combiner function applied to eight items - * emitted by eight other Singles. + * Returns a {@code Single} that emits the results of a specified combiner function applied to eight items + * emitted by eight other {@link SingleSource}s. *

* *

@@ -1879,35 +1933,37 @@ public static Single zip( *
{@code zip} does not operate by default on a particular {@link Scheduler}.
*
* - * @param the first source Single's value type - * @param the second source Single's value type - * @param the third source Single's value type - * @param the fourth source Single's value type - * @param the fifth source Single's value type - * @param the sixth source Single's value type - * @param the seventh source Single's value type - * @param the eighth source Single's value type + * @param the first source {@code SingleSource}'s value type + * @param the second source {@code SingleSource}'s value type + * @param the third source {@code SingleSource}'s value type + * @param the fourth source {@code SingleSource}'s value type + * @param the fifth source {@code SingleSource}'s value type + * @param the sixth source {@code SingleSource}'s value type + * @param the seventh source {@code SingleSource}'s value type + * @param the eighth source {@code SingleSource}'s value type * @param the result value type * @param source1 - * the first source Single + * the first source {@code SingleSource} * @param source2 - * a second source Single + * a second source {@code SingleSource} * @param source3 - * a third source Single + * a third source {@code SingleSource} * @param source4 - * a fourth source Single + * a fourth source {@code SingleSource} * @param source5 - * a fifth source Single + * a fifth source {@code SingleSource} * @param source6 - * a sixth source Single + * a sixth source {@code SingleSource} * @param source7 - * a seventh source Single + * a seventh source {@code SingleSource} * @param source8 - * an eighth source Single + * an eighth source {@code SingleSource} * @param zipper - * a function that, when applied to the item emitted by each of the source Singles, results in an - * item that will be emitted by the resulting Single - * @return a Single that emits the zipped results + * a function that, when applied to the item emitted by each of the source {@code SingleSource}s, results in an + * item that will be emitted by the resulting {@code Single} + * @return the new {@code Single} that emits the zipped results + * @throws NullPointerException if {@code source1}, {@code source2}, {@code source3}, {@code source4} + * {@code source5}, {@code source6}, {@code source7}, {@code source8} or {@code zipper} is {@code null} * @see ReactiveX operators documentation: Zip */ @CheckReturnValue @@ -1933,8 +1989,8 @@ public static Single zip( } /** - * Returns a Single that emits the results of a specified combiner function applied to nine items - * emitted by nine other Singles. + * Returns a {@code Single} that emits the results of a specified combiner function applied to nine items + * emitted by nine other {@link SingleSource}s. *

* *

@@ -1942,38 +1998,41 @@ public static Single zip( *
{@code zip} does not operate by default on a particular {@link Scheduler}.
*
* - * @param the first source Single's value type - * @param the second source Single's value type - * @param the third source Single's value type - * @param the fourth source Single's value type - * @param the fifth source Single's value type - * @param the sixth source Single's value type - * @param the seventh source Single's value type - * @param the eighth source Single's value type - * @param the ninth source Single's value type + * @param the first source {@code SingleSource}'s value type + * @param the second source {@code SingleSource}'s value type + * @param the third source {@code SingleSource}'s value type + * @param the fourth source {@code SingleSource}'s value type + * @param the fifth source {@code SingleSource}'s value type + * @param the sixth source {@code SingleSource}'s value type + * @param the seventh source {@code SingleSource}'s value type + * @param the eighth source {@code SingleSource}'s value type + * @param the ninth source {@code SingleSource}'s value type * @param the result value type * @param source1 - * the first source Single + * the first source {@code SingleSource} * @param source2 - * a second source Single + * a second source {@code SingleSource} * @param source3 - * a third source Single + * a third source {@code SingleSource} * @param source4 - * a fourth source Single + * a fourth source {@code SingleSource} * @param source5 - * a fifth source Single + * a fifth source {@code SingleSource} * @param source6 - * a sixth source Single + * a sixth source {@code SingleSource} * @param source7 - * a seventh source Single + * a seventh source {@code SingleSource} * @param source8 - * an eighth source Single + * an eighth source {@code SingleSource} * @param source9 - * a ninth source Single + * a ninth source {@code SingleSource} * @param zipper - * a function that, when applied to the item emitted by each of the source Singles, results in an - * item that will be emitted by the resulting Single - * @return a Single that emits the zipped results + * a function that, when applied to the item emitted by each of the source {@code SingleSource}s, results in an + * item that will be emitted by the resulting {@code Single} + * @return the new {@code Single} that emits the zipped results + * @throws NullPointerException if {@code source1}, {@code source2}, {@code source3}, {@code source4} + * {@code source5}, {@code source6}, {@code source7}, {@code source8}, + * {@code source9} or {@code zipper} is {@code null} * @see ReactiveX operators documentation: Zip */ @CheckReturnValue @@ -2001,19 +2060,19 @@ public static Single zip( } /** - * Waits until all SingleSource sources provided via an array signal a success + * Waits until all {@link SingleSource} sources provided via an array signal a success * value and calls a zipper function with an array of these values to return a result * to be emitted to downstream. *

* *

- * If the array of {@link SingleSource}s is empty a {@link NoSuchElementException} error is signalled immediately. + * If the array of {@code SingleSource}s is empty a {@link NoSuchElementException} error is signaled immediately. *

* Note on method signature: since Java doesn't allow creating a generic array with {@code new T[]}, the * implementation of this operator has to create an {@code Object[]} instead. Unfortunately, a - * {@code Function} passed to the method would trigger a {@code ClassCastException}. + * {@code Function} passed to the method would trigger a {@link ClassCastException}. *

- * If any of the SingleSources signal an error, all other SingleSources get disposed and the + * If any of the {@code SingleSource}s signal an error, all other {@code SingleSource}s get disposed and the * error emitted to downstream immediately. *

*
Scheduler:
@@ -2021,11 +2080,12 @@ public static Single zip( *
* @param the common value type * @param the result value type - * @param sources the array of SingleSource instances. An empty sequence will result in an - * {@code onError} signal of {@link NoSuchElementException}. - * @param zipper the function that receives an array with values from each SingleSource + * @param sources the array of {@code SingleSource} instances. An empty sequence will result in an + * {@code onError} signal of {@code NoSuchElementException}. + * @param zipper the function that receives an array with values from each {@code SingleSource} * and should return a value to be emitted to downstream - * @return the new Single instance + * @return the new {@code Single} instance + * @throws NullPointerException if {@code zipper} or {@code sources} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2042,16 +2102,17 @@ public static Single zipArray(@NonNull Function * *
*
Scheduler:
*
{@code ambWith} does not operate by default on a particular {@link Scheduler}.
*
- * @param other the other SingleSource to race for the first emission of success or error - * @return the new Single instance. A subscription to this provided source will occur after subscribing + * @param other the other {@code SingleSource} to race for the first emission of success or error + * @return the new {@code Single} instance. A subscription to this provided source will occur after subscribing * to the current source. + * @throws NullPointerException if {@code other} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2063,7 +2124,7 @@ public final Single ambWith(@NonNull SingleSource other) { } /** - * Hides the identity of the current Single, including the Disposable that is sent + * Hides the identity of the current {@code Single}, including the {@link Disposable} that is sent * to the downstream via {@code onSubscribe()}. *

* @@ -2071,7 +2132,7 @@ public final Single ambWith(@NonNull SingleSource other) { *

Scheduler:
*
{@code hide} does not operate by default on a particular {@link Scheduler}.
*
- * @return the new Single instance + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -2082,14 +2143,14 @@ public final Single hide() { } /** - * Transform a Single by applying a particular Transformer function to it. + * Transform a {@code Single} by applying a particular {@link SingleTransformer} function to it. *

* *

- * This method operates on the Single itself whereas {@link #lift} operates on the Single's SingleObservers. + * This method operates on the {@code Single} itself whereas {@link #lift} operates on {@link SingleObserver}s. *

- * If the operator you are creating is designed to act on the individual item emitted by a Single, use - * {@link #lift}. If your operator is designed to transform the source Single as a whole (for instance, by + * If the operator you are creating is designed to act on the individual item emitted by a {@code Single}, use + * {@link #lift}. If your operator is designed to transform the source {@code Single} as a whole (for instance, by * applying a particular set of existing RxJava operators to it) use {@code compose}. *

*
Scheduler:
@@ -2097,8 +2158,9 @@ public final Single hide() { *
* * @param the value type of the single returned by the transformer function - * @param transformer the transformer function, not null - * @return the source Single, transformed by the transformer function + * @param transformer the transformer function, not {@code null} + * @return a {@code Single} wrapped and returned by the transformer function + * @throws NullPointerException if {@code transformer} is {@code null} * @see RxJava wiki: Implementing Your Own Operators */ @SuppressWarnings("unchecked") @@ -2110,17 +2172,17 @@ public final Single compose(@NonNull SingleTransformer * *

- * The returned Single subscribes to the current Single when the first SingleObserver subscribes. + * The returned {@code Single} subscribes to the current {@code Single} when the first {@code SingleObserver} subscribes. *

*
Scheduler:
*
{@code cache} does not operate by default on a particular {@link Scheduler}.
*
* - * @return the new Single instance + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -2131,8 +2193,8 @@ public final Single cache() { } /** - * Casts the success value of the current Single into the target type or signals a - * ClassCastException if not compatible. + * Casts the success value of the current {@code Single} into the target type or signals a + * {@link ClassCastException} if not compatible. *

* *

@@ -2140,8 +2202,9 @@ public final Single cache() { *
{@code cast} does not operate by default on a particular {@link Scheduler}.
*
* @param the target type - * @param clazz the type token to use for casting the success result from the current Single - * @return the new Single instance + * @param clazz the type token to use for casting the success result from the current {@code Single} + * @return the new {@code Single} instance + * @throws NullPointerException if {@code clazz} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2153,8 +2216,8 @@ public final Single cast(@NonNull Class clazz) { } /** - * Returns a Flowable that emits the item emitted by the source Single, then the item emitted by the - * specified Single. + * Returns a {@link Flowable} that emits the item emitted by the source {@code Single}, then the item emitted by the + * specified {@link SingleSource}. *

* *

@@ -2165,9 +2228,10 @@ public final Single cast(@NonNull Class clazz) { *
* * @param other - * a Single to be concatenated after the current - * @return a Flowable that emits the item emitted by the source Single, followed by the item emitted by - * {@code t1} + * a {@code SingleSource} to be concatenated after the current + * @return the new {@code Flowable} that emits the item emitted by the source {@code Single}, followed by the item emitted by + * {@code other} + * @throws NullPointerException if {@code other} is {@code null} * @see ReactiveX operators documentation: Concat */ @BackpressureSupport(BackpressureKind.FULL) @@ -2179,7 +2243,7 @@ public final Flowable concatWith(@NonNull SingleSource other) { } /** - * Delays the emission of the success signal from the current Single by the specified amount. + * Delays the emission of the success signal from the current {@code Single} by the specified amount. * An error signal will not be delayed. *

* @@ -2190,8 +2254,9 @@ public final Flowable concatWith(@NonNull SingleSource other) { * * @param time the amount of time the success signal should be delayed for * @param unit the time unit - * @return the new Single instance + * @return the new {@code Single} instance * @since 2.0 + * @see #delay(long, TimeUnit, boolean) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.COMPUTATION) @@ -2201,7 +2266,7 @@ public final Single delay(long time, @NonNull TimeUnit unit) { } /** - * Delays the emission of the success or error signal from the current Single by the specified amount. + * Delays the emission of the success or error signal from the current {@code Single} by the specified amount. *

* *

@@ -2211,8 +2276,8 @@ public final Single delay(long time, @NonNull TimeUnit unit) { *

History: 2.1.5 - experimental * @param time the amount of time the success or error signal should be delayed for * @param unit the time unit - * @param delayError if true, both success and error signals are delayed. if false, only success signals are delayed. - * @return the new Single instance + * @param delayError if {@code true}, both success and error signals are delayed. if {@code false}, only success signals are delayed. + * @return the new {@code Single} instance * @since 2.2 */ @CheckReturnValue @@ -2223,7 +2288,7 @@ public final Single delay(long time, @NonNull TimeUnit unit, boolean delayErr } /** - * Delays the emission of the success signal from the current Single by the specified amount. + * Delays the emission of the success signal from the current {@code Single} by the specified amount. * An error signal will not be delayed. *

* @@ -2235,11 +2300,12 @@ public final Single delay(long time, @NonNull TimeUnit unit, boolean delayErr * @param time the amount of time the success signal should be delayed for * @param unit the time unit * @param scheduler the target scheduler to use for the non-blocking wait and emission - * @return the new Single instance + * @return the new {@code Single} instance * @throws NullPointerException - * if unit is null, or - * if scheduler is null + * if {@code unit} is {@code null}, or + * if {@code scheduler} is {@code null} * @since 2.0 + * @see #delay(long, TimeUnit, Scheduler, boolean) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) @@ -2249,7 +2315,7 @@ public final Single delay(long time, @NonNull TimeUnit unit, @NonNull Schedul } /** - * Delays the emission of the success or error signal from the current Single by the specified amount. + * Delays the emission of the success or error signal from the current {@code Single} by the specified amount. *

* *

@@ -2260,11 +2326,11 @@ public final Single delay(long time, @NonNull TimeUnit unit, @NonNull Schedul * @param time the amount of time the success or error signal should be delayed for * @param unit the time unit * @param scheduler the target scheduler to use for the non-blocking wait and emission - * @param delayError if true, both success and error signals are delayed. if false, only success signals are delayed. - * @return the new Single instance + * @param delayError if {@code true}, both success and error signals are delayed. if {@code false}, only success signals are delayed. + * @return the new {@code Single} instance * @throws NullPointerException - * if unit is null, or - * if scheduler is null + * if {@code unit} is {@code null}, or + * if {@code scheduler} is {@code null} * @since 2.2 */ @CheckReturnValue @@ -2277,19 +2343,20 @@ public final Single delay(long time, @NonNull TimeUnit unit, @NonNull Schedul } /** - * Delays the actual subscription to the current Single until the given other CompletableSource + * Delays the actual subscription to the current {@code Single} until the given other {@link CompletableSource} * completes. *

* *

If the delaying source signals an error, that error is re-emitted and no subscription - * to the current Single happens. + * to the current {@code Single} happens. *

*
Scheduler:
*
{@code delaySubscription} does not operate by default on a particular {@link Scheduler}.
*
- * @param other the CompletableSource that has to complete before the subscription to the - * current Single happens - * @return the new Single instance + * @param other the {@code CompletableSource} that has to complete before the subscription to the + * current {@code Single} happens + * @return the new {@code Single} instance + * @throws NullPointerException if {@code other} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2301,20 +2368,21 @@ public final Single delaySubscription(@NonNull CompletableSource other) { } /** - * Delays the actual subscription to the current Single until the given other SingleSource + * Delays the actual subscription to the current {@code Single} until the given other {@link SingleSource} * signals success. *

* *

If the delaying source signals an error, that error is re-emitted and no subscription - * to the current Single happens. + * to the current {@code Single} happens. *

*
Scheduler:
*
{@code delaySubscription} does not operate by default on a particular {@link Scheduler}.
*
* @param the element type of the other source - * @param other the SingleSource that has to complete before the subscription to the - * current Single happens - * @return the new Single instance + * @param other the {@code SingleSource} that has to complete before the subscription to the + * current {@code Single} happens + * @return the new {@code Single} instance + * @throws NullPointerException if {@code other} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2326,20 +2394,21 @@ public final Single delaySubscription(@NonNull SingleSource other) { } /** - * Delays the actual subscription to the current Single until the given other ObservableSource + * Delays the actual subscription to the current {@code Single} until the given other {@link ObservableSource} * signals its first value or completes. *

* *

If the delaying source signals an error, that error is re-emitted and no subscription - * to the current Single happens. + * to the current {@code Single} happens. *

*
Scheduler:
*
{@code delaySubscription} does not operate by default on a particular {@link Scheduler}.
*
* @param the element type of the other source - * @param other the ObservableSource that has to signal a value or complete before the - * subscription to the current Single happens - * @return the new Single instance + * @param other the {@code ObservableSource} that has to signal a value or complete before the + * subscription to the current {@code Single} happens + * @return the new {@code Single} instance + * @throws NullPointerException if {@code other} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2351,12 +2420,12 @@ public final Single delaySubscription(@NonNull ObservableSource other) } /** - * Delays the actual subscription to the current Single until the given other Publisher + * Delays the actual subscription to the current {@code Single} until the given other {@link Publisher} * signals its first value or completes. *

* *

If the delaying source signals an error, that error is re-emitted and no subscription - * to the current Single happens. + * to the current {@code Single} happens. *

The other source is consumed in an unbounded manner (requesting {@link Long#MAX_VALUE} from it). *

*
Backpressure:
@@ -2366,9 +2435,10 @@ public final Single delaySubscription(@NonNull ObservableSource other) *
{@code delaySubscription} does not operate by default on a particular {@link Scheduler}.
*
* @param the element type of the other source - * @param other the Publisher that has to signal a value or complete before the - * subscription to the current Single happens - * @return the new Single instance + * @param other the {@code Publisher} that has to signal a value or complete before the + * subscription to the current {@code Single} happens + * @return the new {@code Single} instance + * @throws NullPointerException if {@code other} is {@code null} * @since 2.0 */ @BackpressureSupport(BackpressureKind.FULL) @@ -2381,17 +2451,18 @@ public final Single delaySubscription(@NonNull Publisher other) { } /** - * Delays the actual subscription to the current Single until the given time delay elapsed. + * Delays the actual subscription to the current {@code Single} until the given time delay elapsed. *

* *

*
Scheduler:
- *
{@code delaySubscription} does by default subscribe to the current Single + *
{@code delaySubscription} does by default subscribe to the current {@code Single} * on the {@code computation} {@link Scheduler} after the delay.
*
* @param time the time amount to wait with the subscription * @param unit the time unit of the waiting - * @return the new Single instance + * @return the new {@code Single} instance + * @throws NullPointerException if {@code unit} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2402,18 +2473,18 @@ public final Single delaySubscription(long time, @NonNull TimeUnit unit) { } /** - * Delays the actual subscription to the current Single until the given time delay elapsed. + * Delays the actual subscription to the current {@code Single} until the given time delay elapsed. *

* *

*
Scheduler:
- *
{@code delaySubscription} does by default subscribe to the current Single + *
{@code delaySubscription} does by default subscribe to the current {@code Single} * on the {@link Scheduler} you provided, after the delay.
*
* @param time the time amount to wait with the subscription * @param unit the time unit of the waiting - * @param scheduler the scheduler to wait on and subscribe on to the current Single - * @return the new Single instance + * @param scheduler the {@code Scheduler} to wait on and subscribe on to the current {@code Single} + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -2424,7 +2495,7 @@ public final Single delaySubscription(long time, @NonNull TimeUnit unit, @Non } /** - * Maps the {@link Notification} success value of this Single back into normal + * Maps the {@link Notification} success value of this {@code Single} back into normal * {@code onSuccess}, {@code onError} or {@code onComplete} signals as a * {@link Maybe} source. *

@@ -2450,8 +2521,9 @@ public final Single delaySubscription(long time, @NonNull TimeUnit unit, @Non *

History: 2.2.4 - experimental * @param the result type * @param selector the function called with the success item and should - * return a {@link Notification} instance. - * @return the new Maybe instance + * return a {@code Notification} instance. + * @return the new {@code Maybe} instance + * @throws NullPointerException if {@code selector} is {@code null} * @since 3.0.0 * @see #materialize() */ @@ -2475,8 +2547,9 @@ public final Single delaySubscription(long time, @NonNull TimeUnit unit, @Non *

{@code doAfterSuccess} does not operate by default on a particular {@link Scheduler}.
*
*

History: 2.0.1 - experimental - * @param onAfterSuccess the Consumer that will be called after emitting an item from upstream to the downstream - * @return the new Single instance + * @param onAfterSuccess the {@link Consumer} that will be called after emitting an item from upstream to the downstream + * @return the new {@code Single} instance + * @throws NullPointerException if {@code onAfterSuccess} is {@code null} * @since 2.1 */ @CheckReturnValue @@ -2488,7 +2561,7 @@ public final Single doAfterSuccess(@NonNull Consumer onAfterSucces } /** - * Registers an {@link Action} to be called after this Single invokes either onSuccess or onError. + * Registers an {@link Action} to be called after this {@code Single} invokes either {@code onSuccess} or {@code onError}. *

* *

@@ -2502,9 +2575,10 @@ public final Single doAfterSuccess(@NonNull Consumer onAfterSucces * *

History: 2.0.6 - experimental * @param onAfterTerminate - * an {@link Action} to be invoked when the source Single finishes - * @return a Single that emits the same items as the source Single, then invokes the - * {@link Action} + * an {@code Action} to be invoked when the source {@code Single} finishes + * @return the new {@code Single} that emits the same items as the source {@code Single}, then invokes the + * {@code Action} + * @throws NullPointerException if {@code onAfterTerminate} is {@code null} * @see ReactiveX operators documentation: Do * @since 2.1 */ @@ -2517,7 +2591,7 @@ public final Single doAfterTerminate(@NonNull Action onAfterTerminate) { } /** - * Calls the specified action after this Single signals onSuccess or onError or gets disposed by + * Calls the specified action after this {@code Single} signals {@code onSuccess} or {@code onError} or gets disposed by * the downstream. *

In case of a race between a terminal event and a dispose call, the provided {@code onFinally} action * is executed once per subscription. @@ -2531,8 +2605,9 @@ public final Single doAfterTerminate(@NonNull Action onAfterTerminate) { *

{@code doFinally} does not operate by default on a particular {@link Scheduler}.
*
*

History: 2.0.1 - experimental - * @param onFinally the action called when this Single terminates or gets disposed - * @return the new Single instance + * @param onFinally the action called when this {@code Single} terminates or gets disposed + * @return the new {@code Single} instance + * @throws NullPointerException if {@code onFinally} is {@code null} * @since 2.1 */ @CheckReturnValue @@ -2544,8 +2619,8 @@ public final Single doFinally(@NonNull Action onFinally) { } /** - * Calls the shared consumer with the Disposable sent through the onSubscribe for each - * SingleObserver that subscribes to the current Single. + * Calls the shared consumer with the {@link Disposable} sent through the {@code onSubscribe} for each + * {@link SingleObserver} that subscribes to the current {@code Single}. *

* *

@@ -2553,8 +2628,9 @@ public final Single doFinally(@NonNull Action onFinally) { *
Scheduler:
*
{@code doOnSubscribe} does not operate by default on a particular {@link Scheduler}.
*
- * @param onSubscribe the consumer called with the Disposable sent via onSubscribe - * @return the new Single instance + * @param onSubscribe the consumer called with the {@code Disposable} sent via {@code onSubscribe} + * @return the new {@code Single} instance + * @throws NullPointerException if {@code onSubscribe} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2566,8 +2642,8 @@ public final Single doOnSubscribe(@NonNull Consumer onSub } /** - * Returns a Single instance that calls the given onTerminate callback - * just before this Single completes normally or with an exception. + * Returns a {@code Single} instance that calls the given {@code onTerminate} callback + * just before this {@code Single} completes normally or with an exception. *

* *

@@ -2579,7 +2655,8 @@ public final Single doOnSubscribe(@NonNull Consumer onSub *

*

History: 2.2.7 - experimental * @param onTerminate the action to invoke when the consumer calls {@code onSuccess} or {@code onError} - * @return the new Single instance + * @return the new {@code Single} instance + * @throws NullPointerException if {@code onTerminate} is {@code null} * @see ReactiveX operators documentation: Do * @see #doOnTerminate(Action) * @since 3.0.0 @@ -2593,8 +2670,8 @@ public final Single doOnTerminate(@NonNull Action onTerminate) { } /** - * Calls the shared consumer with the success value sent via onSuccess for each - * SingleObserver that subscribes to the current Single. + * Calls the shared consumer with the success value sent via {@code onSuccess} for each + * {@link SingleObserver} that subscribes to the current {@code Single}. *

* *

@@ -2602,8 +2679,9 @@ public final Single doOnTerminate(@NonNull Action onTerminate) { *
Scheduler:
*
{@code doOnSuccess} does not operate by default on a particular {@link Scheduler}.
* - * @param onSuccess the consumer called with the success value of onSuccess - * @return the new Single instance + * @param onSuccess the consumer called with the success value of {@code onSuccess} + * @return the new {@code Single} instance + * @throws NullPointerException if {@code onSuccess} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2615,8 +2693,8 @@ public final Single doOnSuccess(@NonNull Consumer onSuccess) { } /** - * Calls the shared consumer with the error sent via onError or the value - * via onSuccess for each SingleObserver that subscribes to the current Single. + * Calls the shared consumer with the error sent via {@code onError} or the value + * via {@code onSuccess} for each {@link SingleObserver} that subscribes to the current {@code Single}. *

* *

@@ -2624,7 +2702,8 @@ public final Single doOnSuccess(@NonNull Consumer onSuccess) { *
{@code doOnEvent} does not operate by default on a particular {@link Scheduler}.
*
* @param onEvent the consumer called with the success value of onEvent - * @return the new Single instance + * @return the new {@code Single} instance + * @throws NullPointerException if {@code onEvent} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2636,8 +2715,8 @@ public final Single doOnEvent(@NonNull BiConsumer * *

@@ -2645,8 +2724,9 @@ public final Single doOnEvent(@NonNull BiConsumerScheduler: *
{@code doOnError} does not operate by default on a particular {@link Scheduler}.
* - * @param onError the consumer called with the success value of onError - * @return the new Single instance + * @param onError the consumer called with the success value of {@code onError} + * @return the new {@code Single} instance + * @throws NullPointerException if {@code onError} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2658,8 +2738,8 @@ public final Single doOnError(@NonNull Consumer onError) { } /** - * Calls the shared {@code Action} if a SingleObserver subscribed to the current Single - * disposes the common Disposable it received via onSubscribe. + * Calls the shared {@link Action} if a {@link SingleObserver} subscribed to the current {@code Single} + * disposes the common {@link Disposable} it received via {@code onSubscribe}. *

* *

@@ -2668,8 +2748,8 @@ public final Single doOnError(@NonNull Consumer onError) { *
{@code doOnDispose} does not operate by default on a particular {@link Scheduler}.
* * @param onDispose the action called when the subscription is disposed - * @return the new Single instance - * @throws NullPointerException if onDispose is null + * @return the new {@code Single} instance + * @throws NullPointerException if {@code onDispose} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -2681,8 +2761,8 @@ public final Single doOnDispose(@NonNull Action onDispose) { } /** - * Filters the success item of the Single via a predicate function and emitting it if the predicate - * returns true, completing otherwise. + * Filters the success item of the {@code Single} via a predicate function and emitting it if the predicate + * returns {@code true}, completing otherwise. *

* *

@@ -2691,10 +2771,11 @@ public final Single doOnDispose(@NonNull Action onDispose) { *
* * @param predicate - * a function that evaluates the item emitted by the source Maybe, returning {@code true} + * a function that evaluates the item emitted by the source {@code Single}, returning {@code true} * if it passes the filter - * @return a Maybe that emit the item emitted by the source Maybe that the filter + * @return the new {@link Maybe} that emit the item emitted by the source {@code Single} that the filter * evaluates as {@code true} + * @throws NullPointerException if {@code predicate} is {@code null} * @see ReactiveX operators documentation: Filter */ @CheckReturnValue @@ -2706,8 +2787,8 @@ public final Maybe filter(@NonNull Predicate predicate) { } /** - * Returns a Single that is based on applying a specified function to the item emitted by the source Single, - * where that function returns a SingleSource. + * Returns a {@code Single} that is based on applying a specified function to the item emitted by the source {@code Single}, + * where that function returns a {@link SingleSource}. *

* *

@@ -2717,8 +2798,9 @@ public final Maybe filter(@NonNull Predicate predicate) { * * @param the result value type * @param mapper - * a function that, when applied to the item emitted by the source Single, returns a SingleSource - * @return the Single returned from {@code mapper} when applied to the item emitted by the source Single + * a function that, when applied to the item emitted by the source {@code Single}, returns a {@code SingleSource} + * @return the new {@code Single} returned from {@code mapper} when applied to the item emitted by the source {@code Single} + * @throws NullPointerException if {@code mapper} is {@code null} * @see ReactiveX operators documentation: FlatMap */ @CheckReturnValue @@ -2730,8 +2812,8 @@ public final Single flatMap(@NonNull Function * *
@@ -2741,8 +2823,9 @@ public final Single flatMap(@NonNull Function the result value type * @param mapper - * a function that, when applied to the item emitted by the source Single, returns a MaybeSource - * @return the Maybe returned from {@code mapper} when applied to the item emitted by the source Single + * a function that, when applied to the item emitted by the source {@code Single}, returns a {@code MaybeSource} + * @return the new {@code Maybe} returned from {@code mapper} when applied to the item emitted by the source {@code Single} + * @throws NullPointerException if {@code mapper} is {@code null} * @see ReactiveX operators documentation: FlatMap */ @CheckReturnValue @@ -2754,8 +2837,8 @@ public final Maybe flatMapMaybe(@NonNull Function * *
@@ -2768,9 +2851,10 @@ public final Maybe flatMapMaybe(@NonNull Function the result value type * @param mapper - * a function that, when applied to the item emitted by the source Single, returns a - * Flowable - * @return the Flowable returned from {@code func} when applied to the item emitted by the source Single + * a function that, when applied to the item emitted by the source {@code Single}, returns a + * {@code Publisher} + * @return the new {@code Flowable} instance + * @throws NullPointerException if {@code mapper} is {@code null} * @see ReactiveX operators documentation: FlatMap */ @BackpressureSupport(BackpressureKind.FULL) @@ -2783,7 +2867,7 @@ public final Flowable flatMapPublisher(@NonNull Function * @@ -2795,11 +2879,12 @@ public final Flowable flatMapPublisher(@NonNull Function * * @param - * the type of item emitted by the resulting Iterable + * the type of item emitted by the resulting {@code Iterable} * @param mapper - * a function that returns an Iterable sequence of values for when given an item emitted by the - * source Single - * @return the new Flowable instance + * a function that returns an {@code Iterable} sequence of values for when given an item emitted by the + * source {@code Single} + * @return the new {@code Flowable} instance + * @throws NullPointerException if {@code mapper} is {@code null} * @see ReactiveX operators documentation: FlatMap * @see #flattenStreamAsFlowable(Function) */ @@ -2813,7 +2898,7 @@ public final Flowable flattenAsFlowable(@NonNull Function * @@ -2823,11 +2908,12 @@ public final Flowable flattenAsFlowable(@NonNull Function * * @param - * the type of item emitted by the resulting Iterable + * the type of item emitted by the resulting {@code Iterable} * @param mapper - * a function that returns an Iterable sequence of values for when given an item emitted by the - * source Single - * @return the new Observable instance + * a function that returns an {@code Iterable} sequence of values for when given an item emitted by the + * source {@code Single} + * @return the new {@code Observable} instance + * @throws NullPointerException if {@code mapper} is {@code null} * @see ReactiveX operators documentation: FlatMap * @see #flattenStreamAsObservable(Function) */ @@ -2840,8 +2926,8 @@ public final Flowable flattenAsFlowable(@NonNull Function * *
@@ -2851,8 +2937,9 @@ public final Flowable flattenAsFlowable(@NonNull Function the result value type * @param mapper - * a function that, when applied to the item emitted by the source Single, returns an ObservableSource - * @return the Observable returned from {@code func} when applied to the item emitted by the source Single + * a function that, when applied to the item emitted by the source {@code Single}, returns an {@code ObservableSource} + * @return the new {@code Observable} instance + * @throws NullPointerException if {@code mapper} is {@code null} * @see ReactiveX operators documentation: FlatMap */ @CheckReturnValue @@ -2865,7 +2952,7 @@ public final Flowable flattenAsFlowable(@NonNull Function * *
@@ -2874,9 +2961,10 @@ public final Flowable flattenAsFlowable(@NonNull Function * * @param mapper - * a function that, when applied to the item emitted by the source Single, returns a - * Completable - * @return the Completable returned from {@code func} when applied to the item emitted by the source Single + * a function that, when applied to the item emitted by the source {@code Single}, returns a + * {@code CompletableSource} + * @return the new {@code Completable} instance + * @throws NullPointerException if {@code mapper} is {@code null} * @see ReactiveX operators documentation: FlatMap * @since 2.0 */ @@ -2889,7 +2977,7 @@ public final Completable flatMapCompletable(@NonNull Function * @@ -3035,23 +3123,24 @@ public final T blockingGet() { * class and creating a {@link SingleTransformer} with it is recommended. *

* Note also that it is not possible to stop the subscription phase in {@code lift()} as the {@code apply()} method - * requires a non-null {@code SingleObserver} instance to be returned, which is then unconditionally subscribed to + * requires a non-{@code null} {@code SingleObserver} instance to be returned, which is then unconditionally subscribed to * the upstream {@code Single}. For example, if the operator decided there is no reason to subscribe to the * upstream source because of some optimization possibility or a failure to prepare the operator, it still has to - * return a {@code SingleObserver} that should immediately dispose the upstream's {@code Disposable} in its + * return a {@code SingleObserver} that should immediately dispose the upstream's {@link Disposable} in its * {@code onSubscribe} method. Again, using a {@code SingleTransformer} and extending the {@code Single} is * a better option as {@link #subscribeActual} can decide to not subscribe to its upstream after all. *

*
Scheduler:
*
{@code lift} does not operate by default on a particular {@link Scheduler}, however, the - * {@link SingleOperator} may use a {@code Scheduler} to support its own asynchronous behavior.
+ * {@code SingleOperator} may use a {@code Scheduler} to support its own asynchronous behavior. *
* * @param the output value type - * @param lift the {@link SingleOperator} that receives the downstream's {@code SingleObserver} and should return + * @param lift the {@code SingleOperator} that receives the downstream's {@code SingleObserver} and should return * a {@code SingleObserver} with custom behavior to be used as the consumer for the current * {@code Single}. - * @return the new Single instance + * @return the new {@code Single} instance + * @throws NullPointerException if {@code lift} is {@code null} * @see RxJava wiki: Writing operators * @see #compose(SingleTransformer) */ @@ -3064,7 +3153,7 @@ public final Single lift(@NonNull SingleOperator } /** - * Returns a Single that applies a specified function to the item emitted by the source Single and + * Returns a {@code Single} that applies a specified function to the item emitted by the source {@code Single} and * emits the result of this function application. *

* @@ -3075,8 +3164,9 @@ public final Single lift(@NonNull SingleOperator * * @param the result value type * @param mapper - * a function to apply to the item emitted by the Single - * @return a Single that emits the item from the source Single, transformed by the specified function + * a function to apply to the item emitted by the {@code Single} + * @return the new {@code Single} that emits the item from the source {@code Single}, transformed by the specified function + * @throws NullPointerException if {@code mapper} is {@code null} * @see ReactiveX operators documentation: Map */ @CheckReturnValue @@ -3088,7 +3178,7 @@ public final Single lift(@NonNull SingleOperator } /** - * Maps the signal types of this Single into a {@link Notification} of the same kind + * Maps the signal types of this {@code Single} into a {@link Notification} of the same kind * and emits it as a single success value to downstream. *

* @@ -3097,7 +3187,7 @@ public final Single lift(@NonNull SingleOperator *

{@code materialize} does not operate by default on a particular {@link Scheduler}.
*
*

History: 2.2.4 - experimental - * @return the new Single instance + * @return the new {@code Single} instance * @since 3.0.0 * @see #dematerialize(Function) */ @@ -3109,7 +3199,7 @@ public final Single> materialize() { } /** - * Signals true if the current Single signals a success value that is Object-equals with the value + * Signals {@code true} if the current {@code Single} signals a success value that is {@link Object#equals(Object)} with the value * provided. *

* @@ -3119,8 +3209,8 @@ public final Single> materialize() { *

Scheduler:
*
{@code contains} does not operate by default on a particular {@link Scheduler}.
*
- * @param value the value to compare against the success value of this Single - * @return the new Single instance + * @param value the value to compare against the success value of this {@code Single} + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -3131,18 +3221,19 @@ public final Single contains(@NonNull Object value) { } /** - * Signals true if the current Single signals a success value that is equal with - * the value provided by calling a bi-predicate. + * Signals {@code true} if the current {@code Single} signals a success value that is equal with + * the value provided by calling a {@link BiPredicate}. *

* *

*
Scheduler:
*
{@code contains} does not operate by default on a particular {@link Scheduler}.
*
- * @param value the value to compare against the success value of this Single - * @param comparer the function that receives the success value of this Single, the value provided - * and should return true if they are considered equal - * @return the new Single instance + * @param value the value to compare against the success value of this {@code Single} + * @param comparer the function that receives the success value of this {@code Single}, the value provided + * and should return {@code true} if they are considered equal + * @return the new {@code Single} instance + * @throws NullPointerException if {@code value} or {@code comparer} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -3155,11 +3246,11 @@ public final Single contains(@NonNull Object value, @NonNull BiPredicat } /** - * Flattens this and another Single into a single Flowable, without any transformation. + * Flattens this {@code Single} and another {@link SingleSource} into one {@link Flowable}, without any transformation. *

* *

- * You can combine items emitted by multiple Singles so that they appear as a single Flowable, by using + * You can combine items emitted by multiple {@code SingleSource}s so that they appear as one {@code Flowable}, by using * the {@code mergeWith} method. *

*
Backpressure:
@@ -3169,8 +3260,9 @@ public final Single contains(@NonNull Object value, @NonNull BiPredicat *
* * @param other - * a SingleSource to be merged - * @return that emits all of the items emitted by the source Singles + * a {@code SingleSource} to be merged + * @return that emits all of the items emitted by the source {@code Single}s + * @throws NullPointerException if {@code other} is {@code null} * @see ReactiveX operators documentation: Merge */ @BackpressureSupport(BackpressureKind.FULL) @@ -3182,20 +3274,20 @@ public final Flowable mergeWith(@NonNull SingleSource other) { } /** - * Modifies a Single to emit its item (or notify of its error) on a specified {@link Scheduler}, + * Modifies a {@code Single} to emit its item (or notify of its error) on a specified {@link Scheduler}, * asynchronously. *

* *

*
Scheduler:
- *
you specify which {@link Scheduler} this operator will use.
+ *
you specify which {@code Scheduler} this operator will use.
*
* * @param scheduler - * the {@link Scheduler} to notify subscribers on - * @return the source Single modified so that its subscribers are notified on the specified - * {@link Scheduler} - * @throws NullPointerException if scheduler is null + * the {@code Scheduler} to notify subscribers on + * @return the source {@code Single} modified so that its subscribers are notified on the specified + * {@code Scheduler} + * @throws NullPointerException if {@code scheduler} is {@code null} * @see ReactiveX operators documentation: ObserveOn * @see RxJava Threading Examples * @see #subscribeOn @@ -3209,16 +3301,16 @@ public final Single observeOn(@NonNull Scheduler scheduler) { } /** - * Instructs a Single to emit an item (returned by a specified function) rather than invoking + * Instructs a {@code Single} to emit an item (returned by a specified function) rather than invoking * {@link SingleObserver#onError onError} if it encounters an error. *

* *

- * By default, when a Single encounters an error that prevents it from emitting the expected item to its - * subscriber, the Single invokes its subscriber's {@link SingleObserver#onError} method, and then quits - * without invoking any more of its subscriber's methods. The {@code onErrorReturn} method changes this - * behavior. If you pass a function ({@code resumeFunction}) to a Single's {@code onErrorReturn} method, if - * the original Single encounters an error, instead of invoking its subscriber's + * By default, when a {@code Single} encounters an error that prevents it from emitting the expected item to its + * subscriber, the {@code Single} invokes its subscriber's {@link SingleObserver#onError} method, and then quits + * without invoking any more of its observer's methods. The {@code onErrorReturn} method changes this + * behavior. If you pass a function ({@code resumeFunction}) to a {@code Single}'s {@code onErrorReturn} method, if + * the original {@code Single} encounters an error, instead of invoking its observer's * {@link SingleObserver#onError} method, it will instead emit the return value of {@code resumeFunction}. *

* You can use this to prevent errors from propagating or to supply fallback data should errors be @@ -3229,9 +3321,10 @@ public final Single observeOn(@NonNull Scheduler scheduler) { *

* * @param resumeFunction - * a function that returns an item that the new Single will emit if the source Single encounters + * a function that returns an item that the new {@code Single} will emit if the source {@code Single} encounters * an error - * @return the original Single with appropriately modified behavior + * @return the new {@code Single} instance + * @throws NullPointerException if {@code resumeFunction} is {@code null} * @see ReactiveX operators documentation: Catch */ @CheckReturnValue @@ -3243,15 +3336,16 @@ public final Single onErrorReturn(@NonNull Function r } /** - * Signals the specified value as success in case the current Single signals an error. + * Signals the specified value as success in case the current {@code Single} signals an error. *

* *

*
Scheduler:
*
{@code onErrorReturnItem} does not operate by default on a particular {@link Scheduler}.
*
- * @param value the value to signal if the current Single fails - * @return the new Single instance + * @param value the value to signal if the current {@code Single} fails + * @return the new {@code Single} instance + * @throws NullPointerException if {@code value} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -3263,19 +3357,19 @@ public final Single onErrorReturnItem(@NonNull T value) { } /** - * Instructs a Single to pass control to another Single rather than invoking + * Instructs a {@code Single} to pass control to another {@code Single} rather than invoking * {@link SingleObserver#onError(Throwable)} if it encounters an error. *

* *

- * By default, when a Single encounters an error that prevents it from emitting the expected item to - * its {@link SingleObserver}, the Single invokes its SingleObserver's {@code onError} method, and then quits - * without invoking any more of its SingleObserver's methods. The {@code onErrorResumeWith} method changes this - * behavior. If you pass another Single ({@code resumeSingleInCaseOfError}) to a Single's - * {@code onErrorResumeWith} method, if the original Single encounters an error, instead of invoking its - * SingleObserver's {@code onError} method, it will instead relinquish control to {@code resumeSingleInCaseOfError} which - * will invoke the SingleObserver's {@link SingleObserver#onSuccess onSuccess} method if it is able to do so. In such a case, - * because no Single necessarily invokes {@code onError}, the SingleObserver may never know that an error + * By default, when a {@code Single} encounters an error that prevents it from emitting the expected item to + * its {@link SingleObserver}, the {@code Single} invokes its {@code SingleObserver}'s {@code onError} method, and then quits + * without invoking any more of its {@code SingleObserver}'s methods. The {@code onErrorResumeWith} method changes this + * behavior. If you pass another {@code Single} ({@code resumeSingleInCaseOfError}) to a {@code Single}'s + * {@code onErrorResumeWith} method, if the original {@code Single} encounters an error, instead of invoking its + * {@code SingleObserver}'s {@code onError} method, it will instead relinquish control to {@code resumeSingleInCaseOfError} which + * will invoke the {@code SingleObserver}'s {@link SingleObserver#onSuccess onSuccess} method if it is able to do so. In such a case, + * because no {@code Single} necessarily invokes {@code onError}, the {@code SingleObserver} may never know that an error * happened. *

* You can use this to prevent errors from propagating or to supply fallback data should errors be @@ -3285,32 +3379,33 @@ public final Single onErrorReturnItem(@NonNull T value) { *

{@code onErrorResumeWith} does not operate by default on a particular {@link Scheduler}.
*
* - * @param resumeSingleInCaseOfError a Single that will take control if source Single encounters an error. - * @return the original Single, with appropriately modified behavior. + * @param fallback a {@code Single} that will take control if source {@code Single} encounters an error. + * @return the new {@code Single} instance + * @throws NullPointerException if {@code fallback} is {@code null} * @see ReactiveX operators documentation: Catch */ @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Single onErrorResumeWith(@NonNull SingleSource resumeSingleInCaseOfError) { - Objects.requireNonNull(resumeSingleInCaseOfError, "resumeSingleInCaseOfError is null"); - return onErrorResumeNext(Functions.justFunction(resumeSingleInCaseOfError)); + public final Single onErrorResumeWith(@NonNull SingleSource fallback) { + Objects.requireNonNull(fallback, "fallback is null"); + return onErrorResumeNext(Functions.justFunction(fallback)); } /** - * Instructs a Single to pass control to another Single rather than invoking + * Instructs a {@code Single} to pass control to another {@code Single} rather than invoking * {@link SingleObserver#onError(Throwable)} if it encounters an error. *

* *

- * By default, when a Single encounters an error that prevents it from emitting the expected item to - * its {@link SingleObserver}, the Single invokes its SingleObserver's {@code onError} method, and then quits - * without invoking any more of its SingleObserver's methods. The {@code onErrorResumeNext} method changes this - * behavior. If you pass a function that will return another Single ({@code resumeFunctionInCaseOfError}) to a Single's - * {@code onErrorResumeNext} method, if the original Single encounters an error, instead of invoking its - * SingleObserver's {@code onError} method, it will instead relinquish control to {@code resumeSingleInCaseOfError} which - * will invoke the SingleObserver's {@link SingleObserver#onSuccess onSuccess} method if it is able to do so. In such a case, - * because no Single necessarily invokes {@code onError}, the SingleObserver may never know that an error + * By default, when a {@code Single} encounters an error that prevents it from emitting the expected item to + * its {@link SingleObserver}, the {@code Single} invokes its {@code SingleObserver}'s {@code onError} method, and then quits + * without invoking any more of its {@code SingleObserver}'s methods. The {@code onErrorResumeNext} method changes this + * behavior. If you pass a function that will return another {@code Single} ({@code resumeFunctionInCaseOfError}) to a {@code Single}'s + * {@code onErrorResumeNext} method, if the original {@code Single} encounters an error, instead of invoking its + * {@code SingleObserver}'s {@code onError} method, it will instead relinquish control to {@code resumeSingleInCaseOfError} which + * will invoke the {@code SingleObserver}'s {@link SingleObserver#onSuccess onSuccess} method if it is able to do so. In such a case, + * because no {@code Single} necessarily invokes {@code onError}, the {@code SingleObserver} may never know that an error * happened. *

* You can use this to prevent errors from propagating or to supply fallback data should errors be @@ -3320,8 +3415,9 @@ public final Single onErrorResumeWith(@NonNull SingleSource resu *

{@code onErrorResumeNext} does not operate by default on a particular {@link Scheduler}.
*
* - * @param resumeFunctionInCaseOfError a function that returns a Single that will take control if source Single encounters an error. - * @return the original Single, with appropriately modified behavior. + * @param fallback a function that returns a {@code Single} that will take control if source {@code Single} encounters an error. + * @return the new {@code Single} instance + * @throws NullPointerException if {@code fallback} is {@code null} * @see ReactiveX operators documentation: Catch * @since .20 */ @@ -3329,14 +3425,14 @@ public final Single onErrorResumeWith(@NonNull SingleSource resu @NonNull @SchedulerSupport(SchedulerSupport.NONE) public final Single onErrorResumeNext( - @NonNull Function> resumeFunctionInCaseOfError) { - Objects.requireNonNull(resumeFunctionInCaseOfError, "resumeFunctionInCaseOfError is null"); - return RxJavaPlugins.onAssembly(new SingleResumeNext<>(this, resumeFunctionInCaseOfError)); + @NonNull Function> fallback) { + Objects.requireNonNull(fallback, "fallback is null"); + return RxJavaPlugins.onAssembly(new SingleResumeNext<>(this, fallback)); } /** - * Nulls out references to the upstream producer and downstream SingleObserver if - * the sequence is terminated or downstream calls dispose(). + * Nulls out references to the upstream producer and downstream {@link SingleObserver} if + * the sequence is terminated or downstream calls {@code dispose()}. *

* *

@@ -3344,8 +3440,8 @@ public final Single onErrorResumeNext( *
{@code onTerminateDetach} does not operate by default on a particular {@link Scheduler}.
*
*

History: 2.1.5 - experimental - * @return a Single which nulls out references to the upstream producer and downstream SingleObserver if - * the sequence is terminated or downstream calls dispose() + * @return the new {@code Single} which {@code null}s out references to the upstream producer and downstream {@code SingleObserver} if + * the sequence is terminated or downstream calls {@code dispose()} * @since 2.2 */ @CheckReturnValue @@ -3356,7 +3452,7 @@ public final Single onTerminateDetach() { } /** - * Repeatedly re-subscribes to the current Single and emits each success value. + * Repeatedly re-subscribes to the current {@code Single} and emits each success value as a {@link Flowable} sequence. *

* *

@@ -3365,7 +3461,7 @@ public final Single onTerminateDetach() { *
Scheduler:
*
{@code repeat} does not operate by default on a particular {@link Scheduler}.
*
- * @return the new Flowable instance + * @return the new {@code Flowable} instance * @since 2.0 */ @BackpressureSupport(BackpressureKind.FULL) @@ -3377,7 +3473,7 @@ public final Flowable repeat() { } /** - * Re-subscribes to the current Single at most the given number of times and emits each success value. + * Re-subscribes to the current {@code Single} at most the given number of times and emits each success value as a {@link Flowable} sequence. *

* *

@@ -3386,8 +3482,8 @@ public final Flowable repeat() { *
Scheduler:
*
{@code repeat} does not operate by default on a particular {@link Scheduler}.
*
- * @param times the number of times to re-subscribe to the current Single - * @return the new Flowable instance + * @param times the number of times to re-subscribe to the current {@code Single} + * @return the new {@code Flowable} instance * @since 2.0 */ @BackpressureSupport(BackpressureKind.FULL) @@ -3399,9 +3495,9 @@ public final Flowable repeat(long times) { } /** - * Re-subscribes to the current Single if - * the Publisher returned by the handler function signals a value in response to a - * value signalled through the Flowable the handle receives. + * Re-subscribes to the current {@code Single} if + * the {@link Publisher} returned by the handler function signals a value in response to a + * value signaled through the {@link Flowable} the handler receives. *

* *

@@ -3411,11 +3507,11 @@ public final Flowable repeat(long times) { *
Scheduler:
*
{@code repeatWhen} does not operate by default on a particular {@link Scheduler}.
*
- * @param handler the function that is called with a Flowable that signals a value when the Single - * signalled a success value and returns a Publisher that has to signal a value to - * trigger a resubscription to the current Single, otherwise the terminal signal of - * the Publisher will be the terminal signal of the sequence as well. - * @return the new Flowable instance + * @param handler the function that is called with a {@code Flowable} that signals a value when the {@code Single} + * signaled a success value and returns a {@code Publisher} that has to signal a value to + * trigger a resubscription to the current {@code Single}, otherwise the terminal signal of + * the {@code Publisher} will be the terminal signal of the sequence as well. + * @return the new {@code Flowable} instance * @since 2.0 */ @BackpressureSupport(BackpressureKind.FULL) @@ -3427,7 +3523,8 @@ public final Flowable repeatWhen(@NonNull Function, } /** - * Re-subscribes to the current Single until the given BooleanSupplier returns true. + * Re-subscribes to the current {@code Single} until the given {@link BooleanSupplier} returns {@code true} + * and emits the success items as a {@link Flowable} sequence. *

* *

@@ -3436,9 +3533,9 @@ public final Flowable repeatWhen(@NonNull Function, *
Scheduler:
*
{@code repeatUntil} does not operate by default on a particular {@link Scheduler}.
*
- * @param stop the BooleanSupplier called after the current Single succeeds and if returns false, - * the Single is re-subscribed; otherwise the sequence completes. - * @return the new Flowable instance + * @param stop the {@code BooleanSupplier} called after the current {@code Single} succeeds and if returns {@code false}, + * the {@code Single} is re-subscribed; otherwise the sequence completes. + * @return the new {@code Flowable} instance * @since 2.0 */ @BackpressureSupport(BackpressureKind.FULL) @@ -3450,14 +3547,14 @@ public final Flowable repeatUntil(@NonNull BooleanSupplier stop) { } /** - * Repeatedly re-subscribes to the current Single indefinitely if it fails with an onError. + * Repeatedly re-subscribes to the current {@code Single} indefinitely if it fails with an {@code onError}. *

* *

*
Scheduler:
*
{@code retry} does not operate by default on a particular {@link Scheduler}.
*
- * @return the new Single instance + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -3468,16 +3565,16 @@ public final Single retry() { } /** - * Repeatedly re-subscribe at most the specified times to the current Single - * if it fails with an onError. + * Repeatedly re-subscribe at most the specified times to the current {@code Single} + * if it fails with an {@code onError}. *

* *

*
Scheduler:
*
{@code retry} does not operate by default on a particular {@link Scheduler}.
*
- * @param times the number of times to resubscribe if the current Single fails - * @return the new Single instance + * @param times the number of times to resubscribe if the current {@code Single} fails + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -3488,17 +3585,17 @@ public final Single retry(long times) { } /** - * Re-subscribe to the current Single if the given predicate returns true when the Single fails - * with an onError. + * Re-subscribe to the current {@code Single} if the given predicate returns {@code true} when the {@code Single} fails + * with an {@code onError}. *

* *

*
Scheduler:
*
{@code retry} does not operate by default on a particular {@link Scheduler}.
*
- * @param predicate the predicate called with the resubscription count and the failure Throwable - * and should return true if a resubscription should happen - * @return the new Single instance + * @param predicate the predicate called with the resubscription count and the failure {@link Throwable} + * and should return {@code true} if a resubscription should happen + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -3509,8 +3606,8 @@ public final Single retry(@NonNull BiPredicate * *
@@ -3518,10 +3615,10 @@ public final Single retry(@NonNull BiPredicate{@code retry} does not operate by default on a particular {@link Scheduler}. *
*

History: 2.1.8 - experimental - * @param times the number of times to resubscribe if the current Single fails - * @param predicate the predicate called with the failure Throwable - * and should return true if a resubscription should happen - * @return the new Single instance + * @param times the number of times to resubscribe if the current {@code Single} fails + * @param predicate the predicate called with the failure {@link Throwable} + * and should return {@code true} if a resubscription should happen + * @return the new {@code Single} instance * @since 2.2 */ @CheckReturnValue @@ -3532,17 +3629,17 @@ public final Single retry(long times, @NonNull Predicate p } /** - * Re-subscribe to the current Single if the given predicate returns true when the Single fails - * with an onError. + * Re-subscribe to the current {@code Single} if the given predicate returns {@code true} when the {@code Single} fails + * with an {@code onError}. *

* *

*
Scheduler:
*
{@code retry} does not operate by default on a particular {@link Scheduler}.
*
- * @param predicate the predicate called with the failure Throwable - * and should return true if a resubscription should happen - * @return the new Single instance + * @param predicate the predicate called with the failure {@link Throwable} + * and should return {@code true} if a resubscription should happen + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -3553,17 +3650,17 @@ public final Single retry(@NonNull Predicate predicate) { } /** - * Re-subscribes to the current Single if and when the Publisher returned by the handler + * Re-subscribes to the current {@code Single} if and when the {@link Publisher} returned by the handler * function signals a value. *

* *

- * If the Publisher signals an {@code onComplete}, the resulting {@code Single} will signal a {@link NoSuchElementException}. + * If the {@code Publisher} signals an {@code onComplete}, the resulting {@code Single} will signal a {@link NoSuchElementException}. *

* Note that the inner {@code Publisher} returned by the handler function should signal * either {@code onNext}, {@code onError} or {@code onComplete} in response to the received - * {@code Throwable} to indicate the operator should retry or terminate. If the upstream to - * the operator is asynchronous, signaling onNext followed by onComplete immediately may + * {@link Throwable} to indicate the operator should retry or terminate. If the upstream to + * the operator is asynchronous, signaling {@code onNext} followed by {@code onComplete} immediately may * result in the sequence to be completed immediately. Similarly, if this inner * {@code Publisher} signals {@code onError} or {@code onComplete} while the upstream is * active, the sequence is terminated with the same signal immediately. @@ -3589,11 +3686,11 @@ public final Single retry(@NonNull Predicate predicate) { *

{@code retryWhen} does not operate by default on a particular {@link Scheduler}.
* * - * @param handler the function that receives a Flowable of the error the Single emits and should - * return a Publisher that should signal a normal value (in response to the - * throwable the Flowable emits) to trigger a resubscription or signal an error to - * be the output of the resulting Single - * @return the new Single instance + * @param handler the function that receives a {@link Flowable} of the error the {@code Single} emits and should + * return a {@code Publisher} that should signal a normal value (in response to the + * throwable the {@code Flowable} emits) to trigger a resubscription or signal an error to + * be the output of the resulting {@code Single} + * @return the new {@code Single} instance */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -3603,13 +3700,13 @@ public final Single retryWhen(@NonNull Function, } /** - * Subscribes to a Single but ignore its emission or notification. + * Subscribes to a {@code Single} but ignore its emission or notification. *

* *

- * If the Single emits an error, it is wrapped into an + * If the {@code Single} emits an error, it is wrapped into an * {@link io.reactivex.rxjava3.exceptions.OnErrorNotImplementedException OnErrorNotImplementedException} - * and routed to the RxJavaPlugins.onError handler. + * and routed to the {@link RxJavaPlugins#onError(Throwable)} handler. *

*
Scheduler:
*
{@code subscribe} does not operate by default on a particular {@link Scheduler}.
@@ -3625,7 +3722,7 @@ public final Disposable subscribe() { } /** - * Subscribes to a Single and provides a composite callback to handle the item it emits + * Subscribes to a {@code Single} and provides a composite callback to handle the item it emits * or any error notification it issues. *

* @@ -3635,12 +3732,12 @@ public final Disposable subscribe() { *

* * @param onCallback - * the callback that receives either the success value or the failure Throwable - * (whichever is not null) + * the callback that receives either the success value or the failure {@link Throwable} + * (whichever is not {@code null}) * @return a {@link Disposable} reference can request the {@link Single} stop work. * @see ReactiveX operators documentation: Subscribe * @throws NullPointerException - * if {@code onCallback} is null + * if {@code onCallback} is {@code null} */ @CheckReturnValue @NonNull @@ -3654,23 +3751,23 @@ public final Disposable subscribe(@NonNull BiConsumer * *

- * If the Single emits an error, it is wrapped into an + * If the {@code Single} emits an error, it is wrapped into an * {@link io.reactivex.rxjava3.exceptions.OnErrorNotImplementedException OnErrorNotImplementedException} - * and routed to the RxJavaPlugins.onError handler. + * and routed to the {@link RxJavaPlugins#onError(Throwable)} handler. *

*
Scheduler:
*
{@code subscribe} does not operate by default on a particular {@link Scheduler}.
*
* * @param onSuccess - * the {@code Consumer} you have designed to accept the emission from the Single + * the {@code Consumer} you have designed to accept the emission from the {@code Single} * @return a {@link Disposable} reference can request the {@link Single} stop work. * @throws NullPointerException - * if {@code onSuccess} is null + * if {@code onSuccess} is {@code null} * @see ReactiveX operators documentation: Subscribe */ @CheckReturnValue @@ -3681,7 +3778,7 @@ public final Disposable subscribe(@NonNull Consumer onSuccess) { } /** - * Subscribes to a Single and provides callbacks to handle the item it emits or any error notification it + * Subscribes to a {@code Single} and provides callbacks to handle the item it emits or any error notification it * issues. *

* @@ -3691,15 +3788,14 @@ public final Disposable subscribe(@NonNull Consumer onSuccess) { * * * @param onSuccess - * the {@code Consumer} you have designed to accept the emission from the Single + * the {@code Consumer} you have designed to accept the emission from the {@code Single} * @param onError * the {@code Consumer} you have designed to accept any error notification from the - * Single + * {@code Single} * @return a {@link Disposable} reference can request the {@link Single} stop work. * @see ReactiveX operators documentation: Subscribe * @throws NullPointerException - * if {@code onSuccess} is null, or - * if {@code onError} is null + * if {@code onSuccess} or {@code onError} is {@code null} */ @CheckReturnValue @NonNull @@ -3739,13 +3835,13 @@ public final void subscribe(@NonNull SingleObserver observer) { *

There is no need to call any of the plugin hooks on the current {@code Single} instance or * the {@code SingleObserver}; all hooks and basic safeguards have been * applied by {@link #subscribe(SingleObserver)} before this method gets called. - * @param observer the SingleObserver to handle, not null + * @param observer the {@code SingleObserver} to handle, not {@code null} */ protected abstract void subscribeActual(@NonNull SingleObserver observer); /** - * Subscribes a given SingleObserver (subclass) to this Single and returns the given - * SingleObserver as is. + * Subscribes a given {@link SingleObserver} (subclass) to this {@code Single} and returns the given + * {@code SingleObserver} as is. *

* *

Usage example: @@ -3763,10 +3859,10 @@ public final void subscribe(@NonNull SingleObserver observer) { *

Scheduler:
*
{@code subscribeWith} does not operate by default on a particular {@link Scheduler}.
* - * @param the type of the SingleObserver to use and return - * @param observer the SingleObserver (subclass) to use and return, not null + * @param the type of the {@code SingleObserver} to use and return + * @param observer the {@code SingleObserver} (subclass) to use and return, not {@code null} * @return the input {@code observer} - * @throws NullPointerException if {@code observer} is null + * @throws NullPointerException if {@code observer} is {@code null} * @since 2.0 */ @CheckReturnValue @@ -3778,17 +3874,18 @@ public final void subscribe(@NonNull SingleObserver observer) { } /** - * Asynchronously subscribes subscribers to this Single on the specified {@link Scheduler}. + * Asynchronously subscribes subscribers to this {@code Single} on the specified {@link Scheduler}. *

* *

*
Scheduler:
- *
You specify which {@link Scheduler} this operator will use.
+ *
You specify which {@code Scheduler} this operator will use.
*
* * @param scheduler - * the {@link Scheduler} to perform subscription actions on - * @return the source Single modified so that its subscriptions happen on the specified {@link Scheduler} + * the {@code Scheduler} to perform subscription actions on + * @return the source {@code Single} modified so that its subscriptions happen on the specified {@code Scheduler} + * @throws NullPointerException if {@code scheduler} is {@code null} * @see ReactiveX operators documentation: SubscribeOn * @see RxJava Threading Examples * @see #observeOn @@ -3802,7 +3899,7 @@ public final Single subscribeOn(@NonNull Scheduler scheduler) { } /** - * Returns a Single that emits the item emitted by the source Single until a Completable terminates. Upon + * Returns a {@code Single} that emits the item emitted by the source {@code Single} until a {@link CompletableSource} terminates. Upon * termination of {@code other}, this will emit a {@link CancellationException} rather than go to * {@link SingleObserver#onSuccess(Object)}. *

@@ -3813,9 +3910,10 @@ public final Single subscribeOn(@NonNull Scheduler scheduler) { * * * @param other - * the Completable whose termination will cause {@code takeUntil} to emit the item from the source - * Single - * @return a Single that emits the item emitted by the source Single until such time as {@code other} terminates. + * the {@code CompletableSource} whose termination will cause {@code takeUntil} to emit the item from the source + * {@code Single} + * @return the new {@code Single} that emits the item emitted by the source {@code Single} until such time as {@code other} terminates. + * @throws NullPointerException if {@code other} is {@code null} * @see ReactiveX operators documentation: TakeUntil */ @CheckReturnValue @@ -3827,7 +3925,7 @@ public final Single takeUntil(@NonNull CompletableSource other) { } /** - * Returns a Single that emits the item emitted by the source Single until a Publisher emits an item. Upon + * Returns a {@code Single} that emits the item emitted by the source {@code Single} until a {@link Publisher} emits an item or completes. Upon * emission of an item from {@code other}, this will emit a {@link CancellationException} rather than go to * {@link SingleObserver#onSuccess(Object)}. *

@@ -3841,12 +3939,13 @@ public final Single takeUntil(@NonNull CompletableSource other) { * * * @param other - * the Publisher whose first emitted item will cause {@code takeUntil} to emit the item from the source - * Single + * the {@code Publisher} whose first emitted item or completion will cause {@code takeUntil} to emit {@code CancellationException} + * if the upstream {@code Single} hasn't completed till then * @param * the type of items emitted by {@code other} - * @return a Single that emits the item emitted by the source Single until such time as {@code other} emits + * @return the new {@code Single} that emits the item emitted by the source {@code Single} until such time as {@code other} emits * its first item + * @throws NullPointerException if {@code other} is {@code null} * @see ReactiveX operators documentation: TakeUntil */ @BackpressureSupport(BackpressureKind.FULL) @@ -3859,7 +3958,7 @@ public final Single takeUntil(@NonNull Publisher other) { } /** - * Returns a Single that emits the item emitted by the source Single until a second Single emits an item. Upon + * Returns a {@code Single} that emits the item emitted by the source {@code Single} until a second {@code Single} emits an item. Upon * emission of an item from {@code other}, this will emit a {@link CancellationException} rather than go to * {@link SingleObserver#onSuccess(Object)}. *

@@ -3870,10 +3969,12 @@ public final Single takeUntil(@NonNull Publisher other) { * * * @param other - * the Single whose emitted item will cause {@code takeUntil} to emit the item from the source Single + * the {@code Single} whose emitted item will cause {@code takeUntil} to emit {@code CancellationException} + * if the upstream {@code Single} hasn't completed till then * @param * the type of item emitted by {@code other} - * @return a Single that emits the item emitted by the source Single until such time as {@code other} emits its item + * @return the new {@code Single} that emits the item emitted by the source {@code Single} until such time as {@code other} emits its item + * @throws NullPointerException if {@code other} is {@code null} * @see ReactiveX operators documentation: TakeUntil */ @CheckReturnValue @@ -3885,17 +3986,17 @@ public final Single takeUntil(@NonNull SingleSource other) { } /** - * Signals a TimeoutException if the current Single doesn't signal a success value within the + * Signals a {@link TimeoutException} if the current {@code Single} doesn't signal a success value within the * specified timeout window. *

* *

*
Scheduler:
- *
{@code timeout} signals the TimeoutException on the {@code computation} {@link Scheduler}.
+ *
{@code timeout} signals the {@code TimeoutException} on the {@code computation} {@link Scheduler}.
*
* @param timeout the timeout amount * @param unit the time unit - * @return the new Single instance + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -3906,19 +4007,19 @@ public final Single timeout(long timeout, @NonNull TimeUnit unit) { } /** - * Signals a TimeoutException if the current Single doesn't signal a success value within the + * Signals a {@link TimeoutException} if the current {@code Single} doesn't signal a success value within the * specified timeout window. *

* *

*
Scheduler:
- *
{@code timeout} signals the TimeoutException on the {@link Scheduler} you specify.
+ *
{@code timeout} signals the {@code TimeoutException} on the {@link Scheduler} you specify.
*
* @param timeout the timeout amount * @param unit the time unit - * @param scheduler the target scheduler where the timeout is awaited and the TimeoutException - * signalled - * @return the new Single instance + * @param scheduler the target {@code Scheduler} where the timeout is awaited and the {@code TimeoutException} + * signaled + * @return the new {@code Single} instance * @since 2.0 */ @CheckReturnValue @@ -3929,61 +4030,60 @@ public final Single timeout(long timeout, @NonNull TimeUnit unit, @NonNull Sc } /** - * Runs the current Single and if it doesn't signal within the specified timeout window, it is - * disposed and the other SingleSource subscribed to. + * Runs the current {@code Single} and if it doesn't signal within the specified timeout window, it is + * disposed and the other {@link SingleSource} subscribed to. *

* *

*
Scheduler:
- *
{@code timeout} subscribes to the other SingleSource on the {@link Scheduler} you specify.
+ *
{@code timeout} subscribes to the other {@code SingleSource} on the {@link Scheduler} you specify.
*
* @param timeout the timeout amount * @param unit the time unit - * @param scheduler the scheduler where the timeout is awaited and the subscription to other happens - * @param other the other SingleSource that gets subscribed to if the current Single times out - * @return the new Single instance + * @param scheduler the {@code Scheduler} where the timeout is awaited and the subscription to other happens + * @param fallback the other {@code SingleSource} that gets subscribed to if the current {@code Single} times out + * @return the new {@code Single} instance + * @throws NullPointerException if {@code unit}, {@code scheduler} or {@code fallback} is {@code null} * @since 2.0 */ @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.CUSTOM) - public final Single timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull SingleSource other) { - Objects.requireNonNull(other, "other is null"); - return timeout0(timeout, unit, scheduler, other); + public final Single timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull SingleSource fallback) { + Objects.requireNonNull(fallback, "fallback is null"); + return timeout0(timeout, unit, scheduler, fallback); } /** - * Runs the current Single and if it doesn't signal within the specified timeout window, it is - * disposed and the other SingleSource subscribed to. + * Runs the current {@code Single} and if it doesn't signal within the specified timeout window, it is + * disposed and the other {@link SingleSource} subscribed to. *

* *

*
Scheduler:
- *
{@code timeout} subscribes to the other SingleSource on + *
{@code timeout} subscribes to the other {@code SingleSource} on * the {@code computation} {@link Scheduler}.
*
* @param timeout the timeout amount * @param unit the time unit - * @param other the other SingleSource that gets subscribed to if the current Single times out - * @return the new Single instance + * @param fallback the other {@code SingleSource} that gets subscribed to if the current {@code Single} times out + * @return the new {@code Single} instance * @throws NullPointerException - * if other is null, or - * if unit is null, or - * if scheduler is null + * if {@code fallback} or {@code unit} is {@code null} * @since 2.0 */ @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.COMPUTATION) - public final Single timeout(long timeout, @NonNull TimeUnit unit, @NonNull SingleSource other) { - Objects.requireNonNull(other, "other is null"); - return timeout0(timeout, unit, Schedulers.computation(), other); + public final Single timeout(long timeout, @NonNull TimeUnit unit, @NonNull SingleSource fallback) { + Objects.requireNonNull(fallback, "fallback is null"); + return timeout0(timeout, unit, Schedulers.computation(), fallback); } - private Single timeout0(final long timeout, final TimeUnit unit, final Scheduler scheduler, final SingleSource other) { + private Single timeout0(final long timeout, final TimeUnit unit, final Scheduler scheduler, final SingleSource fallback) { Objects.requireNonNull(unit, "unit is null"); Objects.requireNonNull(scheduler, "scheduler is null"); - return RxJavaPlugins.onAssembly(new SingleTimeout<>(this, timeout, unit, scheduler, other)); + return RxJavaPlugins.onAssembly(new SingleTimeout<>(this, timeout, unit, scheduler, fallback)); } /** @@ -3998,9 +4098,9 @@ private Single timeout0(final long timeout, final TimeUnit unit, final Schedu * *

History: 2.1.7 - experimental * @param the resulting object type - * @param converter the function that receives the current Single instance and returns a value + * @param converter the function that receives the current {@code Single} instance and returns a value * @return the converted value - * @throws NullPointerException if converter is null + * @throws NullPointerException if {@code converter} is {@code null} * @since 2.2 */ @CheckReturnValue @@ -4010,7 +4110,7 @@ public final R to(@NonNull SingleConverter converter) { } /** - * Returns a {@link Completable} that ignores the success value of this {@link Single} + * Returns a {@link Completable} that ignores the success value of this {@code Single} * and signals {@code onComplete} instead. *

* @@ -4019,7 +4119,7 @@ public final R to(@NonNull SingleConverter converter) { *

{@code ignoreElement} does not operate by default on a particular {@link Scheduler}.
* * - * @return a {@link Completable} that signals {@code onComplete} on it's observer when the source {@link Single} + * @return a {@code Completable} that signals {@code onComplete} on it's observer when the source {@code Single} * calls {@code onSuccess}. * @since 2.1.13 */ @@ -4031,7 +4131,7 @@ public final Completable ignoreElement() { } /** - * Converts this Single into a {@link Flowable}. + * Converts this {@code Single} into a {@link Flowable}. *

* *

@@ -4041,7 +4141,7 @@ public final Completable ignoreElement() { *
{@code toFlowable} does not operate by default on a particular {@link Scheduler}.
*
* - * @return a {@link Flowable} that emits a single item T or an error. + * @return a {@lcode Flowable} that emits a single item T or an error. */ @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @@ -4064,7 +4164,7 @@ public final Flowable toFlowable() { *
{@code toFuture} does not operate by default on a particular {@link Scheduler}.
* * - * @return a {@link Future} that expects a single item to be emitted by this {@code Single} + * @return a {@code Future} that expects a single item to be emitted by this {@code Single} * @see ReactiveX documentation: To */ @CheckReturnValue @@ -4075,7 +4175,7 @@ public final Future toFuture() { } /** - * Converts this Single into a {@link Maybe}. + * Converts this {@code Single} into a {@link Maybe}. *

* *

@@ -4083,7 +4183,7 @@ public final Future toFuture() { *
{@code toMaybe} does not operate by default on a particular {@link Scheduler}.
*
* - * @return a {@link Maybe} that emits a single item T or an error. + * @return a {@code Maybe} that emits a single item or an error. */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -4096,7 +4196,7 @@ public final Maybe toMaybe() { return RxJavaPlugins.onAssembly(new MaybeFromSingle<>(this)); } /** - * Converts this Single into an {@link Observable}. + * Converts this {@code Single} into an {@link Observable}. *

* *

@@ -4104,7 +4204,7 @@ public final Maybe toMaybe() { *
{@code toObservable} does not operate by default on a particular {@link Scheduler}.
*
* - * @return an {@link Observable} that emits a single item T or an error. + * @return an {@code Observable} that emits a single item or an error. */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -4118,18 +4218,18 @@ public final Observable toObservable() { } /** - * Returns a Single which makes sure when a SingleObserver disposes the Disposable, - * that call is propagated up on the specified scheduler. + * Returns a {@code Single} which makes sure when a {@link SingleObserver} disposes the {@link Disposable}, + * that call is propagated up on the specified {@link Scheduler}. *

* *

*
Scheduler:
- *
{@code unsubscribeOn} calls dispose() of the upstream on the {@link Scheduler} you specify.
+ *
{@code unsubscribeOn} calls {@code dispose()} of the upstream on the {@code Scheduler} you specify.
*
*

History: 2.0.9 - experimental * @param scheduler the target scheduler where to execute the disposal - * @return the new Single instance - * @throws NullPointerException if scheduler is null + * @return the new {@code Single} instance + * @throws NullPointerException if {@code scheduler} is {@code null} * @since 2.2 */ @CheckReturnValue @@ -4141,8 +4241,8 @@ public final Single unsubscribeOn(@NonNull Scheduler scheduler) { } /** - * Returns a Single that emits the result of applying a specified function to the pair of items emitted by - * the source Single and another specified Single. + * Returns a {@code Single} that emits the result of applying a specified function to the pair of items emitted by + * the source {@code Single} and another specified {@link SingleSource}. *

* *

@@ -4151,15 +4251,15 @@ public final Single unsubscribeOn(@NonNull Scheduler scheduler) { *
* * @param - * the type of items emitted by the {@code other} Single + * the type of items emitted by the {@code other} {@code Single} * @param - * the type of items emitted by the resulting Single + * the type of items emitted by the resulting {@code Single} * @param other - * the other SingleSource + * the other {@code SingleSource} * @param zipper - * a function that combines the pairs of items from the two SingleSources to generate the items to - * be emitted by the resulting Single - * @return a Single that pairs up values from the source Single and the {@code other} SingleSource + * a function that combines the pairs of items from the two {@code SingleSource}s to generate the items to + * be emitted by the resulting {@code Single} + * @return the new {@code Single} that pairs up values from the source {@code Single} and the {@code other} {@code SingleSource} * and emits the results of {@code zipFunction} applied to these pairs * @see ReactiveX operators documentation: Zip */ @@ -4174,15 +4274,14 @@ public final Single zipWith(@NonNull SingleSource other, @NonNull B // Fluent test support, super handy and reduces test preparation boilerplate // ------------------------------------------------------------------------- /** - * Creates a TestObserver and subscribes - * it to this Single. + * Creates a {@link TestObserver} and subscribes it to this {@code Single}. *

* *

*
Scheduler:
*
{@code test} does not operate by default on a particular {@link Scheduler}.
*
- * @return the new TestObserver instance + * @return the new {@code TestObserver} instance * @since 2.0 */ @CheckReturnValue @@ -4195,16 +4294,16 @@ public final TestObserver test() { } /** - * Creates a TestObserver optionally in cancelled state, then subscribes it to this Single. + * Creates a {@link TestObserver} optionally in cancelled state, then subscribes it to this {@code Single}. *

* *

*
Scheduler:
*
{@code test} does not operate by default on a particular {@link Scheduler}.
*
- * @param dispose if true, the TestObserver will be cancelled before subscribing to this - * Single. - * @return the new TestObserver instance + * @param dispose if {@code true}, the {@code TestObserver} will be cancelled before subscribing to this + * {@code Single}. + * @return the new {@code TestObserver} instance * @since 2.0 */ @CheckReturnValue @@ -4251,9 +4350,10 @@ private static Single toSingle(@NonNull Flowable source) { *
Scheduler:
*
{@code fromCompletionStage} does not operate by default on a particular {@link Scheduler}.
* - * @param the element type of the CompletionStage - * @param stage the CompletionStage to convert to Single and signal its success value or error - * @return the new Single instance + * @param the element type of the {@code CompletionStage} + * @param stage the {@code CompletionStage} to convert to {@code Single} and signal its success value or error + * @return the new {@code Single} instance + * @throws NullPointerException if {@code stage} is {@code null} * @since 3.0.0 */ @CheckReturnValue @@ -4265,7 +4365,7 @@ private static Single toSingle(@NonNull Flowable source) { } /** - * Maps the upstream success value into an {@link Optional} and emits the contained item if not empty. + * Maps the upstream success value into an {@link Optional} and emits the contained item if not empty as a {@link Maybe}. *

* * @@ -4273,10 +4373,11 @@ private static Single toSingle(@NonNull Flowable source) { *

Scheduler:
*
{@code mapOptional} does not operate by default on a particular {@link Scheduler}.
* - * @param the non-null output type + * @param the non-{@code null} output type * @param mapper the function that receives the upstream success item and should return a non-empty {@code Optional} * to emit as the success output or an empty {@code Optional} to complete the {@code Maybe} - * @return the new Maybe instance + * @return the new {@code Maybe} instance + * @throws NullPointerException if {@code mapper} is {@code null} * @since 3.0.0 * @see #map(Function) * @see #filter(Predicate) @@ -4303,7 +4404,7 @@ private static Single toSingle(@NonNull Flowable source) { *
Scheduler:
*
{@code toCompletionStage} does not operate by default on a particular {@link Scheduler}.
* - * @return the new CompletionStage instance + * @return the new {@code CompletionStage} instance * @since 3.0.0 */ @CheckReturnValue @@ -4318,7 +4419,7 @@ public final CompletionStage toCompletionStage() { * items to the downstream consumer as a {@link Flowable}. * *

- * The operator closes the {@code Stream} upon cancellation and when it terminates. Exceptions raised when + * The operator closes the {@code Stream} upon cancellation and when it terminates. The exceptions raised when * closing a {@code Stream} are routed to the global error handler ({@link RxJavaPlugins#onError(Throwable)}. * If a {@code Stream} should not be closed, turn it into an {@link Iterable} and use {@link #flattenAsFlowable(Function)}: *


@@ -4342,7 +4443,8 @@ public final CompletionStage toCompletionStage() {
      * @param  the element type of the {@code Stream} and the output {@code Flowable}
      * @param mapper the function that receives the upstream success item and should
      * return a {@code Stream} of values to emit.
-     * @return the new Flowable instance
+     * @return the new {@code Flowable} instance
+     * @throws NullPointerException if {@code mapper} is {@code null}
      * @since 3.0.0
      * @see #flattenAsFlowable(Function)
      * @see #flattenStreamAsObservable(Function)
@@ -4362,7 +4464,7 @@ public final  Flowable flattenStreamAsFlowable(@NonNull Function
      * 
      * 

- * The operator closes the {@code Stream} upon cancellation and when it terminates. Exceptions raised when + * The operator closes the {@code Stream} upon cancellation and when it terminates. The exceptions raised when * closing a {@code Stream} are routed to the global error handler ({@link RxJavaPlugins#onError(Throwable)}. * If a {@code Stream} should not be closed, turn it into an {@link Iterable} and use {@link #flattenAsFlowable(Function)}: *


@@ -4383,7 +4485,8 @@ public final  Flowable flattenStreamAsFlowable(@NonNull Function the element type of the {@code Stream} and the output {@code Observable}
      * @param mapper the function that receives the upstream success item and should
      * return a {@code Stream} of values to emit.
-     * @return the new Observable instance
+     * @return the new {@code Observable} instance
+     * @throws NullPointerException if {@code mapper} is {@code null}
      * @since 3.0.0
      * @see #flattenAsObservable(Function)
      * @see #flattenStreamAsFlowable(Function)
diff --git a/src/test/java/io/reactivex/rxjava3/validators/JavadocCodesAndLinks.java b/src/test/java/io/reactivex/rxjava3/validators/JavadocCodesAndLinks.java
index 93f8cbffc0..a3d7957a5d 100644
--- a/src/test/java/io/reactivex/rxjava3/validators/JavadocCodesAndLinks.java
+++ b/src/test/java/io/reactivex/rxjava3/validators/JavadocCodesAndLinks.java
@@ -32,15 +32,20 @@ public class JavadocCodesAndLinks {
 
     @Test
     public void checkFlowable() throws Exception {
-        checkSource("Flowable");
+        checkSource("Flowable", "io.reactivex.rxjava3.core");
     }
 
     @Test
     public void checkCompletable() throws Exception {
-        checkSource("Completable");
+        checkSource("Completable", "io.reactivex.rxjava3.core");
     }
 
-    static void checkSource(String baseClassName) throws Exception {
+    @Test
+    public void checkSingle() throws Exception {
+        checkSource("Single", "io.reactivex.rxjava3.core");
+    }
+
+    static void checkSource(String baseClassName, String packageName) throws Exception {
         File f = TestHelper.findSource(baseClassName);
         if (f == null) {
             return;
@@ -120,6 +125,8 @@ else if (line.startsWith("@throws") || line.startsWith("@param")) {
                                     errors.append("The subsequent mention should be code: ")
                                     .append("{@code ").append(name)
                                     .append("}\r\n at ")
+                                    .append(packageName)
+                                    .append(".")
                                     .append(baseClassName)
                                     .append(".method(")
                                     .append(baseClassName)
@@ -136,6 +143,8 @@ else if (line.startsWith("@throws") || line.startsWith("@param")) {
                                 errors.append("The subsequent mention should be code: ")
                                 .append("{@code ").append(name)
                                 .append("}\r\n at ")
+                                .append(packageName)
+                                .append(".")
                                 .append(baseClassName)
                                 .append(".method(")
                                 .append(baseClassName)
@@ -152,6 +161,8 @@ else if (line.startsWith("@throws") || line.startsWith("@param")) {
                                     errors.append("The host type mention should be code: ")
                                     .append("{@code ").append(name)
                                     .append("}\r\n at ")
+                                    .append(packageName)
+                                    .append(".")
                                     .append(baseClassName)
                                     .append(".method(")
                                     .append(baseClassName)
@@ -175,6 +186,8 @@ else if (line.startsWith("@throws") || line.startsWith("@param")) {
                                     errors
                                     .append(name)
                                     .append("}\r\n at ")
+                                    .append(packageName)
+                                    .append(".")
                                     .append(baseClassName)
                                     .append(".method(")
                                     .append(baseClassName)
@@ -204,6 +217,8 @@ else if (line.startsWith("@throws") || line.startsWith("@param")) {
                                 errors.append("The host type mention should be code: ")
                                 .append("{@code ").append(name)
                                 .append("}\r\n at ")
+                                .append(packageName)
+                                .append(".")
                                 .append(baseClassName)
                                 .append(".method(")
                                 .append(baseClassName)
@@ -223,6 +238,8 @@ else if (!seenBefore) {
                                 errors
                                 .append(name)
                                 .append("}\r\n at ")
+                                .append(packageName)
+                                .append(".")
                                 .append(baseClassName)
                                 .append(".method(")
                                 .append(baseClassName)
@@ -234,6 +251,8 @@ else if (!seenBefore) {
                                 errors.append("The subsequent mention should be code: ")
                                 .append("{@code ").append(name)
                                 .append("}\r\n at ")
+                                .append(packageName)
+                                .append(".")
                                 .append(baseClassName)
                                 .append(".method(")
                                 .append(baseClassName)
diff --git a/src/test/java/io/reactivex/rxjava3/validators/JavadocForAnnotations.java b/src/test/java/io/reactivex/rxjava3/validators/JavadocForAnnotations.java
index 1411295126..9a63ea2b0d 100644
--- a/src/test/java/io/reactivex/rxjava3/validators/JavadocForAnnotations.java
+++ b/src/test/java/io/reactivex/rxjava3/validators/JavadocForAnnotations.java
@@ -125,7 +125,13 @@ static final void scanForBadMethod(StringBuilder sourceCode, String annotation,
                 if (k >= 0 && k <= idx) {
 
                     int ll = sourceCode.indexOf("You specify", k);
+                    if (ll < 0) {
+                        ll = sourceCode.indexOf("you specify", k);
+                    }
                     int lm = sourceCode.indexOf("This operator", k);
+                    if (lm < 0) {
+                        lm = sourceCode.indexOf("this operator", k);
+                    }
                     if ((ll < 0 || ll > idx) && (lm < 0 || lm > idx)) {
 
                         int n = sourceCode.indexOf("{@code ", k);
@@ -138,27 +144,30 @@ static final void scanForBadMethod(StringBuilder sourceCode, String annotation,
                             if (m < idx) {
                                 String mname = sourceCode.substring(n + 7, m);
 
-                                int q = sourceCode.indexOf("@SuppressWarnings({", idx);
+                                if (!"Scheduler".equals(mname)) {
 
-                                int o = sourceCode.indexOf("{", idx);
+                                    int q = sourceCode.indexOf("@SuppressWarnings({", idx);
 
-                                if (q + 18 == o) {
-                                    o = sourceCode.indexOf("{", q + 20);
-                                }
+                                    int o = sourceCode.indexOf("{", idx);
+
+                                    if (q + 18 == o) {
+                                        o = sourceCode.indexOf("{", q + 20);
+                                    }
 
-                                if (o >= 0) {
+                                    if (o >= 0) {
 
-                                    int p = sourceCode.indexOf(" " + mname + "(", idx);
+                                        int p = sourceCode.indexOf(" " + mname + "(", idx);
 
-                                    if (p < 0 || p > o) {
-                                        // when printed on the console, IDEs will create a clickable link to help navigate to the offending point
-                                        e.append("java.lang.RuntimeException: wrong method name in description of ").append(inDoc).append(" '").append(mname).append("'\r\n")
-                                        ;
-                                        int lc = lineNumber(sourceCode, idx);
+                                        if (p < 0 || p > o) {
+                                            // when printed on the console, IDEs will create a clickable link to help navigate to the offending point
+                                            e.append("java.lang.RuntimeException: wrong method name in description of ").append(inDoc).append(" '").append(mname).append("'\r\n")
+                                            ;
+                                            int lc = lineNumber(sourceCode, idx);
 
-                                        e.append(" at io.reactivex.rxjava3.core.").append(baseClassName)
-                                        .append(".method(").append(baseClassName).append(".java:")
-                                        .append(lc).append(")").append("\r\n");
+                                            e.append(" at io.reactivex.rxjava3.core.").append(baseClassName)
+                                            .append(".method(").append(baseClassName).append(".java:")
+                                            .append(lc).append(")").append("\r\n");
+                                        }
                                     }
                                 }
                             }
diff --git a/src/test/java/io/reactivex/rxjava3/validators/ParamValidationNaming.java b/src/test/java/io/reactivex/rxjava3/validators/ParamValidationNaming.java
index 7ab384f5d3..79fd425c5e 100644
--- a/src/test/java/io/reactivex/rxjava3/validators/ParamValidationNaming.java
+++ b/src/test/java/io/reactivex/rxjava3/validators/ParamValidationNaming.java
@@ -189,11 +189,12 @@ static void processFile(Class clazz) throws Exception {
             String line = lines.get(j).trim();
 
             for (ValidatorStrings validatorStr : VALIDATOR_STRINGS) {
-                if (line.startsWith(validatorStr.code)) {
+                int strIdx = line.indexOf(validatorStr.code);
+                if (strIdx >= 0) {
 
-                    int comma = line.indexOf(',');
+                    int comma = line.indexOf(',', strIdx + validatorStr.code.length());
 
-                    String paramName = line.substring(validatorStr.code.length(), comma);
+                    String paramName = line.substring(strIdx + validatorStr.code.length(), comma);
 
                     int quote = line.indexOf('"', comma);
 
@@ -220,9 +221,10 @@ static void processFile(Class clazz) throws Exception {
                     }
 
                     // FIXME enable for other types in separate PR!
-                    if (!baseClassName.equals("Completable")) {
+                    if (!baseClassName.equals("Completable") && !baseClassName.equals("Single")) {
                         continue;
                     }
+
                     // find JavaDoc of throws
                     boolean found = false;
                     for (int k = j - 1; k >= 0; k--) {