public final class FlowableTransformers
extends java.lang.Object
FlowableTransformer,
use Flowable.compose(FlowableTransformer)
to apply the operators to an existing sequence.| Modifier and Type | Method and Description |
|---|---|
static <T> io.reactivex.FlowableTransformer<T,java.util.List<T>> |
bufferUntil(io.reactivex.functions.Predicate<? super T> predicate)
Buffers elements into a List until the given predicate returns true at which
point a new empty buffer is started.
|
static <T,C extends java.util.Collection<? super T>> |
bufferUntil(io.reactivex.functions.Predicate<? super T> predicate,
java.util.concurrent.Callable<C> bufferSupplier)
Buffers elements into a custom collection until the given predicate returns true at which
point a new empty custom collection is started.
|
static <T> io.reactivex.FlowableTransformer<T,java.util.List<T>> |
bufferWhile(io.reactivex.functions.Predicate<? super T> predicate)
Buffers elements into a List while the given predicate returns true; if the
predicate returns false for an item, a new buffer is created with the specified item.
|
static <T,C extends java.util.Collection<? super T>> |
bufferWhile(io.reactivex.functions.Predicate<? super T> predicate,
java.util.concurrent.Callable<C> bufferSupplier)
Buffers elements into a custom collection while the given predicate returns true; if the
predicate returns false for an item, a new collection is created with the specified item.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
valve(org.reactivestreams.Publisher<java.lang.Boolean> other)
Relays values until the other Publisher signals false and resumes if the other
Publisher signals true again, like closing and opening a valve and not losing
any items from the main source.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
valve(org.reactivestreams.Publisher<java.lang.Boolean> other,
boolean defaultOpen)
Relays values until the other Publisher signals false and resumes if the other
Publisher signals true again, like closing and opening a valve and not losing
any items from the main source and starts with the specivied valve state.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
valve(org.reactivestreams.Publisher<java.lang.Boolean> other,
boolean defaultOpen,
int bufferSize)
Relays values until the other Publisher signals false and resumes if the other
Publisher signals true again, like closing and opening a valve and not losing
any items from the main source and starts with the specivied valve state and the specified
buffer size hint.
|
@SchedulerSupport(value="none") @BackpressureSupport(value=PASS_THROUGH) public static <T> io.reactivex.FlowableTransformer<T,T> valve(org.reactivestreams.Publisher<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")
@BackpressureSupport(value=PASS_THROUGH)
public static <T> io.reactivex.FlowableTransformer<T,T> valve(org.reactivestreams.Publisher<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")
@BackpressureSupport(value=PASS_THROUGH)
public static <T> io.reactivex.FlowableTransformer<T,T> valve(org.reactivestreams.Publisher<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@SchedulerSupport(value="none") @BackpressureSupport(value=FULL) public static <T> io.reactivex.FlowableTransformer<T,java.util.List<T>> bufferWhile(io.reactivex.functions.Predicate<? super T> predicate)
T - the source value typepredicate - the predicate receiving the current value and if returns false,
a new buffer is created with the specified item@SchedulerSupport(value="none")
@BackpressureSupport(value=FULL)
public static <T,C extends java.util.Collection<? super T>> io.reactivex.FlowableTransformer<T,C> bufferWhile(io.reactivex.functions.Predicate<? super T> predicate,
java.util.concurrent.Callable<C> bufferSupplier)
T - the source value typeC - the collection typepredicate - the predicate receiving the current value and if returns false,
a new collection is created with the specified itembufferSupplier - the callable that returns a fresh collection@SchedulerSupport(value="none") @BackpressureSupport(value=FULL) public static <T> io.reactivex.FlowableTransformer<T,java.util.List<T>> bufferUntil(io.reactivex.functions.Predicate<? super T> predicate)
T - the source value typepredicate - the predicate receiving the current itam and if returns true,
the current buffer is emitted and a fresh empty buffer is created@SchedulerSupport(value="none")
@BackpressureSupport(value=FULL)
public static <T,C extends java.util.Collection<? super T>> io.reactivex.FlowableTransformer<T,C> bufferUntil(io.reactivex.functions.Predicate<? super T> predicate,
java.util.concurrent.Callable<C> bufferSupplier)
T - the source value typeC - the collection typepredicate - the predicate receiving the current itam and if returns true,
the current collection is emitted and a fresh empty collection is createdbufferSupplier - the callable that returns a fresh collection