public final class StatementFlowable extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Flowable<T> |
doWhile(Publisher<? extends T> source,
BooleanSupplier postCondition)
Return an Flowable that re-emits the emissions from the source
Flowable, and then re-subscribes to the source long as a condition is
true.
|
static <R> Flowable<R> |
ifThen(BooleanSupplier condition,
Publisher<? extends R> then)
Return an Flowable that emits the emissions from a specified Flowable
if a condition evaluates to true, otherwise return an empty Flowable.
|
static <R> Flowable<R> |
ifThen(BooleanSupplier condition,
Publisher<? extends R> then,
Flowable<? extends R> orElse)
Return an Flowable that emits the emissions from one specified
Flowable if a condition evaluates to true, or from another specified
Flowable otherwise.
|
static <R> Flowable<R> |
ifThen(BooleanSupplier condition,
Publisher<? extends R> then,
Scheduler scheduler)
Return an Flowable that emits the emissions from a specified Flowable
if a condition evaluates to true, otherwise return an empty Flowable
that runs on a specified Scheduler.
|
static <K,R> Flowable<R> |
switchCase(Supplier<? extends K> caseSelector,
Map<? super K,? extends Publisher<? extends R>> mapOfCases)
Return a particular one of several possible Observables based on a case
selector.
|
static <K,R> Flowable<R> |
switchCase(Supplier<? extends K> caseSelector,
Map<? super K,? extends Publisher<? extends R>> mapOfCases,
Publisher<? extends R> defaultCase)
Return a particular one of several possible Observables based on a case
selector, or a default Flowable if the case selector does not map to
a particular one.
|
static <K,R> Flowable<R> |
switchCase(Supplier<? extends K> caseSelector,
Map<? super K,? extends Publisher<? extends R>> mapOfCases,
Scheduler scheduler)
Return a particular one of several possible Observables based on a case
selector and run it on the designated scheduler.
|
static <T> Flowable<T> |
whileDo(Publisher<? extends T> source,
BooleanSupplier preCondition)
Return an Flowable that re-emits the emissions from the source
Flowable as long as the condition is true before the first or subsequent subscribe() calls.
|
public static <K,R> Flowable<R> switchCase(Supplier<? extends K> caseSelector, Map<? super K,? extends Publisher<? extends R>> mapOfCases)
K
- the case key typeR
- the result value typecaseSelector
- the function that produces a case key when an
Observer subscribesmapOfCases
- a map that maps a case key to an Flowablepublic static <K,R> Flowable<R> switchCase(Supplier<? extends K> caseSelector, Map<? super K,? extends Publisher<? extends R>> mapOfCases, Scheduler scheduler)
K
- the case key typeR
- the result value typecaseSelector
- the function that produces a case key when an
Observer subscribesmapOfCases
- a map that maps a case key to an Flowablescheduler
- the scheduler where the empty observable is observedpublic static <K,R> Flowable<R> switchCase(Supplier<? extends K> caseSelector, Map<? super K,? extends Publisher<? extends R>> mapOfCases, Publisher<? extends R> defaultCase)
K
- the case key typeR
- the result value typecaseSelector
- the function that produces a case key when an
Observer subscribesmapOfCases
- a map that maps a case key to an FlowabledefaultCase
- the default Flowable if the mapOfCases
doesn't contain a value for the key returned by the caseSelector
public static <T> Flowable<T> doWhile(Publisher<? extends T> source, BooleanSupplier postCondition)
T
- the value typesource
- the source Flowable to work withpostCondition
- the post condition to test after the source
Flowable completespublic static <T> Flowable<T> whileDo(Publisher<? extends T> source, BooleanSupplier preCondition)
T
- the value typesource
- the source Flowable to work withpreCondition
- the condition to evaluate before subscribing to or
replaying the source FlowablepreCondition
is truepublic static <R> Flowable<R> ifThen(BooleanSupplier condition, Publisher<? extends R> then)
R
- the result value typecondition
- the condition that decides whether to emit the emissions
from the then
Flowablethen
- the Flowable sequence to emit to if condition
is true
then
Flowable if the condition
function evaluates to true, or an empty
Flowable otherwisepublic static <R> Flowable<R> ifThen(BooleanSupplier condition, Publisher<? extends R> then, Scheduler scheduler)
R
- the result value typecondition
- the condition that decides whether to emit the emissions
from the then
Flowablethen
- the Flowable sequence to emit to if condition
is true
scheduler
- the Scheduler on which the empty Flowable runs if the
in case the condition returns falsethen
Flowable if the condition
function evaluates to true, or an empty
Flowable running on the specified Scheduler otherwisepublic static <R> Flowable<R> ifThen(BooleanSupplier condition, Publisher<? extends R> then, Flowable<? extends R> orElse)
R
- the result value typecondition
- the condition that decides which Flowable to emit the
emissions fromthen
- the Flowable sequence to emit to if condition
is true
orElse
- the Flowable sequence to emit to if condition
is false
then
or orElse
Observables depending on a condition function