public final class RxJavaInterop
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static Completable |
toV1Completable(CompletableSource source)
Converts an 3.x CompletableSource (the base type of 3.x Completable) into a
1.x Completable, composing cancellation (unsubscription) through.
|
static <T> Completable |
toV1Completable(MaybeSource<T> source)
Converts an 3.x MaybeSource (the base type of 3.x Maybe) into a
1.x Completable, composing cancellation (unsubscription) through
and ignoring the success value.
|
static <T> Observable<T> |
toV1Observable(ObservableSource<T> source,
BackpressureStrategy strategy)
Converts a 3.x ObservableSource (the base type of 3.x Observable) into an 1.x
Observable instance, applying the specified backpressure strategy and composing
the cancellation (unsubscription) through.
|
static <T> Observable<T> |
toV1Observable(org.reactivestreams.Publisher<T> source)
Converts a Reactive-Streams Publisher of any kind (the base type of 3.x Flowable)
into an 1.x Observable, composing the backpressure and cancellation
(unsubscription) through.
|
static <T,R> Observable.Operator<R,T> |
toV1Operator(FlowableOperator<R,T> operator)
Convert the 3.x FlowableOperator into a 1.x Observable.Operator.
|
static Scheduler |
toV1Scheduler(Scheduler scheduler)
|
static <T> Single<T> |
toV1Single(MaybeSource<T> source)
Converts an 3.x MaybeSource (the base type of 3.x Maybe) into a
1.x Single, composing cancellation (unsubscription) through and
signalling NoSuchElementException if the MaybeSource is empty.
|
static <T> Single<T> |
toV1Single(SingleSource<T> source)
Converts an 3.x SingleSource (the base type of 3.x Single) into a
1.x Single, composing cancellation (unsubscription) through.
|
static <T> Subject<T,T> |
toV1Subject(FlowableProcessor<T> processor)
Wraps a 3.x FlowableProcessor into a 1.x Subject.
|
static <T> Subject<T,T> |
toV1Subject(Subject<T> subject)
Wraps a 3.x Subject into a 1.x Subject.
|
static Subscription |
toV1Subscription(Disposable disposable)
Convert the 3.x
Disposable into a 1.x Subscription. |
static Completable.Transformer |
toV1Transformer(CompletableTransformer transformer)
Convert the 3.x CompletableTransformer into a 1.x Completable.Transformer.
|
static <T,R> Observable.Transformer<T,R> |
toV1Transformer(FlowableTransformer<T,R> transformer)
Convert the 3.x FlowableTransformer into a 1.x Observable.Transformer.
|
static <T,R> Observable.Transformer<T,R> |
toV1Transformer(ObservableTransformer<T,R> transformer,
BackpressureStrategy strategy)
Convert the 3.x ObservableTransformer into a 1.x Observable.Transformer.
|
static <T,R> Single.Transformer<T,R> |
toV1Transformer(SingleTransformer<T,R> transformer)
Convert the 3.x SingleTransformer into a 1.x Single.Transformer.
|
static Completable |
toV3Completable(Completable source)
Converts an 1.x Completable into a 3.x Completable, composing cancellation (unsubscription) through.
|
static Disposable |
toV3Disposable(Subscription subscription)
Convert the 1.x
Subscription into a 3.x Disposable. |
static <T> Flowable<T> |
toV3Flowable(Observable<T> source)
Converts an 1.x Observable into a 3.x Flowable, composing the backpressure and
cancellation (unsubscription) through.
|
static <T> Maybe<T> |
toV3Maybe(Completable source)
Converts an 1.x Completable into a 3.x Maybe, composing cancellation (unsubscription) through.
|
static <T> Maybe<T> |
toV3Maybe(Single<T> source)
Converts an 1.x Single into a 3.x Maybe, composing cancellation (unsubscription) through.
|
static <T> Observable<T> |
toV3Observable(Observable<T> source)
Converts an 1.x Observable into a 3.x Observable, cancellation (unsubscription) through.
|
static <T,R> FlowableOperator<R,T> |
toV3Operator(Observable.Operator<R,T> operator)
Convert the 1.x Observable.Operator into a 3.x FlowableOperator.
|
static <T> FlowableProcessor<T> |
toV3Processor(Subject<T,T> subject)
Wraps a 1.x Subject into a 3.x FlowableProcessor.
|
static Scheduler |
toV3Scheduler(Scheduler scheduler)
|
static <T> Single<T> |
toV3Single(Single<T> source)
Converts an 1.x Single into a 3.x Single, composing cancellation (unsubscription) through.
|
static <T> Subject<T> |
toV3Subject(Subject<T,T> subject)
Wraps a 1.x Subject into a 3.x Subject.
|
static CompletableTransformer |
toV3Transformer(Completable.Transformer transformer)
Convert the 1.x Completable.Transformer into a 3.x CompletableTransformer.
|
static <T,R> FlowableTransformer<T,R> |
toV3Transformer(Observable.Transformer<T,R> transformer)
Convert the 1.x Observable.Transformer into a 3.x FlowableTransformer.
|
static <T,R> ObservableTransformer<T,R> |
toV3Transformer(Observable.Transformer<T,R> transformer,
BackpressureStrategy strategy)
Convert the 1.x Observable.Transformer into a 3.x ObservableTransformer.
|
static <T,R> SingleTransformer<T,R> |
toV3Transformer(Single.Transformer<T,R> transformer)
Convert the 1.x Single.Transformer into a 3.x SingleTransformer.
|
@SchedulerSupport(value="none") public static <T> Flowable<T> toV3Flowable(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> Observable<T> toV3Observable(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> Maybe<T> toV3Maybe(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> Maybe<T> toV3Maybe(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> Single<T> toV3Single(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 Completable toV3Completable(Completable source)
Scheduler.source - the source 1.x Completable instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> Subject<T> toV3Subject(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;
3.x Subject supports only the same input and output typejava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> FlowableProcessor<T> toV3Processor(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;
3.x FlowableProcessor supports only the same input and output typejava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T,R> FlowableTransformer<T,R> toV3Transformer(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> ObservableTransformer<T,R> toV3Transformer(Observable.Transformer<T,R> transformer, BackpressureStrategy strategy)
Scheduler.T - the input value typeR - the output value typestrategy - the backpressure strategy to apply: BUFFER, DROP or LATEST.transformer - the 1.x Observable.Transformer to convert@SchedulerSupport(value="none") public static <T,R> SingleTransformer<T,R> toV3Transformer(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 CompletableTransformer toV3Transformer(Completable.Transformer transformer)
Scheduler.transformer - the 1.x Completable.Transformer to convert@SchedulerSupport(value="none") public static <T,R> FlowableOperator<R,T> toV3Operator(Observable.Operator<R,T> operator)
Scheduler.T - the input value typeR - the output value typeoperator - the 1.x Observable.Operator to convertpublic static Disposable toV3Disposable(Subscription subscription)
Subscription into a 3.x Disposable.subscription - the 1.x Subscription to convert@SchedulerSupport(value="none") public static <T> 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 3.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> Observable<T> toV1Observable(ObservableSource<T> source, 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> Single<T> toV1Single(SingleSource<T> source)
Scheduler.T - the value typesource - the source 3.x SingleSource instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static Completable toV1Completable(CompletableSource source)
Scheduler.source - the source 3.x CompletableSource instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> Single<T> toV1Single(MaybeSource<T> source)
Scheduler.T - the source's value typesource - the source 3.x MaybeSource instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> Completable toV1Completable(MaybeSource<T> source)
Scheduler.T - the source's value typesource - the source 3.x MaybeSource instance, not nulljava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> Subject<T,T> toV1Subject(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;
3.x Subject supports only the same input and output typejava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T> Subject<T,T> toV1Subject(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;
3.x FlowableProcessor supports only the same input and output typejava.lang.NullPointerException - if source is null@SchedulerSupport(value="none") public static <T,R> Observable.Transformer<T,R> toV1Transformer(FlowableTransformer<T,R> transformer)
Scheduler.T - the input value typeR - the output value typetransformer - the 3.x FlowableTransformer to convert@SchedulerSupport(value="none") public static <T,R> Observable.Transformer<T,R> toV1Transformer(ObservableTransformer<T,R> transformer, BackpressureStrategy strategy)
Scheduler.T - the input value typeR - the output value typetransformer - the 3.x ObservableTransformer to convertstrategy - the backpressure strategy to apply: BUFFER, DROP or LATEST.@SchedulerSupport(value="none") public static <T,R> Single.Transformer<T,R> toV1Transformer(SingleTransformer<T,R> transformer)
Scheduler.T - the input value typeR - the output value typetransformer - the 3.x SingleTransformer to convert@SchedulerSupport(value="none") public static Completable.Transformer toV1Transformer(CompletableTransformer transformer)
Scheduler.transformer - the 3.x CompletableTransformer to convert@SchedulerSupport(value="none") public static <T,R> Observable.Operator<R,T> toV1Operator(FlowableOperator<R,T> operator)
Scheduler.T - the input value typeR - the output value typeoperator - the 3.x FlowableOperator to convertpublic static Subscription toV1Subscription(Disposable disposable)
Disposable into a 1.x Subscription.disposable - the 3.x Disposable to convertpublic static Scheduler toV1Scheduler(Scheduler scheduler)
scheduler - the 3.x Scheduler to convert