public abstract class RxJava3Adapter extends Object
Modifier and Type | Method and Description |
---|---|
static Mono<Void> |
completableToMono(io.reactivex.rxjava3.core.Completable source)
Adapt an Rxjava3
Completable into a Mono<Void> instance. |
static <T> Flux<T> |
flowableToFlux(io.reactivex.rxjava3.core.Flowable<T> source)
Adapt an Rxjava3
Flowable instance into a Flux instance, allowing micro-fusion
and backpressure propagation to occur between the two libraries. |
static <T> io.reactivex.rxjava3.core.Flowable<T> |
fluxToFlowable(Flux<T> source)
Adapt a
Flux instance into an Rxjava3 Flowable instance, allowing micro-fusion
and backpressure propagation to occur between the two libraries. |
static <T> io.reactivex.rxjava3.core.Observable<T> |
fluxToObservable(Flux<T> source)
Adapt a
Flux instance into an Rxjava3 Observable . |
static <T> Mono<T> |
maybeToMono(io.reactivex.rxjava3.core.Maybe<T> source)
Adapt an RxJava 3
Maybe into a Mono instance. |
static io.reactivex.rxjava3.core.Completable |
monoToCompletable(Mono<?> source)
Adapt a
Mono instance into an Rxjava3 Completable instance. |
static <T> io.reactivex.rxjava3.core.Completable |
monoToCompletable(Mono<T> source,
Consumer<T> discardHandler)
Adapt a
Mono instance into an Rxjava3 Completable instance, discarding
potential mono value through the provided Consumer (to be used in a
similar fashion to Mono.doOnDiscard(Class, Consumer) hook). |
static <T> io.reactivex.rxjava3.core.Flowable<T> |
monoToFlowable(Mono<T> source)
Adapt a
Mono instance into an Rxjava3 Flowable instance, allowing micro-fusion
and backpressure propagation to occur between the two libraries. |
static <T> io.reactivex.rxjava3.core.Maybe<T> |
monoToMaybe(Mono<T> source)
Adapt a
Mono instance into an RxJava 3 Maybe . |
static <T> io.reactivex.rxjava3.core.Single<T> |
monoToSingle(Mono<T> source)
Adapt a
Mono instance into an Rxjava3 Single . |
static <T> Flux<T> |
observableToFlux(io.reactivex.rxjava3.core.Observable<T> source,
io.reactivex.rxjava3.core.BackpressureStrategy strategy)
Adapt an RxJava 3
Observable into a Flux and let that flux deal with
backpressure by first turning it into a Flowable with the given RxJava3
BackpressureStrategy . |
static <T> Mono<T> |
singleToMono(io.reactivex.rxjava3.core.Single<T> source)
Adapt an Rxjava3
Single into a Mono instance. |
public static <T> Flux<T> flowableToFlux(io.reactivex.rxjava3.core.Flowable<T> source)
Flowable
instance into a Flux
instance, allowing micro-fusion
and backpressure propagation to occur between the two libraries.T
- the value typesource
- the source Flowable
Flux
instancepublic static <T> io.reactivex.rxjava3.core.Flowable<T> fluxToFlowable(Flux<T> source)
Flux
instance into an Rxjava3 Flowable
instance, allowing micro-fusion
and backpressure propagation to occur between the two libraries.T
- the value typesource
- the source Flux
Flowable
instancepublic static <T> io.reactivex.rxjava3.core.Flowable<T> monoToFlowable(Mono<T> source)
Mono
instance into an Rxjava3 Flowable
instance, allowing micro-fusion
and backpressure propagation to occur between the two libraries.T
- the value typesource
- the source Mono
Flowable
instancepublic static io.reactivex.rxjava3.core.Completable monoToCompletable(Mono<?> source)
Mono
instance into an Rxjava3 Completable
instance.
Unlike the monoToCompletable(Mono, Consumer)
variant, this one doesn't
perform any specific discarding of the emitted value (if there is one).
source
- the source Mono
, which value to ignoreCompletable
instanceMono.ignoreElement()
,
monoToCompletable(Mono, Consumer)
public static <T> io.reactivex.rxjava3.core.Completable monoToCompletable(Mono<T> source, Consumer<T> discardHandler)
Mono
instance into an Rxjava3 Completable
instance, discarding
potential mono value through the provided Consumer
(to be used in a
similar fashion to Mono.doOnDiscard(Class, Consumer)
hook). The consumer
MUST complete normally, without throwing any exceptions.source
- the source Mono
, which value to ignore and discardCompletable
instanceMono.ignoreElement()
,
monoToCompletable(Mono)
public static Mono<Void> completableToMono(io.reactivex.rxjava3.core.Completable source)
Completable
into a Mono<Void>
instance.source
- the source Completable
Mono
instancepublic static <T> io.reactivex.rxjava3.core.Single<T> monoToSingle(Mono<T> source)
Mono
instance into an Rxjava3 Single
.
If the Mono is empty, the single will signal a NoSuchElementException
.
T
- the value typesource
- the source Mono
instanceSingle
instancepublic static <T> Mono<T> singleToMono(io.reactivex.rxjava3.core.Single<T> source)
Single
into a Mono
instance.T
- the value typesource
- the source Single
Mono
instancepublic static <T> Flux<T> observableToFlux(io.reactivex.rxjava3.core.Observable<T> source, io.reactivex.rxjava3.core.BackpressureStrategy strategy)
Observable
into a Flux
and let that flux deal with
backpressure by first turning it into a Flowable
with the given RxJava3
BackpressureStrategy
.T
- the value typesource
- the source Observable
strategy
- the BackpressureStrategy
Flux
instancepublic static <T> io.reactivex.rxjava3.core.Observable<T> fluxToObservable(Flux<T> source)
Flux
instance into an Rxjava3 Observable
.T
- the value typesource
- the source Flux
Observable
instancepublic static <T> Mono<T> maybeToMono(io.reactivex.rxjava3.core.Maybe<T> source)
Maybe
into a Mono
instance.T
- the value typesource
- the source Maybe
Mono
instance