public final class StatementCompletable extends Object
Modifier and Type | Method and Description |
---|---|
static Completable |
ifThen(BooleanSupplier condition,
CompletableSource then,
Completable orElse)
Return a Completable that emits the emissions from one specified
Completable if a condition evaluates to true, or from another specified
Completable otherwise.
|
static <K> Completable |
switchCase(Supplier<? extends K> caseSelector,
Map<? super K,? extends CompletableSource> mapOfCases,
CompletableSource defaultCase)
Return a particular one of several possible Completables based on a case
selector, or a default Completable if the case selector does not map to
a particular one.
|
public static <K> Completable switchCase(Supplier<? extends K> caseSelector, Map<? super K,? extends CompletableSource> mapOfCases, CompletableSource defaultCase)
K
- the case key typecaseSelector
- the function that produces a case key when an
CompletableObserver subscribesmapOfCases
- a map that maps a case key to a CompletabledefaultCase
- the default Completable if the mapOfCases
doesn't contain a value for the key returned by the caseSelector
public static Completable ifThen(BooleanSupplier condition, CompletableSource then, Completable orElse)
condition
- the condition that decides which Completable to emit the
emissions fromthen
- the Completable sequence to emit to if condition
is true
orElse
- the Completable sequence to emit to if condition
is false
then
or orElse
Completables depending on a condition function