public final class Maybes extends Object
MaybeConverter
s,
use Maybe.to(MaybeConverter)
to apply the operators to an existing sequence.MaybeTransformers
Modifier and Type | Method and Description |
---|---|
static <T> MaybeConverter<T,Completable> |
flatMapCompletable(Function<? super T,? extends CompletableSource> onSuccessHandler,
Function<? super Throwable,? extends CompletableSource> onErrorHandler,
Supplier<? extends CompletableSource> onCompleteHandler)
Maps the terminal signals of the upstream into
CompletableSource s and
subscribes to it, relaying its terminal events to the downstream. |
static <T,R> MaybeConverter<T,Flowable<R>> |
flatMapFlowable(Function<? super T,? extends Publisher<? extends R>> onSuccessHandler,
Function<? super Throwable,? extends Publisher<? extends R>> onErrorHandler,
Supplier<? extends Publisher<? extends R>> onCompleteHandler)
Maps the terminal signals of the upstream into
Publisher s and
subscribes to it, relaying its terminal events to the downstream. |
static <T,R> MaybeConverter<T,Observable<R>> |
flatMapObservable(Function<? super T,? extends ObservableSource<? extends R>> onSuccessHandler,
Function<? super Throwable,? extends ObservableSource<? extends R>> onErrorHandler,
Supplier<? extends ObservableSource<? extends R>> onCompleteHandler)
Maps the terminal signals of the upstream into
ObservableSource s and
subscribes to it, relaying its terminal events to the downstream. |
static <T,R> MaybeConverter<T,Single<R>> |
flatMapSingle(Function<? super T,? extends SingleSource<? extends R>> onSuccessHandler,
Function<? super Throwable,? extends SingleSource<? extends R>> onErrorHandler,
Supplier<? extends SingleSource<? extends R>> onCompleteHandler)
Maps the terminal signals of the upstream into
SingleSource s and
subscribes to it, relaying its terminal events to the downstream. |
public static <T> MaybeConverter<T,Completable> flatMapCompletable(Function<? super T,? extends CompletableSource> onSuccessHandler, Function<? super Throwable,? extends CompletableSource> onErrorHandler, Supplier<? extends CompletableSource> onCompleteHandler)
CompletableSource
s and
subscribes to it, relaying its terminal events to the downstream.T
- the upstream success value typeonSuccessHandler
- a function called with the upstream success value and should
return a CompletableSource to continue with.onErrorHandler
- called when the upstream fails and should return the
CompletableSource for the given Throwable instance to continue with.onCompleteHandler
- called when the upstream completes normally and should return
the CompletableSource to continue with.public static <T,R> MaybeConverter<T,Single<R>> flatMapSingle(Function<? super T,? extends SingleSource<? extends R>> onSuccessHandler, Function<? super Throwable,? extends SingleSource<? extends R>> onErrorHandler, Supplier<? extends SingleSource<? extends R>> onCompleteHandler)
SingleSource
s and
subscribes to it, relaying its terminal events to the downstream.T
- the upstream success value typeR
- the element type of the mapped-in SingleSourceonSuccessHandler
- a function called with the upstream success value and should
return a SingleSource to continue with.onErrorHandler
- called when the upstream fails and should return the
SingleSource for the given Throwable instance to continue with.onCompleteHandler
- called when the upstream completes normally and should return
the SingleSource to continue with.public static <T,R> MaybeConverter<T,Observable<R>> flatMapObservable(Function<? super T,? extends ObservableSource<? extends R>> onSuccessHandler, Function<? super Throwable,? extends ObservableSource<? extends R>> onErrorHandler, Supplier<? extends ObservableSource<? extends R>> onCompleteHandler)
ObservableSource
s and
subscribes to it, relaying its terminal events to the downstream.T
- the upstream success value typeR
- the element type of the mapped-in ObservableSourceonSuccessHandler
- a function called with the upstream success value and should
return a ObservableSource to continue with.onErrorHandler
- called when the upstream fails and should return the
ObservableSource for the given Throwable instance to continue with.onCompleteHandler
- called when the upstream completes normally and should return
the ObservableSource to continue with.public static <T,R> MaybeConverter<T,Flowable<R>> flatMapFlowable(Function<? super T,? extends Publisher<? extends R>> onSuccessHandler, Function<? super Throwable,? extends Publisher<? extends R>> onErrorHandler, Supplier<? extends Publisher<? extends R>> onCompleteHandler)
Publisher
s and
subscribes to it, relaying its terminal events to the downstream.T
- the upstream success value typeR
- the element type of the mapped-in PublisheronSuccessHandler
- a function called with the upstream success value and should
return a Publisher to continue with.onErrorHandler
- called when the upstream fails and should return the
Publisher for the given Throwable instance to continue with.onCompleteHandler
- called when the upstream completes normally and should return
the Publisher to continue with.