Class ScalarXMapZHelper
- java.lang.Object
-
- io.reactivex.rxjava3.internal.operators.mixed.ScalarXMapZHelper
-
final class ScalarXMapZHelper extends java.lang.ObjectUtility 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 privateScalarXMapZHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static <T> booleantryAsCompletable(java.lang.Object source, Function<? super T,? extends CompletableSource> mapper, CompletableObserver observer)Try subscribing to aCompletableSourcemapped 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 aMaybeSourcemapped 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 aSingleSourcemapped 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 aCompletableSourcemapped from a scalar source (which implementsSupplier).- Type Parameters:
T- the upstream value type- Parameters:
source- the source reactive type (FlowableorObservable) possibly implementingSupplier.mapper- the function that turns the scalar upstream value into aCompletableSourceobserver- 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 aMaybeSourcemapped from a scalar source (which implementsSupplier).- Type Parameters:
T- the upstream value typeR- the downstream value type- Parameters:
source- the source reactive type (FlowableorObservable) possibly implementingSupplier.mapper- the function that turns the scalar upstream value into aMaybeSourceobserver- 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 aSingleSourcemapped from a scalar source (which implementsSupplier).- Type Parameters:
T- the upstream value typeR- the downstream value type- Parameters:
source- the source reactive type (FlowableorObservable) possibly implementingSupplier.mapper- the function that turns the scalar upstream value into aSingleSourceobserver- the consumer to subscribe to the mappedSingleSource- Returns:
- true if a subscription did happen and the regular path should be skipped
-
-