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

pack-priv final Class ScalarXMapZHelper

extends Object
Class Inheritance
Imports
java.util.concurrent.Callable, io.reactivex.*, io.reactivex.exceptions.Exceptions, io.reactivex.functions.Function, io.reactivex.internal.disposables.EmptyDisposable, io.reactivex.internal.functions.ObjectHelper, io.reactivex.internal.operators.maybe.MaybeToObservable, io.reactivex.internal.operators.single.SingleToObservable

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 Callable.
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 Callable).

pack-priv static <
the upstream value type
T
, 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 Callable.
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 Callable).

pack-priv static <
the upstream value type
T
, 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 Callable.
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 Callable).

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 Callable).

Parameters
<T>
the upstream value type
source:Object

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

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 Callable).

Parameters
<T>
the upstream value type
source:Object

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

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 Callable).

Parameters
<T>
the upstream value type
source:Object

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

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