resourceSupplier,
- @NonNull Function super R, ? extends CompletableSource> completableFunction,
- @NonNull Consumer super R> disposer,
+ @NonNull Function super R, ? extends CompletableSource> sourceSupplier,
+ @NonNull Consumer super R> resourceCleanup,
boolean eager) {
Objects.requireNonNull(resourceSupplier, "resourceSupplier is null");
- Objects.requireNonNull(completableFunction, "completableFunction is null");
- Objects.requireNonNull(disposer, "disposer is null");
+ Objects.requireNonNull(sourceSupplier, "sourceSupplier is null");
+ Objects.requireNonNull(resourceCleanup, "resourceCleanup is null");
- return RxJavaPlugins.onAssembly(new CompletableUsing<>(resourceSupplier, completableFunction, disposer, eager));
+ return RxJavaPlugins.onAssembly(new CompletableUsing<>(resourceSupplier, sourceSupplier, resourceCleanup, eager));
}
/**
@@ -1390,7 +1390,7 @@ public final Completable concatWith(@NonNull CompletableSource other) {
* Scheduler:
* {@code delay} does operate by default on the {@code computation} {@link Scheduler}.
*
- * @param delay the delay time
+ * @param time the delay time
* @param unit the delay unit
* @return the new {@code Completable} instance
* @throws NullPointerException if {@code unit} is {@code null}
@@ -1398,8 +1398,8 @@ public final Completable concatWith(@NonNull CompletableSource other) {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
@NonNull
- public final Completable delay(long delay, @NonNull TimeUnit unit) {
- return delay(delay, unit, Schedulers.computation(), false);
+ public final Completable delay(long time, @NonNull TimeUnit unit) {
+ return delay(time, unit, Schedulers.computation(), false);
}
/**
@@ -1411,7 +1411,7 @@ public final Completable delay(long delay, @NonNull TimeUnit unit) {
* Scheduler:
* {@code delay} operates on the {@code Scheduler} you specify.
*
- * @param delay the delay time
+ * @param time the delay time
* @param unit the delay unit
* @param scheduler the {@code Scheduler} to run the delayed completion on
* @return the new {@code Completable} instance
@@ -1420,8 +1420,8 @@ public final Completable delay(long delay, @NonNull TimeUnit unit) {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
@NonNull
- public final Completable delay(long delay, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
- return delay(delay, unit, scheduler, false);
+ public final Completable delay(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
+ return delay(time, unit, scheduler, false);
}
/**
@@ -1433,7 +1433,7 @@ public final Completable delay(long delay, @NonNull TimeUnit unit, @NonNull Sche
* Scheduler:
* {@code delay} operates on the {@code Scheduler} you specify.
*
- * @param delay the delay time
+ * @param time the delay time
* @param unit the delay unit
* @param scheduler the {@code Scheduler} to run the delayed completion on
* @param delayError delay the error emission as well?
@@ -1443,10 +1443,10 @@ public final Completable delay(long delay, @NonNull TimeUnit unit, @NonNull Sche
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.CUSTOM)
- public final Completable delay(long delay, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError) {
+ public final Completable delay(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError) {
Objects.requireNonNull(unit, "unit is null");
Objects.requireNonNull(scheduler, "scheduler is null");
- return RxJavaPlugins.onAssembly(new CompletableDelay(this, delay, unit, scheduler, delayError));
+ return RxJavaPlugins.onAssembly(new CompletableDelay(this, time, unit, scheduler, delayError));
}
/**
@@ -1459,7 +1459,7 @@ public final Completable delay(long delay, @NonNull TimeUnit unit, @NonNull Sche
*
* History: 2.2.3 - experimental
*
- * @param delay the time to delay the subscription
+ * @param time the time to delay the subscription
* @param unit the time unit of {@code delay}
* @return the new {@code Completable} instance
* @throws NullPointerException if {@code unit} is {@code null}
@@ -1469,8 +1469,8 @@ public final Completable delay(long delay, @NonNull TimeUnit unit, @NonNull Sche
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
@NonNull
- public final Completable delaySubscription(long delay, @NonNull TimeUnit unit) {
- return delaySubscription(delay, unit, Schedulers.computation());
+ public final Completable delaySubscription(long time, @NonNull TimeUnit unit) {
+ return delaySubscription(time, unit, Schedulers.computation());
}
/**
@@ -1483,7 +1483,7 @@ public final Completable delaySubscription(long delay, @NonNull TimeUnit unit) {
*
You specify which {@code Scheduler} this operator will use.
*
* History: 2.2.3 - experimental
- * @param delay the time to delay the subscription
+ * @param time the time to delay the subscription
* @param unit the time unit of {@code delay}
* @param scheduler the {@code Scheduler} on which the waiting and subscription will happen
* @return the new {@code Completable} instance
@@ -1494,8 +1494,8 @@ public final Completable delaySubscription(long delay, @NonNull TimeUnit unit) {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
@NonNull
- public final Completable delaySubscription(long delay, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
- return Completable.timer(delay, unit, scheduler).andThen(this);
+ public final Completable delaySubscription(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
+ return Completable.timer(time, unit, scheduler).andThen(this);
}
/**
@@ -1974,17 +1974,17 @@ public final Completable onErrorComplete(@NonNull Predicate super Throwable> p
*
Scheduler:
* {@code onErrorResumeNext} does not operate by default on a particular {@link Scheduler}.
*
- * @param errorMapper the {@code mapper} {@code Function} that takes the error and should return a {@code CompletableSource} as
+ * @param fallbackSupplier the {@code mapper} {@code Function} that takes the error and should return a {@code CompletableSource} as
* continuation.
* @return the new {@code Completable} instance
- * @throws NullPointerException if {@code errorMapper} is {@code null}
+ * @throws NullPointerException if {@code fallbackSupplier} is {@code null}
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
- public final Completable onErrorResumeNext(@NonNull Function super Throwable, ? extends CompletableSource> errorMapper) {
- Objects.requireNonNull(errorMapper, "errorMapper is null");
- return RxJavaPlugins.onAssembly(new CompletableResumeNext(this, errorMapper));
+ public final Completable onErrorResumeNext(@NonNull Function super Throwable, ? extends CompletableSource> fallbackSupplier) {
+ Objects.requireNonNull(fallbackSupplier, "fallbackSupplier is null");
+ return RxJavaPlugins.onAssembly(new CompletableResumeNext(this, fallbackSupplier));
}
/**
@@ -2544,16 +2544,16 @@ public final Completable timeout(long timeout, @NonNull TimeUnit unit) {
*
* @param timeout the timeout value
* @param unit the unit of {@code timeout}
- * @param other the other {@code CompletableSource} instance to switch to in case of a timeout
+ * @param fallback the other {@code CompletableSource} instance to switch to in case of a timeout
* @return the new {@code Completable} instance
- * @throws NullPointerException if {@code unit} or {@code other} is {@code null}
+ * @throws NullPointerException if {@code unit} or {@code fallback} is {@code null}
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.COMPUTATION)
- public final Completable timeout(long timeout, @NonNull TimeUnit unit, @NonNull CompletableSource other) {
- Objects.requireNonNull(other, "other is null");
- return timeout0(timeout, unit, Schedulers.computation(), other);
+ public final Completable timeout(long timeout, @NonNull TimeUnit unit, @NonNull CompletableSource fallback) {
+ Objects.requireNonNull(fallback, "fallback is null");
+ return timeout0(timeout, unit, Schedulers.computation(), fallback);
}
/**
@@ -2593,16 +2593,16 @@ public final Completable timeout(long timeout, @NonNull TimeUnit unit, @NonNull
* @param timeout the timeout value
* @param unit the unit of {@code timeout}
* @param scheduler the {@code Scheduler} to use to wait for completion
- * @param other the other {@code Completable} instance to switch to in case of a timeout
+ * @param fallback the other {@code Completable} instance to switch to in case of a timeout
* @return the new {@code Completable} instance
- * @throws NullPointerException if {@code unit}, {@code scheduler} or {@code other} is {@code null}
+ * @throws NullPointerException if {@code unit}, {@code scheduler} or {@code fallback} is {@code null}
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.CUSTOM)
- public final Completable timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull CompletableSource other) {
- Objects.requireNonNull(other, "other is null");
- return timeout0(timeout, unit, scheduler, other);
+ public final Completable timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull CompletableSource fallback) {
+ Objects.requireNonNull(fallback, "fallback is null");
+ return timeout0(timeout, unit, scheduler, fallback);
}
/**
@@ -2616,18 +2616,18 @@ public final Completable timeout(long timeout, @NonNull TimeUnit unit, @NonNull
* @param timeout the timeout value
* @param unit the unit of {@code timeout}
* @param scheduler the {@code Scheduler} to use to wait for completion
- * @param other the other {@code Completable} instance to switch to in case of a timeout,
+ * @param fallback the other {@code Completable} instance to switch to in case of a timeout,
* if {@code null} a {@link TimeoutException} is emitted instead
* @return the new {@code Completable} instance
- * @throws NullPointerException if {@code unit}, {@code scheduler} or {@code other} is {@code null}
+ * @throws NullPointerException if {@code unit}, {@code scheduler} or {@code fallback} is {@code null}
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.CUSTOM)
- private Completable timeout0(long timeout, TimeUnit unit, Scheduler scheduler, CompletableSource other) {
+ private Completable timeout0(long timeout, TimeUnit unit, Scheduler scheduler, CompletableSource fallback) {
Objects.requireNonNull(unit, "unit is null");
Objects.requireNonNull(scheduler, "scheduler is null");
- return RxJavaPlugins.onAssembly(new CompletableTimeout(this, timeout, unit, scheduler, other));
+ return RxJavaPlugins.onAssembly(new CompletableTimeout(this, timeout, unit, scheduler, fallback));
}
/**
diff --git a/src/main/java/io/reactivex/rxjava3/core/Flowable.java b/src/main/java/io/reactivex/rxjava3/core/Flowable.java
index 54bc24fca0..038c3f680b 100644
--- a/src/main/java/io/reactivex/rxjava3/core/Flowable.java
+++ b/src/main/java/io/reactivex/rxjava3/core/Flowable.java
@@ -2178,9 +2178,9 @@ public static Flowable error(@NonNull Throwable throwable) {
* {@code fromPublisher} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type of the flow
- * @param source the {@code Publisher} to convert
+ * @param publisher the {@code Publisher} to convert
* @return the new {@code Flowable} instance
- * @throws NullPointerException if the {@code source} {@code Publisher} is {@code null}
+ * @throws NullPointerException if {@code publisher} is {@code null}
* @see #create(FlowableOnSubscribe, BackpressureStrategy)
*/
@CheckReturnValue
@@ -2188,13 +2188,13 @@ public static Flowable error(@NonNull Throwable throwable) {
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport(SchedulerSupport.NONE)
@SuppressWarnings("unchecked")
- public static Flowable fromPublisher(@NonNull Publisher<@NonNull ? extends T> source) {
- if (source instanceof Flowable) {
- return RxJavaPlugins.onAssembly((Flowable)source);
+ public static Flowable fromPublisher(@NonNull Publisher<@NonNull ? extends T> publisher) {
+ if (publisher instanceof Flowable) {
+ return RxJavaPlugins.onAssembly((Flowable)publisher);
}
- Objects.requireNonNull(source, "source is null");
+ Objects.requireNonNull(publisher, "publisher is null");
- return RxJavaPlugins.onAssembly(new FlowableFromPublisher<>(source));
+ return RxJavaPlugins.onAssembly(new FlowableFromPublisher<>(publisher));
}
/**
@@ -4514,10 +4514,10 @@ public static Flowable unsafeCreate(@NonNull Publisher onSubscribe) {
* the factory function to create a resource object that depends on the {@code Publisher}
* @param sourceSupplier
* the factory function to create a {@code Publisher}
- * @param resourceDisposer
+ * @param resourceCleanup
* the function that will dispose of the resource
* @return the new {@code Flowable} instance
- * @throws NullPointerException if {@code resourceSupplier}, {@code sourceSupplier} or {@code resourceDisposer} is {@code null}
+ * @throws NullPointerException if {@code resourceSupplier}, {@code sourceSupplier} or {@code resourceCleanup} is {@code null}
* @see ReactiveX operators documentation: Using
*/
@CheckReturnValue
@@ -4527,8 +4527,8 @@ public static Flowable unsafeCreate(@NonNull Publisher onSubscribe) {
public static Flowable using(
@NonNull Supplier extends D> resourceSupplier,
@NonNull Function super D, ? extends Publisher<@NonNull ? extends T>> sourceSupplier,
- @NonNull Consumer super D> resourceDisposer) {
- return using(resourceSupplier, sourceSupplier, resourceDisposer, true);
+ @NonNull Consumer super D> resourceCleanup) {
+ return using(resourceSupplier, sourceSupplier, resourceCleanup, true);
}
/**
@@ -4551,7 +4551,7 @@ public static Flowable using(
* the factory function to create a resource object that depends on the {@code Publisher}
* @param sourceSupplier
* the factory function to create a {@code Publisher}
- * @param resourceDisposer
+ * @param resourceCleanup
* the function that will dispose of the resource
* @param eager
* If {@code true}, the resource disposal will happen either on a {@code cancel()} call before the upstream is disposed
@@ -4559,7 +4559,7 @@ public static Flowable using(
* If {@code false} the resource disposal will happen either on a {@code cancel()} call after the upstream is disposed
* or just after the emission of a terminal event ({@code onComplete} or {@code onError}).
* @return the new {@code Flowable} instance
- * @throws NullPointerException if {@code resourceSupplier}, {@code sourceSupplier} or {@code resourceDisposer} is {@code null}
+ * @throws NullPointerException if {@code resourceSupplier}, {@code sourceSupplier} or {@code resourceCleanup} is {@code null}
* @see ReactiveX operators documentation: Using
* @since 2.0
*/
@@ -4570,12 +4570,12 @@ public static Flowable using(
public static Flowable using(
@NonNull Supplier extends D> resourceSupplier,
@NonNull Function super D, ? extends Publisher<@NonNull ? extends T>> sourceSupplier,
- @NonNull Consumer super D> resourceDisposer,
+ @NonNull Consumer super D> resourceCleanup,
boolean eager) {
Objects.requireNonNull(resourceSupplier, "resourceSupplier is null");
Objects.requireNonNull(sourceSupplier, "sourceSupplier is null");
- Objects.requireNonNull(resourceDisposer, "resourceDisposer is null");
- return RxJavaPlugins.onAssembly(new FlowableUsing(resourceSupplier, sourceSupplier, resourceDisposer, eager));
+ Objects.requireNonNull(resourceCleanup, "resourceCleanup is null");
+ return RxJavaPlugins.onAssembly(new FlowableUsing(resourceSupplier, sourceSupplier, resourceCleanup, eager));
}
/**
@@ -5944,6 +5944,7 @@ public final Iterable blockingLatest() {
* the initial item that the {@code Iterable} sequence will yield if this
* {@code Flowable} has not yet emitted an item
* @return the new {@code Iterable} instance
+ * @throws NullPointerException if {@code initialItem} is {@code null}
* @see ReactiveX documentation: First
*/
@CheckReturnValue
@@ -5951,6 +5952,7 @@ public final Iterable blockingLatest() {
@SchedulerSupport(SchedulerSupport.NONE)
@NonNull
public final Iterable blockingMostRecent(@NonNull T initialItem) {
+ Objects.requireNonNull(initialItem, "initialItem is null");
return new BlockingFlowableMostRecent<>(this, initialItem);
}
@@ -8616,7 +8618,7 @@ public final Flowable delay(@NonNull Function super T, ? extends Publis
* This version of {@code delay} operates by default on the {@code computation} {@link Scheduler}.
*
*
- * @param delay
+ * @param time
* the delay to shift the source by
* @param unit
* the {@link TimeUnit} in which {@code period} is defined
@@ -8628,8 +8630,8 @@ public final Flowable delay(@NonNull Function super T, ? extends Publis
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.COMPUTATION)
@NonNull
- public final Flowable delay(long delay, @NonNull TimeUnit unit) {
- return delay(delay, unit, Schedulers.computation(), false);
+ public final Flowable delay(long time, @NonNull TimeUnit unit) {
+ return delay(time, unit, Schedulers.computation(), false);
}
/**
@@ -8644,7 +8646,7 @@ public final Flowable delay(long delay, @NonNull TimeUnit unit) {
* This version of {@code delay} operates by default on the {@code computation} {@link Scheduler}.
*
*
- * @param delay
+ * @param time
* the delay to shift the source by
* @param unit
* the {@link TimeUnit} in which {@code period} is defined
@@ -8659,8 +8661,8 @@ public final Flowable delay(long delay, @NonNull TimeUnit unit) {
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.COMPUTATION)
@NonNull
- public final Flowable delay(long delay, @NonNull TimeUnit unit, boolean delayError) {
- return delay(delay, unit, Schedulers.computation(), delayError);
+ public final Flowable delay(long time, @NonNull TimeUnit unit, boolean delayError) {
+ return delay(time, unit, Schedulers.computation(), delayError);
}
/**
@@ -8675,7 +8677,7 @@ public final Flowable delay(long delay, @NonNull TimeUnit unit, boolean delay
* You specify which {@link Scheduler} this operator will use.
*
*
- * @param delay
+ * @param time
* the delay to shift the source by
* @param unit
* the time unit of {@code delay}
@@ -8689,8 +8691,8 @@ public final Flowable delay(long delay, @NonNull TimeUnit unit, boolean delay
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.CUSTOM)
@NonNull
- public final Flowable delay(long delay, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
- return delay(delay, unit, scheduler, false);
+ public final Flowable delay(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
+ return delay(time, unit, scheduler, false);
}
/**
@@ -8705,7 +8707,7 @@ public final Flowable delay(long delay, @NonNull TimeUnit unit, @NonNull Sche
* You specify which {@link Scheduler} this operator will use.
*
*
- * @param delay
+ * @param time
* the delay to shift the source by
* @param unit
* the time unit of {@code delay}
@@ -8722,11 +8724,11 @@ public final Flowable delay(long delay, @NonNull TimeUnit unit, @NonNull Sche
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.CUSTOM)
- public final Flowable delay(long delay, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError) {
+ public final Flowable delay(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError) {
Objects.requireNonNull(unit, "unit is null");
Objects.requireNonNull(scheduler, "scheduler is null");
- return RxJavaPlugins.onAssembly(new FlowableDelay<>(this, Math.max(0L, delay), unit, scheduler, delayError));
+ return RxJavaPlugins.onAssembly(new FlowableDelay<>(this, Math.max(0L, time), unit, scheduler, delayError));
}
/**
@@ -8807,7 +8809,7 @@ public final Flowable delaySubscription(@NonNull Publisher subscriptio
* This version of {@code delaySubscription} operates by default on the {@code computation} {@link Scheduler}.
*
*
- * @param delay
+ * @param time
* the time to delay the subscription
* @param unit
* the time unit of {@code delay}
@@ -8819,8 +8821,8 @@ public final Flowable delaySubscription(@NonNull Publisher subscriptio
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.COMPUTATION)
@NonNull
- public final Flowable delaySubscription(long delay, @NonNull TimeUnit unit) {
- return delaySubscription(delay, unit, Schedulers.computation());
+ public final Flowable delaySubscription(long time, @NonNull TimeUnit unit) {
+ return delaySubscription(time, unit, Schedulers.computation());
}
/**
@@ -8835,7 +8837,7 @@ public final Flowable delaySubscription(long delay, @NonNull TimeUnit unit) {
* You specify which {@code Scheduler} this operator will use.
*
*
- * @param delay
+ * @param time
* the time to delay the subscription
* @param unit
* the time unit of {@code delay}
@@ -8849,8 +8851,8 @@ public final Flowable delaySubscription(long delay, @NonNull TimeUnit unit) {
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.CUSTOM)
@NonNull
- public final Flowable delaySubscription(long delay, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
- return delaySubscription(timer(delay, unit, scheduler));
+ public final Flowable delaySubscription(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
+ return delaySubscription(timer(time, unit, scheduler));
}
/**
@@ -12334,20 +12336,20 @@ public final Flowable onBackpressureLatest() {
* {@code onErrorResumeNext} does not operate by default on a particular {@link Scheduler}.
*
*
- * @param resumeFunction
+ * @param fallbackSupplier
* a function that returns a {@code Publisher} that will take over if the current {@code Flowable} encounters
* an error
* @return the new {@code Flowable} instance
- * @throws NullPointerException if {@code resumeFunction} is {@code null}
+ * @throws NullPointerException if {@code fallbackSupplier} is {@code null}
* @see ReactiveX operators documentation: Catch
*/
@CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
- public final Flowable onErrorResumeNext(@NonNull Function super Throwable, ? extends Publisher<@NonNull ? extends T>> resumeFunction) {
- Objects.requireNonNull(resumeFunction, "resumeFunction is null");
- return RxJavaPlugins.onAssembly(new FlowableOnErrorNext<>(this, resumeFunction));
+ public final Flowable onErrorResumeNext(@NonNull Function super Throwable, ? extends Publisher<@NonNull ? extends T>> fallbackSupplier) {
+ Objects.requireNonNull(fallbackSupplier, "fallbackSupplier is null");
+ return RxJavaPlugins.onAssembly(new FlowableOnErrorNext<>(this, fallbackSupplier));
}
/**
@@ -12379,20 +12381,20 @@ public final Flowable onErrorResumeNext(@NonNull Function super Throwable,
* {@code onErrorResumeWith} does not operate by default on a particular {@link Scheduler}.
*
*
- * @param next
+ * @param fallback
* the next {@code Publisher} source that will take over if the current {@code Flowable} encounters
* an error
* @return the new {@code Flowable} instance
- * @throws NullPointerException if {@code next} is {@code null}
+ * @throws NullPointerException if {@code fallback} is {@code null}
* @see ReactiveX operators documentation: Catch
*/
@CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
- public final Flowable onErrorResumeWith(@NonNull Publisher<@NonNull ? extends T> next) {
- Objects.requireNonNull(next, "next is null");
- return onErrorResumeNext(Functions.justFunction(next));
+ public final Flowable onErrorResumeWith(@NonNull Publisher<@NonNull ? extends T> fallback) {
+ Objects.requireNonNull(fallback, "fallback is null");
+ return onErrorResumeNext(Functions.justFunction(fallback));
}
/**
@@ -12420,20 +12422,20 @@ public final Flowable onErrorResumeWith(@NonNull Publisher<@NonNull ? extends
* {@code onErrorReturn} does not operate by default on a particular {@link Scheduler}.
*
*
- * @param valueSupplier
+ * @param itemSupplier
* a function that returns a single value that will be emitted along with a regular {@code onComplete} in case
* the current {@code Flowable} signals an {@code onError} event
* @return the new {@code Flowable} instance
- * @throws NullPointerException if {@code valueSupplier} is {@code null}
+ * @throws NullPointerException if {@code itemSupplier} is {@code null}
* @see ReactiveX operators documentation: Catch
*/
@CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
- public final Flowable onErrorReturn(@NonNull Function super Throwable, ? extends T> valueSupplier) {
- Objects.requireNonNull(valueSupplier, "valueSupplier is null");
- return RxJavaPlugins.onAssembly(new FlowableOnErrorReturn<>(this, valueSupplier));
+ public final Flowable onErrorReturn(@NonNull Function super Throwable, ? extends T> itemSupplier) {
+ Objects.requireNonNull(itemSupplier, "itemSupplier is null");
+ return RxJavaPlugins.onAssembly(new FlowableOnErrorReturn<>(this, itemSupplier));
}
/**
@@ -16918,19 +16920,19 @@ public final Flowable timeout(@NonNull Function super T, ? extends Publ
* @param itemTimeoutIndicator
* a function that returns a {@code Publisher}, for each item emitted by the current {@code Flowable}, that
* determines the timeout window for the subsequent item
- * @param other
+ * @param fallback
* the fallback {@code Publisher} to switch to if the current {@code Flowable} times out
* @return the new {@code Flowable} instance
- * @throws NullPointerException if {@code itemTimeoutIndicator} or {@code other} is {@code null}
+ * @throws NullPointerException if {@code itemTimeoutIndicator} or {@code fallback} is {@code null}
* @see ReactiveX operators documentation: Timeout
*/
@CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
- public final Flowable timeout(@NonNull Function super T, ? extends Publisher<@NonNull V>> itemTimeoutIndicator, @NonNull Publisher<@NonNull ? extends T> other) {
- Objects.requireNonNull(other, "other is null");
- return timeout0(null, itemTimeoutIndicator, other);
+ public final Flowable timeout(@NonNull Function super T, ? extends Publisher<@NonNull V>> itemTimeoutIndicator, @NonNull Publisher<@NonNull ? extends T> fallback) {
+ Objects.requireNonNull(fallback, "fallback is null");
+ return timeout0(null, itemTimeoutIndicator, fallback);
}
/**
@@ -16983,19 +16985,19 @@ public final Flowable timeout(long timeout, @NonNull TimeUnit unit) {
* maximum duration between items before a timeout occurs
* @param unit
* the unit of time that applies to the {@code timeout} argument
- * @param other
+ * @param fallback
* the fallback {@code Publisher} to use in case of a timeout
* @return the new {@code Flowable} instance
- * @throws NullPointerException if {@code unit} or {@code other} is {@code null}
+ * @throws NullPointerException if {@code unit} or {@code fallback} is {@code null}
* @see ReactiveX operators documentation: Timeout
*/
@CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.COMPUTATION)
- public final Flowable timeout(long timeout, @NonNull TimeUnit unit, @NonNull Publisher<@NonNull ? extends T> other) {
- Objects.requireNonNull(other, "other is null");
- return timeout0(timeout, unit, other, Schedulers.computation());
+ public final Flowable timeout(long timeout, @NonNull TimeUnit unit, @NonNull Publisher<@NonNull ? extends T> fallback) {
+ Objects.requireNonNull(fallback, "fallback is null");
+ return timeout0(timeout, unit, fallback, Schedulers.computation());
}
/**
@@ -17021,19 +17023,19 @@ public final Flowable timeout(long timeout, @NonNull TimeUnit unit, @NonNull
* the unit of time that applies to the {@code timeout} argument
* @param scheduler
* the {@code Scheduler} to run the timeout timers on
- * @param other
+ * @param fallback
* the {@code Publisher} to use as the fallback in case of a timeout
* @return the new {@code Flowable} instance
- * @throws NullPointerException if {@code unit}, {@code scheduler} or {@code other} is {@code null}
+ * @throws NullPointerException if {@code unit}, {@code scheduler} or {@code fallback} is {@code null}
* @see ReactiveX operators documentation: Timeout
*/
@CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.CUSTOM)
- public final Flowable timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Publisher<@NonNull ? extends T> other) {
- Objects.requireNonNull(other, "other is null");
- return timeout0(timeout, unit, other, scheduler);
+ public final Flowable timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Publisher<@NonNull ? extends T> fallback) {
+ Objects.requireNonNull(fallback, "fallback is null");
+ return timeout0(timeout, unit, fallback, scheduler);
}
/**
@@ -17136,10 +17138,10 @@ public final Flowable timeout(@NonNull Publisher firstTimeoutIndica
* a function that returns a {@code Publisher} for each item emitted by the current {@code Flowable} and that
* determines the timeout window in which the subsequent source item must arrive in order to
* continue the sequence
- * @param other
+ * @param fallback
* the fallback {@code Publisher} to switch to if the current {@code Flowable} times out
* @return the new {@code Flowable} instance
- * @throws NullPointerException if {@code firstTimeoutIndicator}, {@code itemTimeoutIndicator} or {@code other} is {@code null}
+ * @throws NullPointerException if {@code firstTimeoutIndicator}, {@code itemTimeoutIndicator} or {@code fallback} is {@code null}
* @see ReactiveX operators documentation: Timeout
*/
@CheckReturnValue
@@ -17149,25 +17151,25 @@ public final Flowable timeout(@NonNull Publisher firstTimeoutIndica
public final Flowable timeout(
@NonNull Publisher firstTimeoutIndicator,
@NonNull Function super T, ? extends Publisher> itemTimeoutIndicator,
- @NonNull Publisher<@NonNull ? extends T> other) {
+ @NonNull Publisher<@NonNull ? extends T> fallback) {
Objects.requireNonNull(firstTimeoutIndicator, "firstTimeoutIndicator is null");
- Objects.requireNonNull(other, "other is null");
- return timeout0(firstTimeoutIndicator, itemTimeoutIndicator, other);
+ Objects.requireNonNull(fallback, "fallback is null");
+ return timeout0(firstTimeoutIndicator, itemTimeoutIndicator, fallback);
}
- private Flowable timeout0(long timeout, TimeUnit unit, Publisher<@NonNull ? extends T> other,
+ private Flowable timeout0(long timeout, TimeUnit unit, Publisher<@NonNull ? extends T> fallback,
Scheduler scheduler) {
Objects.requireNonNull(unit, "unit is null");
Objects.requireNonNull(scheduler, "scheduler is null");
- return RxJavaPlugins.onAssembly(new FlowableTimeoutTimed<>(this, timeout, unit, scheduler, other));
+ return RxJavaPlugins.onAssembly(new FlowableTimeoutTimed<>(this, timeout, unit, scheduler, fallback));
}
private Flowable timeout0(
Publisher firstTimeoutIndicator,
Function super T, ? extends Publisher<@NonNull V>> itemTimeoutIndicator,
- Publisher<@NonNull ? extends T> other) {
+ Publisher<@NonNull ? extends T> fallback) {
Objects.requireNonNull(itemTimeoutIndicator, "itemTimeoutIndicator is null");
- return RxJavaPlugins.onAssembly(new FlowableTimeout<>(this, firstTimeoutIndicator, itemTimeoutIndicator, other));
+ return RxJavaPlugins.onAssembly(new FlowableTimeout<>(this, firstTimeoutIndicator, itemTimeoutIndicator, fallback));
}
/**
diff --git a/src/main/java/io/reactivex/rxjava3/core/Maybe.java b/src/main/java/io/reactivex/rxjava3/core/Maybe.java
index 82cb7545c2..4322afaa93 100644
--- a/src/main/java/io/reactivex/rxjava3/core/Maybe.java
+++ b/src/main/java/io/reactivex/rxjava3/core/Maybe.java
@@ -620,17 +620,17 @@ public static Maybe create(@NonNull MaybeOnSubscribe onSubscribe) {
* {@code defer} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type
- * @param maybeSupplier the {@code Supplier} that is called for each individual {@code MaybeObserver} and
+ * @param supplier the {@code Supplier} that is called for each individual {@code MaybeObserver} and
* returns a {@code MaybeSource} instance to subscribe to
* @return the new {@code Maybe} instance
- * @throws NullPointerException if {@code maybeSupplier} is {@code null}
+ * @throws NullPointerException if {@code supplier} is {@code null}
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
- public static Maybe defer(@NonNull Supplier extends MaybeSource extends T>> maybeSupplier) {
- Objects.requireNonNull(maybeSupplier, "maybeSupplier is null");
- return RxJavaPlugins.onAssembly(new MaybeDefer<>(maybeSupplier));
+ public static Maybe defer(@NonNull Supplier extends MaybeSource extends T>> supplier) {
+ Objects.requireNonNull(supplier, "supplier is null");
+ return RxJavaPlugins.onAssembly(new MaybeDefer<>(supplier));
}
/**
@@ -663,20 +663,20 @@ public static Maybe empty() {
* {@code error} does not operate by default on a particular {@link Scheduler}.
*
*
- * @param error
+ * @param throwable
* the particular {@link Throwable} to pass to {@link MaybeObserver#onError onError}
* @param
* the type of the item (ostensibly) emitted by the {@code Maybe}
* @return the new {@code Maybe} instance
- * @throws NullPointerException if {@code error} is {@code null}
+ * @throws NullPointerException if {@code throwable} is {@code null}
* @see ReactiveX operators documentation: Throw
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
- public static Maybe error(@NonNull Throwable error) {
- Objects.requireNonNull(error, "error is null");
- return RxJavaPlugins.onAssembly(new MaybeError<>(error));
+ public static Maybe error(@NonNull Throwable throwable) {
+ Objects.requireNonNull(throwable, "throwable is null");
+ return RxJavaPlugins.onAssembly(new MaybeError<>(throwable));
}
/**
@@ -760,16 +760,16 @@ public static Maybe fromCompletable(@NonNull CompletableSource completabl
* {@code fromSingle} does not operate by default on a particular {@link Scheduler}.
*
* @param the target type
- * @param singleSource the {@code SingleSource} to convert from
+ * @param single the {@code SingleSource} to convert from
* @return the new {@code Maybe} instance
- * @throws NullPointerException if {@code singleSource} is {@code null}
+ * @throws NullPointerException if {@code single} is {@code null}
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
- public static Maybe fromSingle(@NonNull SingleSource singleSource) {
- Objects.requireNonNull(singleSource, "singleSource is null");
- return RxJavaPlugins.onAssembly(new MaybeFromSingle<>(singleSource));
+ public static Maybe fromSingle(@NonNull SingleSource single) {
+ Objects.requireNonNull(single, "single is null");
+ return RxJavaPlugins.onAssembly(new MaybeFromSingle<>(single));
}
/**
@@ -1799,9 +1799,10 @@ public static Maybe unsafeCreate(@NonNull MaybeSource onSubscribe) {
* the factory function to create a resource object that depends on the {@code Maybe}
* @param sourceSupplier
* the factory function to create a {@code MaybeSource}
- * @param resourceDisposer
+ * @param resourceCleanup
* the function that will dispose of the resource
* @return the new {@code Maybe} instance
+ * @throws NullPointerException if {@code resourceSupplier}, {@code sourceSupplier} or {@code resourceCleanup} is {@code null}
* @see ReactiveX operators documentation: Using
*/
@CheckReturnValue
@@ -1809,8 +1810,8 @@ public static Maybe unsafeCreate(@NonNull MaybeSource onSubscribe) {
@NonNull
public static Maybe using(@NonNull Supplier extends D> resourceSupplier,
@NonNull Function super D, ? extends MaybeSource extends T>> sourceSupplier,
- @NonNull Consumer super D> resourceDisposer) {
- return using(resourceSupplier, sourceSupplier, resourceDisposer, true);
+ @NonNull Consumer super D> resourceCleanup) {
+ return using(resourceSupplier, sourceSupplier, resourceCleanup, true);
}
/**
@@ -1832,7 +1833,7 @@ public static Maybe using(@NonNull Supplier extends D> resourceSuppl
* the factory function to create a resource object that depends on the {@code Maybe}
* @param sourceSupplier
* the factory function to create a {@code MaybeSource}
- * @param resourceDisposer
+ * @param resourceCleanup
* the function that will dispose of the resource
* @param eager
* If {@code true} then resource disposal will happen either on a {@code dispose()} call before the upstream is disposed
@@ -1840,7 +1841,7 @@ public static Maybe using(@NonNull Supplier extends D> resourceSuppl
* 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}, {@code onComplete} or {@code onError}).
* @return the new {@code Maybe} instance
- * @throws NullPointerException if {@code resourceSupplier}, {@code sourceSupplier} or {@code resourceDisposer} is {@code null}
+ * @throws NullPointerException if {@code resourceSupplier}, {@code sourceSupplier} or {@code resourceCleanup} is {@code null}
* @see ReactiveX operators documentation: Using
*/
@CheckReturnValue
@@ -1848,11 +1849,11 @@ public static Maybe using(@NonNull Supplier extends D> resourceSuppl
@SchedulerSupport(SchedulerSupport.NONE)
public static Maybe using(@NonNull Supplier extends D> resourceSupplier,
@NonNull Function super D, ? extends MaybeSource extends T>> sourceSupplier,
- @NonNull Consumer super D> resourceDisposer, boolean eager) {
+ @NonNull Consumer super D> resourceCleanup, boolean eager) {
Objects.requireNonNull(resourceSupplier, "resourceSupplier is null");
Objects.requireNonNull(sourceSupplier, "sourceSupplier is null");
- Objects.requireNonNull(resourceDisposer, "resourceDisposer is null");
- return RxJavaPlugins.onAssembly(new MaybeUsing(resourceSupplier, sourceSupplier, resourceDisposer, eager));
+ Objects.requireNonNull(resourceCleanup, "resourceCleanup is null");
+ return RxJavaPlugins.onAssembly(new MaybeUsing(resourceSupplier, sourceSupplier, resourceCleanup, eager));
}
/**
@@ -2678,7 +2679,7 @@ public final Single defaultIfEmpty(@NonNull T defaultItem) {
* This version of {@code delay} operates by default on the {@code computation} {@link Scheduler}.
*
*
- * @param delay
+ * @param time
* the delay to shift the source by
* @param unit
* the {@link TimeUnit} in which {@code period} is defined
@@ -2690,8 +2691,8 @@ public final Single defaultIfEmpty(@NonNull T defaultItem) {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
@NonNull
- public final Maybe delay(long delay, @NonNull TimeUnit unit) {
- return delay(delay, unit, Schedulers.computation());
+ public final Maybe delay(long time, @NonNull TimeUnit unit) {
+ return delay(time, unit, Schedulers.computation());
}
/**
@@ -2704,7 +2705,7 @@ public final Maybe delay(long delay, @NonNull TimeUnit unit) {
* you specify which {@code Scheduler} this operator will use.
*
*
- * @param delay
+ * @param time
* the delay to shift the source by
* @param unit
* the time unit of {@code delay}
@@ -2717,10 +2718,10 @@ public final Maybe delay(long delay, @NonNull TimeUnit unit) {
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.CUSTOM)
- public final Maybe delay(long delay, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
+ public final Maybe delay(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
Objects.requireNonNull(unit, "unit is null");
Objects.requireNonNull(scheduler, "scheduler is null");
- return RxJavaPlugins.onAssembly(new MaybeDelay<>(this, Math.max(0L, delay), unit, scheduler));
+ return RxJavaPlugins.onAssembly(new MaybeDelay<>(this, Math.max(0L, time), unit, scheduler));
}
/**
@@ -2789,7 +2790,7 @@ public final Maybe delaySubscription(@NonNull Publisher subscriptionIn
* This version of {@code delaySubscription} operates by default on the {@code computation} {@link Scheduler}.
*
*
- * @param delay
+ * @param time
* the time to delay the subscription
* @param unit
* the time unit of {@code delay}
@@ -2801,8 +2802,8 @@ public final Maybe delaySubscription(@NonNull Publisher subscriptionIn
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
@NonNull
- public final Maybe delaySubscription(long delay, @NonNull TimeUnit unit) {
- return delaySubscription(delay, unit, Schedulers.computation());
+ public final Maybe delaySubscription(long time, @NonNull TimeUnit unit) {
+ return delaySubscription(time, unit, Schedulers.computation());
}
/**
@@ -2815,7 +2816,7 @@ public final Maybe delaySubscription(long delay, @NonNull TimeUnit unit) {
* You specify which {@code Scheduler} this operator will use.
*
*
- * @param delay
+ * @param time
* the time to delay the subscription
* @param unit
* the time unit of {@code delay}
@@ -2828,8 +2829,8 @@ public final Maybe delaySubscription(long delay, @NonNull TimeUnit unit) {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
@NonNull
- public final Maybe delaySubscription(long delay, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
- return delaySubscription(Flowable.timer(delay, unit, scheduler));
+ public final Maybe delaySubscription(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {
+ return delaySubscription(Flowable.timer(time, unit, scheduler));
}
/**
@@ -3198,21 +3199,21 @@ public final Maybe flatMap(
* the type of items emitted by the resulting {@code Maybe}
* @param mapper
* a function that returns a {@code MaybeSource} for the item emitted by the current {@code Maybe}
- * @param resultSelector
+ * @param combiner
* a function that combines one item emitted by each of the source and collection {@code MaybeSource} and
* returns an item to be emitted by the resulting {@code MaybeSource}
* @return the new {@code Maybe} instance
- * @throws NullPointerException if {@code mapper} or {@code resultSelector} is {@code null}
+ * @throws NullPointerException if {@code mapper} or {@code combiner} is {@code null}
* @see ReactiveX operators documentation: FlatMap
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe flatMap(@NonNull Function super T, ? extends MaybeSource extends U>> mapper,
- @NonNull BiFunction super T, ? super U, ? extends R> resultSelector) {
+ @NonNull BiFunction super T, ? super U, ? extends R> combiner) {
Objects.requireNonNull(mapper, "mapper is null");
- Objects.requireNonNull(resultSelector, "resultSelector is null");
- return RxJavaPlugins.onAssembly(new MaybeFlatMapBiSelector<>(this, mapper, resultSelector));
+ Objects.requireNonNull(combiner, "combiner is null");
+ return RxJavaPlugins.onAssembly(new MaybeFlatMapBiSelector<>(this, mapper, combiner));
}
/**
@@ -3880,19 +3881,19 @@ public final Maybe onErrorComplete(@NonNull Predicate super Throwable> pred
* {@code onErrorResumeWith} does not operate by default on a particular {@link Scheduler}.
*
*
- * @param next
+ * @param fallback
* the next {@code MaybeSource} that will take over if the current {@code Maybe} encounters
* an error
* @return the new {@code Maybe} instance
- * @throws NullPointerException if {@code next} is {@code null}
+ * @throws NullPointerException if {@code fallback} is {@code null}
* @see ReactiveX operators documentation: Catch
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
- public final Maybe onErrorResumeWith(@NonNull MaybeSource extends T> next) {
- Objects.requireNonNull(next, "next is null");
- return onErrorResumeNext(Functions.justFunction(next));
+ public final Maybe onErrorResumeWith(@NonNull MaybeSource extends T> fallback) {
+ Objects.requireNonNull(fallback, "fallback is null");
+ return onErrorResumeNext(Functions.justFunction(fallback));
}
/**
@@ -3908,19 +3909,19 @@ public final Maybe onErrorResumeWith(@NonNull MaybeSource extends T> next)
* {@code onErrorResumeNext} does not operate by default on a particular {@link Scheduler}.
*
*
- * @param resumeFunction
+ * @param fallbackSupplier
* a function that returns a {@code MaybeSource} that will take over if the current {@code Maybe} encounters
* an error
* @return the new {@code Maybe} instance
- * @throws NullPointerException if {@code resumeFunction} is {@code null}
+ * @throws NullPointerException if {@code fallbackSupplier} is {@code null}
* @see ReactiveX operators documentation: Catch
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
- public final Maybe onErrorResumeNext(@NonNull Function super Throwable, ? extends MaybeSource extends T>> resumeFunction) {
- Objects.requireNonNull(resumeFunction, "resumeFunction is null");
- return RxJavaPlugins.onAssembly(new MaybeOnErrorNext<>(this, resumeFunction));
+ public final Maybe onErrorResumeNext(@NonNull Function super Throwable, ? extends MaybeSource extends T>> fallbackSupplier) {
+ Objects.requireNonNull(fallbackSupplier, "fallbackSupplier is null");
+ return RxJavaPlugins.onAssembly(new MaybeOnErrorNext<>(this, fallbackSupplier));
}
/**
@@ -3936,19 +3937,19 @@ public final Maybe onErrorResumeNext(@NonNull Function super Throwable, ? e
* {@code onErrorReturn} does not operate by default on a particular {@link Scheduler}.
*
*
- * @param valueSupplier
+ * @param itemSupplier
* a function that returns a single value that will be emitted as success value
* the current {@code Maybe} signals an {@code onError} event
* @return the new {@code Maybe} instance
- * @throws NullPointerException if {@code valueSupplier} is {@code null}
+ * @throws NullPointerException if {@code itemSupplier} is {@code null}
* @see ReactiveX operators documentation: Catch
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
- public final Maybe onErrorReturn(@NonNull Function super Throwable, ? extends T> valueSupplier) {
- Objects.requireNonNull(valueSupplier, "valueSupplier is null");
- return RxJavaPlugins.onAssembly(new MaybeOnErrorReturn<>(this, valueSupplier));
+ public final Maybe onErrorReturn(@NonNull Function super Throwable, ? extends T> itemSupplier) {
+ Objects.requireNonNull(itemSupplier, "itemSupplier is null");
+ return RxJavaPlugins.onAssembly(new MaybeOnErrorReturn<>(this, itemSupplier));
}
/**
diff --git a/src/main/java/io/reactivex/rxjava3/core/Observable.java b/src/main/java/io/reactivex/rxjava3/core/Observable.java
index 0ea4c18b47..57456a9545 100644
--- a/src/main/java/io/reactivex/rxjava3/core/Observable.java
+++ b/src/main/java/io/reactivex/rxjava3/core/Observable.java
@@ -1692,20 +1692,20 @@ public static Observable empty() {
* {@code error} does not operate by default on a particular {@link Scheduler}.
*
*
- * @param errorSupplier
+ * @param supplier
* a {@link Supplier} factory to return a {@link Throwable} for each individual {@code Observer}
* @param
* the type of the items (ostensibly) emitted by the {@code Observable}
* @return the new {@code Observable} instance
- * @throws NullPointerException if {@code errorSupplier} is {@code null}
+ * @throws NullPointerException if {@code supplier} is {@code null}
* @see ReactiveX operators documentation: Throw
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
- public static Observable error(@NonNull Supplier extends Throwable> errorSupplier) {
- Objects.requireNonNull(errorSupplier, "errorSupplier is null");
- return RxJavaPlugins.onAssembly(new ObservableError<>(errorSupplier));
+ public static Observable error(@NonNull Supplier extends Throwable> supplier) {
+ Objects.requireNonNull(supplier, "supplier is null");
+ return RxJavaPlugins.onAssembly(new ObservableError<>(supplier));
}
/**
@@ -1718,20 +1718,20 @@ public static Observable error(@NonNull Supplier extends Throwable> err
* {@code error} does not operate by default on a particular {@link Scheduler}.
*
*
- * @param exception
+ * @param throwable
* the particular {@link Throwable} to pass to {@link Observer#onError onError}
* @param
* the type of the items (ostensibly) emitted by the {@code Observable}
* @return the new {@code Observable} instance
- * @throws NullPointerException if {@code exception} is {@code null}
+ * @throws NullPointerException if {@code throwable} is {@code null}
* @see ReactiveX operators documentation: Throw
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
- public static Observable error(@NonNull Throwable exception) {
- Objects.requireNonNull(exception, "exception is null");
- return error(Functions.justSupplier(exception));
+ public static Observable error(@NonNull Throwable throwable) {
+ Objects.requireNonNull(throwable, "throwable is null");
+ return error(Functions.justSupplier(throwable));
}
/**
@@ -4082,9 +4082,10 @@ public static Observable unsafeCreate(@NonNull ObservableSource onSubs
* the factory function to create a resource object that depends on the {@code ObservableSource}
* @param sourceSupplier
* the factory function to create an {@code ObservableSource}
- * @param resourceDisposer
+ * @param resourceCleanup
* the function that will dispose of the resource
* @return the new {@code Observable} instance
+ * @throws NullPointerException if {@code resourceSupplier}, {@code sourceSupplier} or {@code resourceCleanup} is {@code null}
* @see ReactiveX operators documentation: Using
*/
@CheckReturnValue
@@ -4093,8 +4094,8 @@ public static Observable unsafeCreate(@NonNull ObservableSource onSubs
public static Observable using(
@NonNull Supplier extends D> resourceSupplier,
@NonNull Function super D, ? extends ObservableSource extends T>> sourceSupplier,
- @NonNull Consumer super D> resourceDisposer) {
- return using(resourceSupplier, sourceSupplier, resourceDisposer, true);
+ @NonNull Consumer super D> resourceCleanup) {
+ return using(resourceSupplier, sourceSupplier, resourceCleanup, true);
}
/**
@@ -4114,7 +4115,7 @@ public static Observable using(
* the factory function to create a resource object that depends on the {@code ObservableSource}
* @param sourceSupplier
* the factory function to create an {@code ObservableSource}
- * @param resourceDisposer
+ * @param resourceCleanup
* the function that will dispose of the resource
* @param eager
* If {@code true}, the resource disposal will happen either on a {@code dispose()} call before the upstream is disposed
@@ -4122,7 +4123,7 @@ public static Observable using(
* 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 onComplete} or {@code onError}).
* @return the new {@code Observable} instance
- * @throws NullPointerException if {@code resourceSupplier}, {@code sourceSupplier} and {@code resourceDisposer} is {@code null}
+ * @throws NullPointerException if {@code resourceSupplier}, {@code sourceSupplier} and {@code resourceCleanup} is {@code null}
* @see ReactiveX operators documentation: Using
* @since 2.0
*/
@@ -4132,11 +4133,11 @@ public static Observable using(
public static Observable using(
@NonNull Supplier extends D> resourceSupplier,
@NonNull Function super D, ? extends ObservableSource extends T>> sourceSupplier,
- @NonNull Consumer super D> resourceDisposer, boolean eager) {
+ @NonNull Consumer super D> resourceCleanup, boolean eager) {
Objects.requireNonNull(resourceSupplier, "resourceSupplier is null");
Objects.requireNonNull(sourceSupplier, "sourceSupplier is null");
- Objects.requireNonNull(resourceDisposer, "resourceDisposer is null");
- return RxJavaPlugins.onAssembly(new ObservableUsing(resourceSupplier, sourceSupplier, resourceDisposer, eager));
+ Objects.requireNonNull(resourceCleanup, "resourceCleanup is null");
+ return RxJavaPlugins.onAssembly(new ObservableUsing(resourceSupplier, sourceSupplier, resourceCleanup, eager));
}
/**
@@ -5428,17 +5429,19 @@ public final Iterable blockingLatest() {
* {@code blockingMostRecent} does not operate by default on a particular {@link Scheduler}.
*
*
- * @param initialValue
+ * @param initialItem
* the initial value that the {@code Iterable} sequence will yield if the current
* {@code Observable} has not yet emitted an item
* @return the new {@code Iterable} instance
+ * @throws NullPointerException if {@code initialItem} is {@code null}
* @see ReactiveX documentation: First
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@NonNull
- public final Iterable blockingMostRecent(@NonNull T initialValue) {
- return new BlockingObservableMostRecent<>(this, initialValue);
+ public final Iterable blockingMostRecent(@NonNull T initialItem) {
+ Objects.requireNonNull(initialItem, "initialItem is null");
+ return new BlockingObservableMostRecent<>(this, initialItem);
}
/**
@@ -6236,23 +6239,23 @@ public final > Observable buffer(int count, i
* @param the collection subclass type to buffer into
* @param
* the boundary value type (ignored)
- * @param boundary
+ * @param boundaryIndicator
* the boundary {@code ObservableSource}
* @param bufferSupplier
* a factory function that returns an instance of the collection subclass to be used and returned
* as the buffer
* @return the new {@code Observable} instance
- * @throws NullPointerException if {@code boundary} or {@code bufferSupplier} is {@code null}
+ * @throws NullPointerException if {@code boundaryIndicator} or {@code bufferSupplier} is {@code null}
* @see #buffer(ObservableSource, int)
* @see ReactiveX operators documentation: Buffer
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@NonNull
- public final > Observable buffer(@NonNull ObservableSource boundary, @NonNull Supplier bufferSupplier) {
- Objects.requireNonNull(boundary, "boundary is null");
+ public final > Observable buffer(@NonNull ObservableSource boundaryIndicator, @NonNull Supplier bufferSupplier) {
+ Objects.requireNonNull(boundaryIndicator, "boundaryIndicator is null");
Objects.requireNonNull(bufferSupplier, "bufferSupplier is null");
- return RxJavaPlugins.onAssembly(new ObservableBufferExactBoundary<>(this, boundary, bufferSupplier));
+ return RxJavaPlugins.onAssembly(new ObservableBufferExactBoundary<>(this, boundaryIndicator, bufferSupplier));
}
/**
@@ -6416,22 +6419,22 @@ public final Observable cast(@NonNull Class clazz) {
*
*
* @param the accumulator and output type
- * @param initialValueSupplier
+ * @param initialItemSupplier
* the mutable data structure that will collect the items
* @param collector
* a function that accepts the {@code state} and an emitted item, and modifies the accumulator accordingly
* accordingly
* @return the new {@code Single} instance
- * @throws NullPointerException if {@code initialValueSupplier} or {@code collector} is {@code null}
+ * @throws NullPointerException if {@code initialItemSupplier} or {@code collector} is {@code null}
* @see ReactiveX operators documentation: Reduce
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@NonNull
- public final Single collect(@NonNull Supplier extends U> initialValueSupplier, @NonNull BiConsumer super U, ? super T> collector) {
- Objects.requireNonNull(initialValueSupplier, "initialValueSupplier is null");
+ public final Single collect(@NonNull Supplier extends U> initialItemSupplier, @NonNull BiConsumer super U, ? super T> collector) {
+ Objects.requireNonNull(initialItemSupplier, "initialItemSupplier is null");
Objects.requireNonNull(collector, "collector is null");
- return RxJavaPlugins.onAssembly(new ObservableCollectSingle<>(this, initialValueSupplier, collector));
+ return RxJavaPlugins.onAssembly(new ObservableCollectSingle<>(this, initialItemSupplier, collector));
}
/**
@@ -6451,21 +6454,21 @@ public final Single collect(@NonNull Supplier extends U> initialValueSu
*
*
* @param the accumulator and output type
- * @param initialValue
+ * @param initialItem
* the mutable data structure that will collect the items
* @param collector
* a function that accepts the {@code state} and an emitted item, and modifies the accumulator accordingly
* accordingly
* @return the new {@code Single} instance
- * @throws NullPointerException if {@code initialValue} or {@code collector} is {@code null}
+ * @throws NullPointerException if {@code initialItem} or {@code collector} is {@code null}
* @see ReactiveX operators documentation: Reduce
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@NonNull
- public final Single collectInto(@NonNull U initialValue, @NonNull BiConsumer super U, ? super T> collector) {
- Objects.requireNonNull(initialValue, "initialValue is null");
- return collect(Functions.justSupplier(initialValue), collector);
+ public final Single collectInto(@NonNull U initialItem, @NonNull BiConsumer super U, ? super T> collector) {
+ Objects.requireNonNull(initialItem, "initialItem is null");
+ return collect(Functions.justSupplier(initialItem), collector);
}
/**
@@ -7454,18 +7457,18 @@ public final Observable concatWith(@NonNull CompletableSource other) {
* {@code contains} does not operate by default on a particular {@link Scheduler}.
*
*
- * @param element
+ * @param item
* the item to search for in the emissions from the current {@code Observable}
* @return the new {@code Single} instance
- * @throws NullPointerException if {@code element} is {@code null}
+ * @throws NullPointerException if {@code item} is {@code null}
* @see ReactiveX operators documentation: Contains
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@NonNull
- public final Single contains(@NonNull Object element) {
- Objects.requireNonNull(element, "element is null");
- return any(Functions.equalsWith(element));
+ public final Single contains(@NonNull Object item) {
+ Objects.requireNonNull(item, "item is null");
+ return any(Functions.equalsWith(item));
}
/**
@@ -7509,18 +7512,18 @@ public final Single count() {
*
* @param
* the debounce value type (ignored)
- * @param debounceSelector
+ * @param debounceIndicator
* function to return a sequence that indicates the throttle duration for each item via its own emission or completion
* @return the new {@code Observable} instance
- * @throws NullPointerException if {@code debounceSelector} is {@code null}
+ * @throws NullPointerException if {@code debounceIndicator} is {@code null}
* @see ReactiveX operators documentation: Debounce
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@NonNull
- public final Observable debounce(@NonNull Function super T, ? extends ObservableSource> debounceSelector) {
- Objects.requireNonNull(debounceSelector, "debounceSelector is null");
- return RxJavaPlugins.onAssembly(new ObservableDebounce<>(this, debounceSelector));
+ public final Observable debounce(@NonNull Function super T, ? extends ObservableSource> debounceIndicator) {
+ Objects.requireNonNull(debounceIndicator, "debounceIndicator is null");
+ return RxJavaPlugins.onAssembly(new ObservableDebounce<>(this, debounceIndicator));
}
/**
@@ -7644,20 +7647,20 @@ public final Observable defaultIfEmpty(@NonNull T defaultItem) {
*
* @param