public final class RxJavaInterop
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static rx.Completable |
toV1Completable(io.reactivex.CompletableSource source)
Converts an 2.x CompletableSource (the base type of 2.x Completable) into a
1.x Completable, composing cancellation (unsubscription) through.
|
static <T> rx.Completable |
toV1Completable(io.reactivex.MaybeSource<T> source)
Converts an 2.x MaybeSource (the base type of 2.x Maybe) into a
1.x Completable, composing cancellation (unsubscription) through
and ignoring the success value.
|
static <T> rx.Observable<T> |
toV1Observable(io.reactivex.ObservableSource<T> source,
io.reactivex.BackpressureStrategy strategy)
Converts a 2.x ObservableSource (the base type of 2.x Observable) into an 1.x
Observable instance, applying the specified backpressure strategy and composing
the cancellation (unsubscription) through.
|
static <T> rx.Observable<T> |
toV1Observable(org.reactivestreams.Publisher<T> source)
Converts a Reactive-Streams Publisher of any kind (the base type of 2.x Flowable)
into an 1.x Observable, composing the backpressure and cancellation
(unsubscription) through.
|
static <T,R> rx.Observable.Operator<R,T> |
toV1Operator(io.reactivex.FlowableOperator<R,T> operator)
Convert the 2.x FlowableOperator into a 1.x Observable.Operator.
|
static <T> rx.Single<T> |
toV1Single(io.reactivex.MaybeSource<T> source)
Converts an 2.x MaybeSource (the base type of 2.x Maybe) into a
1.x Single, composing cancellation (unsubscription) through and
signalling NoSuchElementException if the MaybeSource is empty.
|
static <T> rx.Single<T> |
toV1Single(io.reactivex.SingleSource<T> source)
Converts an 2.x SingleSource (the base type of 2.x Single) into a
1.x Single, composing cancellation (unsubscription) through.
|
static <T> rx.subjects.Subject<T,T> |
toV1Subject(io.reactivex.processors.FlowableProcessor<T> processor)
Wraps a 2.x FlowableProcessor into a 1.x Subject.
|
static <T> rx.subjects.Subject<T,T> |
toV1Subject(io.reactivex.subjects.Subject<T> subject)
Wraps a 2.x Subject into a 1.x Subject.
|
static rx.Completable.Transformer |
toV1Transformer(io.reactivex.CompletableTransformer transformer)
Convert the 2.x CompletableTransformer into a 1.x Completable.Transformer.
|
static <T,R> rx.Observable.Transformer<T,R> |
toV1Transformer(io.reactivex.FlowableTransformer<T,R> transformer)
Convert the 2.x FlowableTransformer into a 1.x Observable.Transformer.
|
static <T,R> rx.Single.Transformer<T,R> |
toV1Transformer(io.reactivex.SingleTransformer<T,R> transformer)
Convert the 2.x SingleTransformer into a 1.x Single.Transformer.
|
static io.reactivex.Completable |
toV2Completable(rx.Completable source)
Converts an 1.x Completable into a 2.x Completable, composing cancellation (unsubscription) through.
|
static <T> io.reactivex.Flowable<T> |
toV2Flowable(rx.Observable<T> source)
Converts an 1.x Observable into a 2.x Flowable, composing the backpressure and
cancellation (unsubscription) through.
|
static <T> io.reactivex.Maybe<T> |
toV2Maybe(rx.Completable source)
Converts an 1.x Completable into a 2.x Maybe, composing cancellation (unsubscription) through.
|
static <T> io.reactivex.Maybe<T> |
toV2Maybe(rx.Single<T> source)
Converts an 1.x Single into a 2.x Maybe, composing cancellation (unsubscription) through.
|
static <T> io.reactivex.Observable<T> |
toV2Observable(rx.Observable<T> source)
Converts an 1.x Observable into a 2.x Observable, cancellation (unsubscription) through.
|
static <T,R> io.reactivex.FlowableOperator<R,T> |
toV2Operator(rx.Observable.Operator<R,T> operator)
Convert the 1.x Observable.Operator into a 2.x FlowableOperator.
|
static <T> io.reactivex.processors.FlowableProcessor<T> |
toV2Processor(rx.subjects.Subject<T,T> subject)
Wraps a 1.x Subject into a 2.x FlowableProcessor.
|
static <T> io.reactivex.Single<T> |
toV2Single(rx.Single<T> source)
Converts an 1.x Single into a 2.x Single, composing cancellation (unsubscription) through.
|
static <T> io.reactivex.subjects.Subject<T> |
toV2Subject(rx.subjects.Subject<T,T> subject)
Wraps a 1.x Subject into a 2.x Subject.
|
static io.reactivex.CompletableTransformer |
toV2Transformer(rx.Completable.Transformer transformer)
Convert the 1.x Completable.Transformer into a 2.x CompletableTransformer.
|
static <T,R> io.reactivex.FlowableTransformer<T,R> |
toV2Transformer(rx.Observable.Transformer<T,R> transformer)
Convert the 1.x Observable.Transformer into a 2.x FlowableTransformer.
|
static <T,R> io.reactivex.SingleTransformer<T,R> |
toV2Transformer(rx.Single.Transformer<T,R> transformer)
Convert the 1.x Single.Transformer into a 2.x SingleTransformer.
|
@SchedulerSupport(value="none") public static <T> io.reactivex.Flowable<T> toV2Flowable(rx.Observable<T> source)
Note that in 1.x Observable's backpressure somewhat optional; you may need to apply one of the onBackpressureXXX operators on the source Observable or the resulting Flowable.
Observable's backpressure behavior.Scheduler.T - the value typesource - the source 1.x Observable instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> io.reactivex.Observable<T> toV2Observable(rx.Observable<T> source)
Observable in an
unbounded manner (without applying backpressure).Scheduler.T - the value typesource - the source 1.x Observable instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> io.reactivex.Maybe<T> toV2Maybe(rx.Completable source)
Scheduler.T - the value typesource - the source 1.x Completable instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> io.reactivex.Maybe<T> toV2Maybe(rx.Single<T> source)
Scheduler.T - the value typesource - the source 1.x Single instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> io.reactivex.Single<T> toV2Single(rx.Single<T> source)
Scheduler.T - the value typesource - the source 1.x Single instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static io.reactivex.Completable toV2Completable(rx.Completable source)
Scheduler.source - the source 1.x Completable instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> io.reactivex.subjects.Subject<T> toV2Subject(rx.subjects.Subject<T,T> subject)
Scheduler.T - the input and output value type of the Subjectssubject - the subject to wrap with the same input and output type;
2.x Subject supports only the same input and output typejava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> io.reactivex.processors.FlowableProcessor<T> toV2Processor(rx.subjects.Subject<T,T> subject)
Subject's backpressure behavior.Scheduler.T - the input and output value type of the Subjectssubject - the subject to wrap with the same input and output type;
2.x FlowableProcessor supports only the same input and output typejava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T,R> io.reactivex.FlowableTransformer<T,R> toV2Transformer(rx.Observable.Transformer<T,R> transformer)
Scheduler.T - the input value typeR - the output value typetransformer - the 1.x Observable.Transformer to convert@SchedulerSupport(value="none") public static <T,R> io.reactivex.SingleTransformer<T,R> toV2Transformer(rx.Single.Transformer<T,R> transformer)
Scheduler.T - the input value typeR - the output value typetransformer - the 1.x Single.Transformer to convert@SchedulerSupport(value="none") public static io.reactivex.CompletableTransformer toV2Transformer(rx.Completable.Transformer transformer)
Scheduler.transformer - the 1.x Completable.Transformer to convert@SchedulerSupport(value="none") public static <T,R> io.reactivex.FlowableOperator<R,T> toV2Operator(rx.Observable.Operator<R,T> operator)
Scheduler.T - the input value typeR - the output value typeoperator - the 1.x Observable.Operator to convert@SchedulerSupport(value="none") public static <T> rx.Observable<T> toV1Observable(org.reactivestreams.Publisher<T> source)
Note that this method can convert any Reactive-Streams compliant source into an 1.x Observable, not just the 2.x Flowable.
Publisher's backpressure behavior.Scheduler.T - the value typesource - the source Reactive-Streams Publisher instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none")
public static <T> rx.Observable<T> toV1Observable(io.reactivex.ObservableSource<T> source,
io.reactivex.BackpressureStrategy strategy)
Scheduler.T - the value typesource - the source ObservableSource instance, not nullstrategy - the backpressure strategy to apply: BUFFER, DROP or LATEST.java.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> rx.Single<T> toV1Single(io.reactivex.SingleSource<T> source)
Scheduler.T - the value typesource - the source 2.x SingleSource instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static rx.Completable toV1Completable(io.reactivex.CompletableSource source)
Scheduler.source - the source 2.x CompletableSource instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> rx.Single<T> toV1Single(io.reactivex.MaybeSource<T> source)
Scheduler.T - the source's value typesource - the source 2.x MaybeSource instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> rx.Completable toV1Completable(io.reactivex.MaybeSource<T> source)
Scheduler.T - the source's value typesource - the source 2.x MaybeSource instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> rx.subjects.Subject<T,T> toV1Subject(io.reactivex.subjects.Subject<T> subject)
Scheduler.T - the input and output value type of the Subjectssubject - the subject to wrap with the same input and output type;
2.x Subject supports only the same input and output typejava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> rx.subjects.Subject<T,T> toV1Subject(io.reactivex.processors.FlowableProcessor<T> processor)
FlowableProcessor's backpressure behavior.Scheduler.T - the input and output value type of the Subjectsprocessor - the flowable-processor to wrap with the same input and output type;
2.x FlowableProcessor supports only the same input and output typejava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T,R> rx.Observable.Transformer<T,R> toV1Transformer(io.reactivex.FlowableTransformer<T,R> transformer)
Scheduler.T - the input value typeR - the output value typetransformer - the 2.x FlowableTransformer to convert@SchedulerSupport(value="none") public static <T,R> rx.Single.Transformer<T,R> toV1Transformer(io.reactivex.SingleTransformer<T,R> transformer)
Scheduler.T - the input value typeR - the output value typetransformer - the 2.x SingleTransformer to convert@SchedulerSupport(value="none") public static rx.Completable.Transformer toV1Transformer(io.reactivex.CompletableTransformer transformer)
Scheduler.transformer - the 2.x CompletableTransformer to convert@SchedulerSupport(value="none") public static <T,R> rx.Observable.Operator<R,T> toV1Operator(io.reactivex.FlowableOperator<R,T> operator)
Scheduler.T - the input value typeR - the output value typeoperator - the 2.x FlowableOperator to convert