public final class MaybeTransformers extends Object
MaybeTransformer
,
use Maybe.compose(MaybeTransformer)
to apply the operators to an existing sequence.Maybes
Modifier and Type | Method and Description |
---|---|
static <T,R> MaybeTransformer<T,R> |
flatMap(Function<? super T,? extends MaybeSource<? extends R>> onSuccessHandler,
Function<? super Throwable,? extends MaybeSource<? extends R>> onErrorHandler,
Supplier<? extends MaybeSource<? extends R>> onCompleteHandler)
Maps the terminal signals of the upstream into
MaybeSource s and
subscribes to it, relaying its terminal events to the downstream. |
public static <T,R> MaybeTransformer<T,R> flatMap(Function<? super T,? extends MaybeSource<? extends R>> onSuccessHandler, Function<? super Throwable,? extends MaybeSource<? extends R>> onErrorHandler, Supplier<? extends MaybeSource<? extends R>> onCompleteHandler)
MaybeSource
s and
subscribes to it, relaying its terminal events to the downstream.T
- the success type of the upstreamR
- the success type of the resulting MaybeonSuccessHandler
- a function called with the upstream success value and should
return a MaybeSource to continue with.onCompleteHandler
- called when the upstream completes normally and should return
the MaybeSource to continue with.onErrorHandler
- called when the upstream fails and should return the
MaybeSource for the given Throwable instance to continue with.