Skip to content

Commit

Permalink
2.x: Reword the just() operator and reference other typical alternati…
Browse files Browse the repository at this point in the history
…ves (#5830)

* 2.x: Reword the just() operator and reference other typical alternatives

* Fix a/an
  • Loading branch information
akarnokd authored Feb 1, 2018
1 parent 421b9a4 commit 1fbc44f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
18 changes: 11 additions & 7 deletions src/main/java/io/reactivex/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2458,17 +2458,17 @@ public static Flowable<Long> 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.
* <p>
* <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.png" alt="">
* <p>
* 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).
* <p>
* 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.
* <p>
* 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)}.
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>The operator honors backpressure from downstream.</dd>
Expand All @@ -2482,6 +2482,10 @@ public static Flowable<Long> 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 <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
* @see #just(Object, Object)
* @see #fromCallable(Callable)
* @see #fromArray(Object...)
* @see #fromIterable(Iterable)
*/
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
Expand Down
18 changes: 11 additions & 7 deletions src/main/java/io/reactivex/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2234,17 +2234,17 @@ public static Observable<Long> 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.
* <p>
* <img width="640" height="290" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.item.png" alt="">
* <p>
* 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).
* <p>
* 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.
* <p>
* 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)}.
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code just} does not operate by default on a particular {@link Scheduler}.</dd>
Expand All @@ -2256,6 +2256,10 @@ public static Observable<Long> 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 <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
* @see #just(Object, Object)
* @see #fromCallable(Callable)
* @see #fromArray(Object...)
* @see #fromIterable(Iterable)
*/
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
Expand Down

0 comments on commit 1fbc44f

Please sign in to comment.