public final class ObservableTransformers
extends java.lang.Object
ObservableTransformer,
use Observable.compose(ObservableTransformer)
to apply the operators to an existing sequence.Observables| 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. |
static <T> io.reactivex.ObservableTransformer<T,T> |
valve(io.reactivex.ObservableSource<java.lang.Boolean> other)
Relays values until the other ObservableSource signals false and resumes if the other
ObservableSource signals true again, like closing and opening a valve and not losing
any items from the main source.
|
static <T> io.reactivex.ObservableTransformer<T,T> |
valve(io.reactivex.ObservableSource<java.lang.Boolean> other,
boolean defaultOpen)
Relays values until the other ObservableSource signals false and resumes if the other
ObservableSource signals true again, like closing and opening a valve and not losing
any items from the main source and starts with the specified valve state.
|
static <T> io.reactivex.ObservableTransformer<T,T> |
valve(io.reactivex.ObservableSource<java.lang.Boolean> other,
boolean defaultOpen,
int bufferSize)
Relays values until the other ObservableSource signals false and resumes if the other
ObservableSource signals true again, like closing and opening a valve and not losing
any items from the main source and starts with the specified valve state and the specified
buffer size hint.
|
@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@SchedulerSupport(value="none") public static <T> io.reactivex.ObservableTransformer<T,T> valve(io.reactivex.ObservableSource<java.lang.Boolean> other)
Properties:
IllegalStateException.Scheduler.Flowable.bufferSize() to hold onto values if the valve is closed.T - the value type of the main sourceother - the other sourcejava.lang.NullPointerException - if other is null@SchedulerSupport(value="none")
public static <T> io.reactivex.ObservableTransformer<T,T> valve(io.reactivex.ObservableSource<java.lang.Boolean> other,
boolean defaultOpen)
Properties:
IllegalStateException.Scheduler.Flowable.bufferSize() to hold onto values if the valve is closed.T - the value type of the main sourceother - the other sourcedefaultOpen - should the valve start as open?java.lang.NullPointerException - if other is null@SchedulerSupport(value="none")
public static <T> io.reactivex.ObservableTransformer<T,T> valve(io.reactivex.ObservableSource<java.lang.Boolean> other,
boolean defaultOpen,
int bufferSize)
Properties:
IllegalStateException.Scheduler.T - the value type of the main sourceother - the other sourcedefaultOpen - should the valve start as open?bufferSize - the buffer size hint (the chunk size of the underlying unbounded buffer)java.lang.IllegalArgumentException - if bufferSize <= 0java.lang.NullPointerException - if other is null