src/main/java/io/reactivex/Single.java
@SuppressWarnings("unchecked")
    @CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <R> Single<R> compose(SingleTransformer<? super T, ? extends R> transformer) {
        return wrap(((SingleTransformer<T, R>) ObjectHelper.requireNonNull(transformer, "transformer is null")).apply(this));
    }
@SuppressWarnings("unchecked")
    @CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <R> Single<R> compose(SingleTransformer<? super T, ? extends R> transformer) {
        return wrap(((SingleTransformer<T, R>) ObjectHelper.requireNonNull(transformer, "transformer is null")).apply(this));
    }
@ SuppressWarnings ( "unchecked" ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Single < R > compose ( SingleTransformer < ? super T , ? extends R > transformer ) { return wrap ( ( ( SingleTransformer < T , R > ) ObjectHelper . requireNonNull ( transformer , "transformer is null" ) ) . apply ( this ) ) ; }
Transform a Single by applying a particular Transformer function to it.
<p>
<img width="640" height="612" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.compose.png" alt="">
<p>
This method operates on the Single itself whereas {@link #lift} operates on the Single's SingleObservers.
<p>
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
applying a particular set of existing RxJava operators to it) use {@code compose}.
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code compose} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <R> 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
@see <a href="https://github.com/ReactiveX/RxJava/wiki/Implementing-Your-Own-Operators">RxJava wiki: Implementing Your Own Operators</a>
Transform a Single by applying a particular Transformer function to it . <p > <img width = 640 height = 612 src = https : // raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Single . compose . png alt = > <p > This method operates on the Single itself whereas { @link #lift } operates on the Single s SingleObservers . <p > 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 applying a particular set of existing RxJava operators to it ) use { @code compose } . <dl > <dt > <b > Scheduler : < / b > < / dt > <dd > { @code compose } does not operate by default on a particular { @link Scheduler } . < / dd > < / dl >