Top Description Constructors Methods
io.reactivex.rxjava3.internal.operators.mixed

pack-priv final Class ScalarXMapZHelper

extends Object
Class Inheritance
Imports
io.reactivex.rxjava3.core.*, io.reactivex.rxjava3.exceptions.Exceptions, io.reactivex.rxjava3.functions.*, io.reactivex.rxjava3.internal.disposables.EmptyDisposable, io.reactivex.rxjava3.internal.operators.maybe.MaybeToObservable, io.reactivex.rxjava3.internal.operators.single.SingleToObservable, java.util.Objects

Utility class to extract a value from a scalar source reactive type, map it to a 0-1 type then subscribe the output type's consumer to it, saving on the overhead of the regular subscription channel.

History: 2.1.11 - experimental

Since
2.2

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static <
the upstream value type
T
>
boolean

Returns:

true if a subscription did happen and the regular path should be skipped
tryAsCompletable
(Object
the source reactive type (Flowable or Observable) possibly implementing Supplier.
source
,
Function<? super T, ? extends CompletableSource>
the function that turns the scalar upstream value into a CompletableSource
mapper
,
CompletableObserver
the consumer to subscribe to the mapped CompletableSource
observer
)

Try subscribing to a CompletableSource mapped from a scalar source (which implements Supplier).

pack-priv static <
the upstream value type
T
,
the downstream value type
R
>
boolean

Returns:

true if a subscription did happen and the regular path should be skipped
tryAsMaybe
(Object
the source reactive type (Flowable or Observable) possibly implementing Supplier.
source
,
Function<? super T, ? extends MaybeSource<? extends R>>
the function that turns the scalar upstream value into a MaybeSource
mapper
,
Observer<? super R>
the consumer to subscribe to the mapped MaybeSource
observer
)

Try subscribing to a MaybeSource mapped from a scalar source (which implements Supplier).

pack-priv static <
the upstream value type
T
,
the downstream value type
R
>
boolean

Returns:

true if a subscription did happen and the regular path should be skipped
tryAsSingle
(Object
the source reactive type (Flowable or Observable) possibly implementing Supplier.
source
,
Function<? super T, ? extends SingleSource<? extends R>>
the function that turns the scalar upstream value into a SingleSource
mapper
,
Observer<? super R>
the consumer to subscribe to the mapped SingleSource
observer
)

Try subscribing to a SingleSource mapped from a scalar source (which implements Supplier).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ScalarXMapZHelperback to summary
private ScalarXMapZHelper()

Method Detail

tryAsCompletableback to summary
pack-priv static <T> boolean tryAsCompletable(Object source, Function<? super T, ? extends CompletableSource> mapper, CompletableObserver observer)

Try subscribing to a CompletableSource mapped from a scalar source (which implements Supplier).

Parameters
<T>
the upstream value type
source:Object

the source reactive type (Flowable or Observable) possibly implementing Supplier.

mapper:Function<? super T, ? extends CompletableSource>

the function that turns the scalar upstream value into a CompletableSource

observer:CompletableObserver

the consumer to subscribe to the mapped CompletableSource

Returns:boolean

true if a subscription did happen and the regular path should be skipped

tryAsMaybeback to summary
pack-priv static <T, R> boolean tryAsMaybe(Object source, Function<? super T, ? extends MaybeSource<? extends R>> mapper, Observer<? super R> observer)

Try subscribing to a MaybeSource mapped from a scalar source (which implements Supplier).

Parameters
<T>
the upstream value type
<R>
the downstream value type
source:Object

the source reactive type (Flowable or Observable) possibly implementing Supplier.

mapper:Function<? super T, ? extends MaybeSource<? extends R>>

the function that turns the scalar upstream value into a MaybeSource

observer:Observer<? super R>

the consumer to subscribe to the mapped MaybeSource

Returns:boolean

true if a subscription did happen and the regular path should be skipped

tryAsSingleback to summary
pack-priv static <T, R> boolean tryAsSingle(Object source, Function<? super T, ? extends SingleSource<? extends R>> mapper, Observer<? super R> observer)

Try subscribing to a SingleSource mapped from a scalar source (which implements Supplier).

Parameters
<T>
the upstream value type
<R>
the downstream value type
source:Object

the source reactive type (Flowable or Observable) possibly implementing Supplier.

mapper:Function<? super T, ? extends SingleSource<? extends R>>

the function that turns the scalar upstream value into a SingleSource

observer:Observer<? super R>

the consumer to subscribe to the mapped SingleSource

Returns:boolean

true if a subscription did happen and the regular path should be skipped