Class ScalarXMapZHelper
- java.lang.Object
-
- io.reactivex.rxjava3.internal.operators.mixed.ScalarXMapZHelper
-
final class ScalarXMapZHelper extends java.lang.Object
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
Constructors Modifier Constructor Description private
ScalarXMapZHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static <T> boolean
tryAsCompletable(java.lang.Object source, Function<? super T,? extends CompletableSource> mapper, CompletableObserver observer)
Try subscribing to aCompletableSource
mapped from a scalar source (which implementsSupplier
).(package private) static <T,R>
booleantryAsMaybe(java.lang.Object source, Function<? super T,? extends MaybeSource<? extends R>> mapper, Observer<? super R> observer)
Try subscribing to aMaybeSource
mapped from a scalar source (which implementsSupplier
).(package private) static <T,R>
booleantryAsSingle(java.lang.Object source, Function<? super T,? extends SingleSource<? extends R>> mapper, Observer<? super R> observer)
Try subscribing to aSingleSource
mapped from a scalar source (which implementsSupplier
).
-
-
-
Method Detail
-
tryAsCompletable
static <T> boolean tryAsCompletable(java.lang.Object source, Function<? super T,? extends CompletableSource> mapper, CompletableObserver observer)
Try subscribing to aCompletableSource
mapped from a scalar source (which implementsSupplier
).- Type Parameters:
T
- the upstream value type- Parameters:
source
- the source reactive type (Flowable
orObservable
) possibly implementingSupplier
.mapper
- the function that turns the scalar upstream value into aCompletableSource
observer
- the consumer to subscribe to the mappedCompletableSource
- Returns:
- true if a subscription did happen and the regular path should be skipped
-
tryAsMaybe
static <T,R> boolean tryAsMaybe(java.lang.Object source, Function<? super T,? extends MaybeSource<? extends R>> mapper, Observer<? super R> observer)
Try subscribing to aMaybeSource
mapped from a scalar source (which implementsSupplier
).- Type Parameters:
T
- the upstream value typeR
- the downstream value type- Parameters:
source
- the source reactive type (Flowable
orObservable
) possibly implementingSupplier
.mapper
- the function that turns the scalar upstream value into aMaybeSource
observer
- the consumer to subscribe to the mappedMaybeSource
- Returns:
- true if a subscription did happen and the regular path should be skipped
-
tryAsSingle
static <T,R> boolean tryAsSingle(java.lang.Object source, Function<? super T,? extends SingleSource<? extends R>> mapper, Observer<? super R> observer)
Try subscribing to aSingleSource
mapped from a scalar source (which implementsSupplier
).- Type Parameters:
T
- the upstream value typeR
- the downstream value type- Parameters:
source
- the source reactive type (Flowable
orObservable
) possibly implementingSupplier
.mapper
- the function that turns the scalar upstream value into aSingleSource
observer
- the consumer to subscribe to the mappedSingleSource
- Returns:
- true if a subscription did happen and the regular path should be skipped
-
-