Skip to content

Commit 255d9e2

Browse files
committed
additional javadoc enhancements for lift & compose
1 parent de1b481 commit 255d9e2

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

rxjava-core/src/main/java/rx/Observable.java

+19-10
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ public static interface OnSubscribeFunc<T> extends Function {
147147
* <p> {@code
148148
* observable.map(...).filter(...).take(5).lift(new OperatorA()).lift(new OperatorB(...)).subscribe()
149149
* }
150+
* <p>
151+
* If the operator you are creating is designed to act on the individual items emitted by a source
152+
* Observable, use {@code lift}. If your operator is designed to transform the source Observable as a whole
153+
* (for instance, by applying a particular set of existing RxJava operators to it) use {@link #compose}.
150154
* <dl>
151155
* <dt><b>Scheduler:</b></dt>
152156
* <dd>{@code lift} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -182,17 +186,22 @@ public void call(Subscriber<? super R> o) {
182186

183187

184188
/**
185-
* Compose Observables together with a function.
186-
*
187-
* This works on the Observables themselves whereas {@link #lift} works on the internal
188-
* Subscriber/Observers.
189-
*
190-
* Use {@code lift} if you are creating an operator that acts on the underlying data. Use {@code compose} if
191-
* you are acting on the observable itself, for instance by composing multiple operators.
189+
* Transform an Observable by applying a particular Transformer function to it.
190+
* <p>
191+
* This method operates on the Observable itself whereas {@link #lift} operates on the Observable's
192+
* Subscribers or Observers.
193+
* <p>
194+
* If the operator you are creating is designed to act on the individual items emitted by a source
195+
* Observable, use {@link #lift}. If your operator is designed to transform the source Observable as a whole
196+
* (for instance, by applying a particular set of existing RxJava operators to it) use {@code compose}.
197+
* <dl>
198+
* <dt><b>Scheduler:</b></dt>
199+
* <dd>{@code compose} does not operate by default on a particular {@link Scheduler}.</dd>
200+
* </dl>
192201
*
193-
* @warn param transformer not described
194-
* @param transformer
195-
* @return
202+
* @param transformer implements the function that transforms the source Observable
203+
* @return the source Observable, transformed by the transformer function
204+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Implementing-Your-Own-Operators">RxJava wiki: Implementing Your Own Operators</a>
196205
* @since 0.20
197206
*/
198207
public <R> Observable<R> compose(Transformer<T, R> transformer) {

0 commit comments

Comments
 (0)