public final class ObservableTransformers
extends java.lang.Object
ObservableTransformer,
use Observable.compose(ObservableTransformer)
to apply the operators to an existing sequence.| Modifier and Type | Method and Description |
|---|---|
static <T,R> io.reactivex.ObservableTransformer<T,R> |
errorJump(io.reactivex.ObservableTransformer<T,R> transformer)
Allows an upstream error to jump over an inner transformation and is
then reapplied once the inner transformation's returned Flowable terminates.
|
static <T,R> io.reactivex.ObservableTransformer<T,R> |
flatMapDrop(io.reactivex.functions.Function<? super T,? extends io.reactivex.ObservableSource<? extends R>> mapper)
FlatMap only one
ObservableSource at a time and ignore upstream values until it terminates. |
static <T,R> io.reactivex.ObservableTransformer<T,R> |
flatMapLatest(io.reactivex.functions.Function<? super T,? extends io.reactivex.ObservableSource<? extends R>> mapper)
FlatMap only one
ObservableSource at a time and keep the latest upstream value until it terminates
and resume with the ObservableSource mapped for that latest upstream value. |
static <T> io.reactivex.ObservableTransformer<T,java.lang.Long> |
indexOf(io.reactivex.functions.Predicate<? super T> predicate)
Returns the first index of an element that matches a predicate or -1L if no elements match.
|
static <T> io.reactivex.ObservableTransformer<T,T> |
observeOnDrop(io.reactivex.Scheduler scheduler)
Schedules the event emission on a
Scheduler and drops upstream values while
the onNext with the current item is executing on that scheduler. |
static <T> io.reactivex.ObservableTransformer<T,T> |
observeOnLatest(io.reactivex.Scheduler scheduler)
Schedules the event emission on a
Scheduler and keeps the latest upstream item
while the downstream's onNext is executing so that it will resume
with that latest value. |
@SchedulerSupport(value="none")
@CheckReturnValue
@NonNull
public static <T> io.reactivex.ObservableTransformer<T,java.lang.Long> indexOf(@NonNull
io.reactivex.functions.Predicate<? super T> predicate)
T - the upstream element typepredicate - the predicate called to test each item, returning true will
stop the sequence and return the current item index@SchedulerSupport(value="custom")
@CheckReturnValue
@NonNull
public static <T> io.reactivex.ObservableTransformer<T,T> observeOnDrop(@NonNull
io.reactivex.Scheduler scheduler)
Scheduler and drops upstream values while
the onNext with the current item is executing on that scheduler.
Errors are delayed until all items that weren't dropped have been delivered.
T - the element typescheduler - the scheduler to use for emitting events onobserveOnLatest(Scheduler)@SchedulerSupport(value="custom")
@CheckReturnValue
@NonNull
public static <T> io.reactivex.ObservableTransformer<T,T> observeOnLatest(@NonNull
io.reactivex.Scheduler scheduler)
Scheduler and keeps the latest upstream item
while the downstream's onNext is executing so that it will resume
with that latest value.
Errors are delayed until the very last item has been delivered.
T - the element typescheduler - the scheduler to use for emitting events onobserveOnLatest(Scheduler)@SchedulerSupport(value="none") @CheckReturnValue @NonNull public static <T,R> io.reactivex.ObservableTransformer<T,R> flatMapDrop(io.reactivex.functions.Function<? super T,? extends io.reactivex.ObservableSource<? extends R>> mapper)
ObservableSource at a time and ignore upstream values until it terminates.
Errors are delayed until both the upstream and the active inner ObservableSource terminate.
T - the upstream value typeR - the output typemapper - the function that takes an upstream item and returns a ObservableSource
to be run exclusively until it finishes@SchedulerSupport(value="none") @CheckReturnValue @NonNull public static <T,R> io.reactivex.ObservableTransformer<T,R> flatMapLatest(io.reactivex.functions.Function<? super T,? extends io.reactivex.ObservableSource<? extends R>> mapper)
ObservableSource at a time and keep the latest upstream value until it terminates
and resume with the ObservableSource mapped for that latest upstream value.
Errors are delayed until both the upstream and the active inner ObservableSource terminate.
T - the upstream value typeR - the output typemapper - the function that takes an upstream item and returns a ObservableSource
to be run exclusively until it finishespublic static <T,R> io.reactivex.ObservableTransformer<T,R> errorJump(io.reactivex.ObservableTransformer<T,R> transformer)
T - the upstream value typeR - the downstream value typetransformer - the transformation applied to the flow on a per-Subscriber basis