From 1fbc44fb81ec65f624cc98a318217dc031cf6d4e Mon Sep 17 00:00:00 2001 From: David Karnok Date: Thu, 1 Feb 2018 07:36:51 +0100 Subject: [PATCH] 2.x: Reword the just() operator and reference other typical alternatives (#5830) * 2.x: Reword the just() operator and reference other typical alternatives * Fix a/an --- src/main/java/io/reactivex/Flowable.java | 18 +++++++++++------- src/main/java/io/reactivex/Observable.java | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/main/java/io/reactivex/Flowable.java b/src/main/java/io/reactivex/Flowable.java index 7c861b8d92..4e9c2d2ee0 100644 --- a/src/main/java/io/reactivex/Flowable.java +++ b/src/main/java/io/reactivex/Flowable.java @@ -2458,17 +2458,17 @@ public static Flowable intervalRange(long start, long count, long initialD } /** - * Returns a Flowable that emits a single item and then completes. + * Returns a Flowable that signals the given (constant reference) item and then completes. *

* *

- * To convert any object into a Publisher that emits that object, pass that object into the {@code just} - * method. + * Note that the item is taken and re-emitted as is and not computed by any means by {@code just}. Use {@link #fromCallable(Callable)} + * to generate a single item on demand (when {@code Subscriber}s subscribe to it). + *

+ * See the multi-parameter overloads of {@code just} to emit more than one (constant reference) items one after the other. + * Use {@link #fromArray(Object...)} to emit an arbitrary number of items that are known upfront. *

- * This is similar to the {@link #fromArray(java.lang.Object[])} method, except that {@code from} will convert - * an {@link Iterable} object into a Publisher that emits each of the items in the Iterable, one at a - * time, while the {@code just} method converts an Iterable into a Publisher that emits the entire - * Iterable as a single item. + * To emit the items of an {@link Iterable} sequence (such as a {@link java.util.List}), use {@link #fromIterable(Iterable)}. *

*
Backpressure:
*
The operator honors backpressure from downstream.
@@ -2482,6 +2482,10 @@ public static Flowable intervalRange(long start, long count, long initialD * the type of that item * @return a Flowable that emits {@code value} as a single item and then completes * @see ReactiveX operators documentation: Just + * @see #just(Object, Object) + * @see #fromCallable(Callable) + * @see #fromArray(Object...) + * @see #fromIterable(Iterable) */ @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) diff --git a/src/main/java/io/reactivex/Observable.java b/src/main/java/io/reactivex/Observable.java index e4fd63fd8d..e15da78bfd 100644 --- a/src/main/java/io/reactivex/Observable.java +++ b/src/main/java/io/reactivex/Observable.java @@ -2234,17 +2234,17 @@ public static Observable intervalRange(long start, long count, long initia } /** - * Returns an Observable that emits a single item and then completes. + * Returns an Observable that signals the given (constant reference) item and then completes. *

* *

- * To convert any object into an ObservableSource that emits that object, pass that object into the {@code just} - * method. + * Note that the item is taken and re-emitted as is and not computed by any means by {@code just}. Use {@link #fromCallable(Callable)} + * to generate a single item on demand (when {@code Observer}s subscribe to it). + *

+ * See the multi-parameter overloads of {@code just} to emit more than one (constant reference) items one after the other. + * Use {@link #fromArray(Object...)} to emit an arbitrary number of items that are known upfront. *

- * This is similar to the {@link #fromArray(java.lang.Object[])} method, except that {@code from} will convert - * an {@link Iterable} object into an ObservableSource that emits each of the items in the Iterable, one at a - * time, while the {@code just} method converts an Iterable into an ObservableSource that emits the entire - * Iterable as a single item. + * To emit the items of an {@link Iterable} sequence (such as a {@link java.util.List}), use {@link #fromIterable(Iterable)}. *

*
Scheduler:
*
{@code just} does not operate by default on a particular {@link Scheduler}.
@@ -2256,6 +2256,10 @@ public static Observable intervalRange(long start, long count, long initia * the type of that item * @return an Observable that emits {@code value} as a single item and then completes * @see ReactiveX operators documentation: Just + * @see #just(Object, Object) + * @see #fromCallable(Callable) + * @see #fromArray(Object...) + * @see #fromIterable(Iterable) */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE)