Class ObservableScalarXMap
- java.lang.Object
-
- io.reactivex.rxjava3.internal.operators.observable.ObservableScalarXMap
-
public final class ObservableScalarXMap extends java.lang.Object
Utility classes to work with scalar-sourced XMap operators (where X == { flat, concat, switch }).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ObservableScalarXMap.ScalarDisposable<T>
Represents a Disposable that signals one onNext followed by an onComplete.(package private) static class
ObservableScalarXMap.ScalarXMapObservable<T,R>
Maps a scalar value to an ObservableSource and subscribes to it.
-
Constructor Summary
Constructors Modifier Constructor Description private
ObservableScalarXMap()
Utility class.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,U>
Observable<U>scalarXMap(T value, Function<? super T,? extends ObservableSource<? extends U>> mapper)
Maps a scalar value into an Observable and emits its values.static <T,R>
booleantryScalarXMapSubscribe(ObservableSource<T> source, Observer<? super R> observer, Function<? super T,? extends ObservableSource<? extends R>> mapper)
Tries to subscribe to a possibly Supplier source's mapped ObservableSource.
-
-
-
Method Detail
-
tryScalarXMapSubscribe
public static <T,R> boolean tryScalarXMapSubscribe(ObservableSource<T> source, Observer<? super R> observer, Function<? super T,? extends ObservableSource<? extends R>> mapper)
Tries to subscribe to a possibly Supplier source's mapped ObservableSource.- Type Parameters:
T
- the input value typeR
- the output value type- Parameters:
source
- the source ObservableSourceobserver
- the subscribermapper
- the function mapping a scalar value into an ObservableSource- Returns:
- true if successful, false if the caller should continue with the regular path.
-
scalarXMap
public static <T,U> Observable<U> scalarXMap(T value, Function<? super T,? extends ObservableSource<? extends U>> mapper)
Maps a scalar value into an Observable and emits its values.- Type Parameters:
T
- the scalar value typeU
- the output value type- Parameters:
value
- the scalar value to mapmapper
- the function that gets the scalar value and should return an ObservableSource that gets streamed- Returns:
- the new Observable instance
-
-