Package hu.akarnokd.rxjava3.bridge
Class RxJavaBridge
- java.lang.Object
-
- hu.akarnokd.rxjava3.bridge.RxJavaBridge
-
public final class RxJavaBridge extends java.lang.ObjectUtility class to convert between RxJava 2 and RxJava 3 components.- Since:
- 3.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidstartUsingV2Schedulers()Wraps all standard V2 Schedulers into V3 Schedulers and installs scheduler hooks in the V3 RxJavaPlugins so that both RxJava 2 and RxJava 3 use the same backing scheduler implementations.static voidstartUsingV3Schedulers()Wraps all standard V3 Schedulers into V2 Schedulers and installs scheduler hooks in the V2 RxJavaPlugins so that both RxJava 2 and RxJava 3 use the same backing scheduler implementations.static voidstopUsingV2Schedulers()Stop using the V2 standard schedulers by resetting the V3 scheduler hooks to their default (null) handlers in the V3 RxJavaPlugins.static voidstopUsingV3Schedulers()Stop using the V3 standard schedulers by resetting the V2 scheduler hooks to their default (null) handlers in the V2 RxJavaPlugins.static CompletableConverter<Completable>toV2Completable()Returns the shared singleton instance of a V3 Completable converter that when applied in V3Completable.to(io.reactivex.rxjava3.core.CompletableConverter)-based fluent conversions, produces a V2 Completable instance.static CompletabletoV2Completable(Completable source)Wraps a V3 Completable and exposes it as a V2 Completable.static DisposabletoV2Disposable(Disposable disposable)Wraps a V3 Disposable and exposes it as a V2 Disposable.static <T> FlowableConverter<T,Flowable<T>>toV2Flowable()Returns the shared singleton instance of a V3 Flowable converter that when applied in V3Flowable.to(io.reactivex.rxjava3.core.FlowableConverter)-based fluent conversions, produces a V2 Flowable instance.static <T> Flowable<T>toV2Flowable(Flowable<T> source)Wraps a V3 Flowable and exposes it as a V2 Flowable.static <T> MaybeConverter<T,Maybe<T>>toV2Maybe()Returns the shared singleton instance of a V3 Maybe converter that when applied in V3Maybe.to(io.reactivex.rxjava3.core.MaybeConverter)-based fluent conversions, produces a V2 Maybe instance.static <T> Maybe<T>toV2Maybe(Maybe<T> source)Wraps a V3 Maybe and exposes it as a V2 Maybe.static <T> ObservableConverter<T,Observable<T>>toV2Observable()Returns the shared singleton instance of a V3 Observable converter that when applied in V3Observable.to(io.reactivex.rxjava3.core.ObservableConverter)-based fluent conversions, produces a V2 Observable instance.static <T> Observable<T>toV2Observable(Observable<T> source)Wraps a V3 Observable and exposes it as a V2 Observable.static SchedulertoV2Scheduler(Scheduler scheduler)Wraps a V3 Scheduler and exposes it as a V2 Scheduler.static <T> SingleConverter<T,Single<T>>toV2Single()Returns the shared singleton instance of a V3 Single converter that when applied in V3Single.to(io.reactivex.rxjava3.core.SingleConverter)-based fluent conversions, produces a V2 Single instance.static <T> Single<T>toV2Single(Single<T> source)Wraps a V3 Single and exposes it as a V2 Single.static CompletableConverter<Completable>toV3Completable()Returns the shared singleton instance of a V2 Completable converter that when applied in V2Completable.as(io.reactivex.CompletableConverter)-based fluent conversions, produces a V3 Completable instance.static CompletabletoV3Completable(Completable source)Wraps a V2 Completable and exposes it as a V3 Completable.static DisposabletoV3Disposable(Disposable disposable)Wraps a V2 Disposable and exposes it as a V3 Disposable.static <T> FlowableConverter<T,Flowable<T>>toV3Flowable()Returns the shared singleton instance of a V2 Flowable converter that when applied in V2Flowable.as(io.reactivex.FlowableConverter)-based fluent conversions, produces a V3 Flowable instance.static <T> Flowable<T>toV3Flowable(Flowable<T> source)Wraps a V2 Flowable and exposes it as a V3 Flowable.static <T> MaybeConverter<T,Maybe<T>>toV3Maybe()Returns the shared singleton instance of a V2 Maybe converter that when applied in V2Maybe.as(io.reactivex.MaybeConverter)-based fluent conversions, produces a V3 Maybe instance.static <T> Maybe<T>toV3Maybe(Maybe<T> source)Wraps a V2 Maybe and exposes it as a V3 Maybe.static <T> ObservableConverter<T,Observable<T>>toV3Observable()Returns the shared singleton instance of a V2 Observable converter that when applied in V2Observable.as(io.reactivex.ObservableConverter)-based fluent conversions, produces a V3 Observable instance.static <T> Observable<T>toV3Observable(Observable<T> source)Wraps a V2 Observable and exposes it as a V3 Observable.static SchedulertoV3Scheduler(Scheduler scheduler)Wraps a V2 Scheduler and exposes it as a V3 Scheduler.static <T> SingleConverter<T,Single<T>>toV3Single()Returns the shared singleton instance of a V2 Single converter that when applied in V2Single.as(io.reactivex.SingleConverter)-based fluent conversions, produces a V3 Single instance.static <T> Single<T>toV3Single(Single<T> source)Wraps a V2 Single and exposes it as a V3 Single.
-
-
-
Method Detail
-
toV2Flowable
public static <T> Flowable<T> toV2Flowable(Flowable<T> source)
Wraps a V3 Flowable and exposes it as a V2 Flowable.- Type Parameters:
T- the element type of the sequence- Parameters:
source- the source V3 Flowable- Returns:
- the wrapper V2 Flowable
-
toV3Flowable
public static <T> Flowable<T> toV3Flowable(Flowable<T> source)
Wraps a V2 Flowable and exposes it as a V3 Flowable.- Type Parameters:
T- the element type of the sequence- Parameters:
source- the source V2 Flowable- Returns:
- the wrapper V3 Flowable
-
toV3Flowable
public static <T> FlowableConverter<T,Flowable<T>> toV3Flowable()
Returns the shared singleton instance of a V2 Flowable converter that when applied in V2Flowable.as(io.reactivex.FlowableConverter)-based fluent conversions, produces a V3 Flowable instance.- Type Parameters:
T- the element type of the sequence- Returns:
- the shared singleton converter instance
-
toV2Flowable
public static <T> FlowableConverter<T,Flowable<T>> toV2Flowable()
Returns the shared singleton instance of a V3 Flowable converter that when applied in V3Flowable.to(io.reactivex.rxjava3.core.FlowableConverter)-based fluent conversions, produces a V2 Flowable instance.- Type Parameters:
T- the element type of the sequence- Returns:
- the shared singleton converter instance
-
toV2Observable
public static <T> Observable<T> toV2Observable(Observable<T> source)
Wraps a V3 Observable and exposes it as a V2 Observable.- Type Parameters:
T- the element type of the sequence- Parameters:
source- the source V3 Observable- Returns:
- the wrapper V2 Observable
-
toV3Observable
public static <T> Observable<T> toV3Observable(Observable<T> source)
Wraps a V2 Observable and exposes it as a V3 Observable.- Type Parameters:
T- the element type of the sequence- Parameters:
source- the source V2 Observable- Returns:
- the wrapper V3 Observable
-
toV3Observable
public static <T> ObservableConverter<T,Observable<T>> toV3Observable()
Returns the shared singleton instance of a V2 Observable converter that when applied in V2Observable.as(io.reactivex.ObservableConverter)-based fluent conversions, produces a V3 Observable instance.- Type Parameters:
T- the element type of the sequence- Returns:
- the shared singleton converter instance
-
toV2Observable
public static <T> ObservableConverter<T,Observable<T>> toV2Observable()
Returns the shared singleton instance of a V3 Observable converter that when applied in V3Observable.to(io.reactivex.rxjava3.core.ObservableConverter)-based fluent conversions, produces a V2 Observable instance.- Type Parameters:
T- the element type of the sequence- Returns:
- the shared singleton converter instance
-
toV2Maybe
public static <T> Maybe<T> toV2Maybe(Maybe<T> source)
Wraps a V3 Maybe and exposes it as a V2 Maybe.- Type Parameters:
T- the element type of the sequence- Parameters:
source- the source V3 Maybe- Returns:
- the wrapper V2 Maybe
-
toV3Maybe
public static <T> Maybe<T> toV3Maybe(Maybe<T> source)
Wraps a V2 Maybe and exposes it as a V3 Maybe.- Type Parameters:
T- the element type of the sequence- Parameters:
source- the source V2 Maybe- Returns:
- the wrapper V3 Maybe
-
toV3Maybe
public static <T> MaybeConverter<T,Maybe<T>> toV3Maybe()
Returns the shared singleton instance of a V2 Maybe converter that when applied in V2Maybe.as(io.reactivex.MaybeConverter)-based fluent conversions, produces a V3 Maybe instance.- Type Parameters:
T- the element type of the sequence- Returns:
- the shared singleton converter instance
-
toV2Maybe
public static <T> MaybeConverter<T,Maybe<T>> toV2Maybe()
Returns the shared singleton instance of a V3 Maybe converter that when applied in V3Maybe.to(io.reactivex.rxjava3.core.MaybeConverter)-based fluent conversions, produces a V2 Maybe instance.- Type Parameters:
T- the element type of the sequence- Returns:
- the shared singleton converter instance
-
toV2Single
public static <T> Single<T> toV2Single(Single<T> source)
Wraps a V3 Single and exposes it as a V2 Single.- Type Parameters:
T- the element type of the sequence- Parameters:
source- the source V3 Single- Returns:
- the wrapper V2 Single
-
toV3Single
public static <T> Single<T> toV3Single(Single<T> source)
Wraps a V2 Single and exposes it as a V3 Single.- Type Parameters:
T- the element type of the sequence- Parameters:
source- the source V2 Single- Returns:
- the wrapper V3 Single
-
toV3Single
public static <T> SingleConverter<T,Single<T>> toV3Single()
Returns the shared singleton instance of a V2 Single converter that when applied in V2Single.as(io.reactivex.SingleConverter)-based fluent conversions, produces a V3 Single instance.- Type Parameters:
T- the element type of the sequence- Returns:
- the shared singleton converter instance
-
toV2Single
public static <T> SingleConverter<T,Single<T>> toV2Single()
Returns the shared singleton instance of a V3 Single converter that when applied in V3Single.to(io.reactivex.rxjava3.core.SingleConverter)-based fluent conversions, produces a V2 Single instance.- Type Parameters:
T- the element type of the sequence- Returns:
- the shared singleton converter instance
-
toV2Completable
public static Completable toV2Completable(Completable source)
Wraps a V3 Completable and exposes it as a V2 Completable.- Parameters:
source- the source V3 Completable- Returns:
- the wrapper V2 Completable
-
toV3Completable
public static Completable toV3Completable(Completable source)
Wraps a V2 Completable and exposes it as a V3 Completable.- Parameters:
source- the source V2 Completable- Returns:
- the wrapper V3 Completable
-
toV3Completable
public static CompletableConverter<Completable> toV3Completable()
Returns the shared singleton instance of a V2 Completable converter that when applied in V2Completable.as(io.reactivex.CompletableConverter)-based fluent conversions, produces a V3 Completable instance.- Returns:
- the shared singleton converter instance
-
toV2Completable
public static CompletableConverter<Completable> toV2Completable()
Returns the shared singleton instance of a V3 Completable converter that when applied in V3Completable.to(io.reactivex.rxjava3.core.CompletableConverter)-based fluent conversions, produces a V2 Completable instance.- Returns:
- the shared singleton converter instance
-
toV2Disposable
public static Disposable toV2Disposable(Disposable disposable)
Wraps a V3 Disposable and exposes it as a V2 Disposable.- Parameters:
disposable- the source V3 Disposable- Returns:
- the wrapper V2 Disposable
-
toV3Disposable
public static Disposable toV3Disposable(Disposable disposable)
Wraps a V2 Disposable and exposes it as a V3 Disposable.- Parameters:
disposable- the source V2 Disposable- Returns:
- the wrapper V3 Disposable
-
toV2Scheduler
public static Scheduler toV2Scheduler(Scheduler scheduler)
Wraps a V3 Scheduler and exposes it as a V2 Scheduler.- Parameters:
scheduler- the source V3 Scheduler- Returns:
- the wrapper V2 Scheduler
-
toV3Scheduler
public static Scheduler toV3Scheduler(Scheduler scheduler)
Wraps a V2 Scheduler and exposes it as a V3 Scheduler.- Parameters:
scheduler- the source V2 Scheduler- Returns:
- the wrapper V3 Scheduler
-
startUsingV2Schedulers
public static void startUsingV2Schedulers()
Wraps all standard V2 Schedulers into V3 Schedulers and installs scheduler hooks in the V3 RxJavaPlugins so that both RxJava 2 and RxJava 3 use the same backing scheduler implementations.
-
stopUsingV2Schedulers
public static void stopUsingV2Schedulers()
Stop using the V2 standard schedulers by resetting the V3 scheduler hooks to their default (null) handlers in the V3 RxJavaPlugins.
-
startUsingV3Schedulers
public static void startUsingV3Schedulers()
Wraps all standard V3 Schedulers into V2 Schedulers and installs scheduler hooks in the V2 RxJavaPlugins so that both RxJava 2 and RxJava 3 use the same backing scheduler implementations.
-
stopUsingV3Schedulers
public static void stopUsingV3Schedulers()
Stop using the V3 standard schedulers by resetting the V2 scheduler hooks to their default (null) handlers in the V2 RxJavaPlugins.
-
-