@NonNull Single<Boolean>
all(@NonNull Predicate<? super T> predicate)
Returns a
Single
that emits a
Boolean
that indicates whether all of the items emitted by the current
Observable
satisfy a condition.
static <T> @NonNull Observable<T>
amb(@NonNull Iterable<? extends ObservableSource<? extends T>> sources)
Mirrors the one
ObservableSource
in an
Iterable
of several
ObservableSource
s that first either emits an item or sends a termination notification.
static <T> @NonNull Observable<T>
ambArray(ObservableSource<? extends T>... sources)
Mirrors the one
ObservableSource
in an array of several
ObservableSource
s that first either emits an item or sends a termination notification.
@NonNull Observable<T>
ambWith(@NonNull ObservableSource<? extends T> other)
Mirrors the current
Observable
or the other
ObservableSource
provided of which the first either emits an item or sends a termination notification.
@NonNull Single<Boolean>
any(@NonNull Predicate<? super T> predicate)
Returns a
Single
that emits
true
if any item emitted by the current
Observable
satisfies a specified condition, otherwise
false
.
T
blockingFirst()
Returns the first item emitted by the current
Observable
, or throws
NoSuchElementException
if it emits no items.
T
blockingFirst(T defaultItem)
Returns the first item emitted by the current Observable
, or a default value if it emits no items.
void
blockingForEach(@NonNull Consumer<? super T> onNext)
Consumes the current
Observable
in a blocking fashion and invokes the given
Consumer
with each upstream item on the
current threaduntil the upstream terminates.
void
blockingForEach(@NonNull Consumer<? super T> onNext, int capacityHint)
Consumes the current
Observable
in a blocking fashion and invokes the given
Consumer
with each upstream item on the
current threaduntil the upstream terminates.
@NonNull Iterable<T>
blockingIterable()
Exposes the current
Observable
as an
Iterable
which, when iterated, subscribes to the current
Observable
and blocks until the current
Observable
emits items or terminates.
@NonNull Iterable<T>
blockingIterable(int capacityHint)
Exposes the current
Observable
as an
Iterable
which, when iterated, subscribes to the current
Observable
and blocks until the current
Observable
emits items or terminates.
T
blockingLast()
Returns the last item emitted by the current
Observable
, or throws
NoSuchElementException
if the current
Observable
emits no items.
T
blockingLast(T defaultItem)
Returns the last item emitted by the current Observable
, or a default value if it emits no items.
@NonNull Iterable<T>
blockingLatest()
Returns an
Iterable
that returns the latest item emitted by the current
Observable
, waiting if necessary for one to become available.
@NonNull Iterable<T>
blockingMostRecent(T initialItem)
Returns an
Iterable
that always returns the item most recently emitted by the current
Observable
.
@NonNull Iterable<T>
blockingNext()
Returns an
Iterable
that blocks until the current
Observable
emits another item, then returns that item.
T
blockingSingle()
If the current
Observable
completes after emitting a single item, return that item, otherwise throw a
NoSuchElementException
.
T
blockingSingle(T defaultItem)
If the current
Observable
completes after emitting a single item, return that item; if it emits more than one item, throw an
IllegalArgumentException
; if it emits no items, return a default value.
@NonNull Stream<T>
blockingStream()
Creates a sequential
Stream
to consume or process the current
Observable
in a blocking manner via the Java
Stream
API.
@NonNull Stream<T>
blockingStream(int capacityHint)
Creates a sequential
Stream
to consume or process the current
Observable
in a blocking manner via the Java
Stream
API.
void
blockingSubscribe()
Runs the current Observable
to a terminal event, ignoring any values and rethrowing any exception.
void
blockingSubscribe(@NonNull Consumer<? super T> onNext)
Subscribes to the source and calls the given callbacks on the current thread.
void
blockingSubscribe(@NonNull Consumer<? super T> onNext, @NonNull Consumer<? super Throwable> onError)
Subscribes to the source and calls the given callbacks on the current thread.
void
blockingSubscribe(@NonNull Consumer<? super T> onNext, @NonNull Consumer<? super Throwable> onError, @NonNull Action onComplete)
Subscribes to the source and calls the given callbacks on the current thread.
void
blockingSubscribe(@NonNull Observer<? super T> observer)
Subscribes to the source and calls the
Observer
methods
on the current thread.
@NonNull Observable<List<T>>
buffer(int count)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
@NonNull Observable<List<T>>
buffer(int count, int skip)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
<U extends Collection<? super T>>
@NonNull Observable<U>
buffer(int count, int skip, @NonNull Supplier<U> bufferSupplier)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
<U extends Collection<? super T>>
@NonNull Observable<U>
buffer(int count, @NonNull Supplier<U> bufferSupplier)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
@NonNull Observable<List<T>>
buffer(long timespan, long timeskip, @NonNull TimeUnit unit)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
@NonNull Observable<List<T>>
buffer(long timespan, long timeskip, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
<U extends Collection<? super T>>
@NonNull Observable<U>
buffer(long timespan, long timeskip, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Supplier<U> bufferSupplier)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
@NonNull Observable<List<T>>
buffer(long timespan, @NonNull TimeUnit unit)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
@NonNull Observable<List<T>>
buffer(long timespan, @NonNull TimeUnit unit, int count)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
@NonNull Observable<List<T>>
buffer(long timespan, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
@NonNull Observable<List<T>>
buffer(long timespan, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, int count)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
<U extends Collection<? super T>>
@NonNull Observable<U>
buffer(long timespan, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, int count, @NonNull Supplier<U> bufferSupplier, boolean restartTimerOnMaxSize)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
<TOpening,TClosing>
@NonNull Observable<List<T>>
buffer(@NonNull ObservableSource<? extends TOpening> openingIndicator, @NonNull Function<? super TOpening,? extends ObservableSource<? extends TClosing>> closingIndicator)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
<TOpening,TClosing,U extends Collection<? super T>>
@NonNull Observable<U>
buffer(@NonNull ObservableSource<? extends TOpening> openingIndicator, @NonNull Function<? super TOpening,? extends ObservableSource<? extends TClosing>> closingIndicator, @NonNull Supplier<U> bufferSupplier)
Returns an Observable
that emits buffers of items it collects from the current Observable
.
<B> @NonNull Observable<List<T>>
buffer(@NonNull ObservableSource<B> boundaryIndicator)
Returns an
Observable
that emits non-overlapping buffered items from the current
Observable
each time the specified boundary
ObservableSource
emits an item.
<B> @NonNull Observable<List<T>>
buffer(@NonNull ObservableSource<B> boundaryIndicator, int initialCapacity)
Returns an
Observable
that emits non-overlapping buffered items from the current
Observable
each time the specified boundary
ObservableSource
emits an item.
<B,U extends Collection<? super T>>
@NonNull Observable<U>
buffer(@NonNull ObservableSource<B> boundaryIndicator, @NonNull Supplier<U> bufferSupplier)
Returns an
Observable
that emits non-overlapping buffered items from the current
Observable
each time the specified boundary
ObservableSource
emits an item.
static int
bufferSize()
Returns the default 'island' size or capacity-increment hint for unbounded buffers.
@NonNull Observable<T>
cache()
Returns an Observable
that subscribes to the current Observable
lazily, caches all of its events and replays them, in the same order as received, to all the downstream observers.
@NonNull Observable<T>
cacheWithInitialCapacity(int initialCapacity)
Returns an Observable
that subscribes to the current Observable
lazily, caches all of its events and replays them, in the same order as received, to all the downstream observers.
<U> @NonNull Observable<U>
cast(@NonNull Class<U> clazz)
Returns an
Observable
that emits the upstream items while they can be cast via
Class.cast(Object)
until the upstream terminates, or until the upstream signals an item which can't be cast, resulting in a
ClassCastException
to be signaled to the downstream.
<R,A> @NonNull Single<R>
collect(@NonNull Collector<? super T,A,R> collector)
Collects the finite upstream's values into a container via a
Stream
Collector
callback set and emits it as the success result as a
Single
.
<U> @NonNull Single<U>
collect(@NonNull Supplier<? extends U> initialItemSupplier, @NonNull BiConsumer<? super U,? super T> collector)
Collects items emitted by the finite source
Observable
into a single mutable data structure and returns a
Single
that emits this structure.
<U> @NonNull Single<U>
collectInto(U initialItem, @NonNull BiConsumer<? super U,? super T> collector)
Collects items emitted by the finite source
Observable
into a single mutable data structure and returns a
Single
that emits this structure.
static <T,R> @NonNull Observable<R>
combineLatest(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, @NonNull Function<? super Object[],? extends R> combiner)
Combines a collection of source
ObservableSource
s by emitting an item that aggregates the latest values of each of the returned
ObservableSource
s each time an item is received from any of the returned
ObservableSource
s, where this aggregation is defined by a specified function.
static <T,R> @NonNull Observable<R>
combineLatest(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, @NonNull Function<? super Object[],? extends R> combiner, int bufferSize)
Combines an
Iterable
of source
ObservableSource
s by emitting an item that aggregates the latest values of each of the returned
ObservableSource
s each time an item is received from any of the returned
ObservableSource
s, where this aggregation is defined by a specified function.
static <T1,T2,R> @NonNull Observable<R>
combineLatest(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull BiFunction<? super T1,? super T2,? extends R> combiner)
Combines two source
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from either of the
ObservableSource
s, where this aggregation is defined by a specified function.
static <T1,T2,T3,R>
@NonNull Observable<R>
combineLatest(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull Function3<? super T1,? super T2,? super T3,? extends R> combiner)
Combines three source
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function.
static <T1,T2,T3,T4,R>
@NonNull Observable<R>
combineLatest(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull Function4<? super T1,? super T2,? super T3,? super T4,? extends R> combiner)
Combines four source
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function.
static <T1,T2,T3,T4,T5,R>
@NonNull Observable<R>
combineLatest(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull ObservableSource<? extends T5> source5, @NonNull Function5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> combiner)
Combines five source
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function.
static <T1,T2,T3,T4,T5,T6,R>
@NonNull Observable<R>
combineLatest(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull ObservableSource<? extends T5> source5, @NonNull ObservableSource<? extends T6> source6, @NonNull Function6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> combiner)
Combines six source
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function.
static <T1,T2,T3,T4,T5,T6,T7,R>
@NonNull Observable<R>
combineLatest(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull ObservableSource<? extends T5> source5, @NonNull ObservableSource<? extends T6> source6, @NonNull ObservableSource<? extends T7> source7, @NonNull Function7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> combiner)
Combines seven source
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function.
static <T1,T2,T3,T4,T5,T6,T7,T8,R>
@NonNull Observable<R>
combineLatest(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull ObservableSource<? extends T5> source5, @NonNull ObservableSource<? extends T6> source6, @NonNull ObservableSource<? extends T7> source7, @NonNull ObservableSource<? extends T8> source8, @NonNull Function8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> combiner)
Combines eight source
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function.
static <T1,T2,T3,T4,T5,T6,T7,T8,T9,R>
@NonNull Observable<R>
combineLatest(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull ObservableSource<? extends T5> source5, @NonNull ObservableSource<? extends T6> source6, @NonNull ObservableSource<? extends T7> source7, @NonNull ObservableSource<? extends T8> source8, @NonNull ObservableSource<? extends T9> source9, @NonNull Function9<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? super T9,? extends R> combiner)
Combines nine source
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function.
static <T,R> @NonNull Observable<R>
combineLatestArray(@NonNull ObservableSource<? extends T>[] sources, @NonNull Function<? super Object[],? extends R> combiner)
Combines an array of source
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the returned
ObservableSource
s, where this aggregation is defined by a specified function.
static <T,R> @NonNull Observable<R>
combineLatestArray(@NonNull ObservableSource<? extends T>[] sources, @NonNull Function<? super Object[],? extends R> combiner, int bufferSize)
Combines an array of source
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function.
static <T,R> @NonNull Observable<R>
combineLatestArrayDelayError(@NonNull ObservableSource<? extends T>[] sources, @NonNull Function<? super Object[],? extends R> combiner)
Combines an array of
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function.
static <T,R> @NonNull Observable<R>
combineLatestArrayDelayError(@NonNull ObservableSource<? extends T>[] sources, @NonNull Function<? super Object[],? extends R> combiner, int bufferSize)
Combines an array of
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function and delays any error from the sources until all source
ObservableSource
s terminate.
static <T,R> @NonNull Observable<R>
combineLatestDelayError(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, @NonNull Function<? super Object[],? extends R> combiner)
Combines an
Iterable
of
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function and delays any error from the sources until all source
ObservableSource
s terminate.
static <T,R> @NonNull Observable<R>
combineLatestDelayError(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, @NonNull Function<? super Object[],? extends R> combiner, int bufferSize)
Combines an
Iterable
of
ObservableSource
s by emitting an item that aggregates the latest values of each of the
ObservableSource
s each time an item is received from any of the
ObservableSource
s, where this aggregation is defined by a specified function and delays any error from the sources until all source
ObservableSource
s terminate.
<R> @NonNull Observable<R>
compose(@NonNull ObservableTransformer<? super T,? extends R> composer)
static <T> @NonNull Observable<T>
concat(@NonNull Iterable<? extends ObservableSource<? extends T>> sources)
Concatenates elements of each
ObservableSource
provided via an
Iterable
sequence into a single sequence of elements without interleaving them.
static <T> @NonNull Observable<T>
concat(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources)
Returns an
Observable
that emits the items emitted by each of the
ObservableSource
s emitted by the
ObservableSource
, one after the other, without interleaving them.
static <T> @NonNull Observable<T>
concat(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources, int bufferSize)
Returns an
Observable
that emits the items emitted by each of the
ObservableSource
s emitted by the outer
ObservableSource
, one after the other, without interleaving them.
static <T> @NonNull Observable<T>
concat(@NonNull ObservableSource<? extends T> source1, ObservableSource<? extends T> source2)
Returns an
Observable
that emits the items emitted by two
ObservableSource
s, one after the other, without interleaving them.
static <T> @NonNull Observable<T>
concat(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2, @NonNull ObservableSource<? extends T> source3)
Returns an
Observable
that emits the items emitted by three
ObservableSource
s, one after the other, without interleaving them.
static <T> @NonNull Observable<T>
concat(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2, @NonNull ObservableSource<? extends T> source3, @NonNull ObservableSource<? extends T> source4)
Returns an
Observable
that emits the items emitted by four
ObservableSource
s, one after the other, without interleaving them.
static <T> @NonNull Observable<T>
concatArray(ObservableSource<? extends T>... sources)
static <T> @NonNull Observable<T>
concatArrayDelayError(ObservableSource<? extends T>... sources)
Concatenates a variable number of
ObservableSource
sources and delays errors from any of them till all terminate.
static <T> @NonNull Observable<T>
concatArrayEager(int maxConcurrency, int bufferSize, ObservableSource<? extends T>... sources)
Concatenates an array of
ObservableSource
s eagerly into a single stream of values.
static <T> @NonNull Observable<T>
concatArrayEager(ObservableSource<? extends T>... sources)
Concatenates an array of
ObservableSource
s eagerly into a single stream of values.
static <T> @NonNull Observable<T>
concatArrayEagerDelayError(int maxConcurrency, int bufferSize, ObservableSource<? extends T>... sources)
Concatenates an array of
ObservableSource
s eagerly into a single stream of values and delaying any errors until all sources terminate.
static <T> @NonNull Observable<T>
concatArrayEagerDelayError(ObservableSource<? extends T>... sources)
Concatenates an array of
ObservableSource
s eagerly into a single stream of values and delaying any errors until all sources terminate.
static <T> @NonNull Observable<T>
concatDelayError(@NonNull Iterable<? extends ObservableSource<? extends T>> sources)
Concatenates the
Iterable
sequence of
ObservableSource
s into a single
Observable
sequence by subscribing to each
ObservableSource
, one after the other, one at a time and delays any errors till the all inner
ObservableSource
s terminate.
static <T> @NonNull Observable<T>
concatDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources)
Concatenates the
ObservableSource
sequence of
ObservableSource
s into a single
Observable
sequence by subscribing to each inner
ObservableSource
, one after the other, one at a time and delays any errors till the all inner and the outer
ObservableSource
s terminate.
static <T> @NonNull Observable<T>
concatDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources, int bufferSize, boolean tillTheEnd)
Concatenates the
ObservableSource
sequence of
ObservableSource
s into a single sequence by subscribing to each inner
ObservableSource
, one after the other, one at a time and delays any errors till the all inner and the outer
ObservableSource
s terminate.
static <T> @NonNull Observable<T>
concatEager(@NonNull Iterable<? extends ObservableSource<? extends T>> sources)
Concatenates a sequence of
ObservableSource
s eagerly into a single stream of values.
static <T> @NonNull Observable<T>
concatEager(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, int maxConcurrency, int bufferSize)
Concatenates a sequence of
ObservableSource
s eagerly into a single stream of values and runs a limited number of inner sequences at once.
static <T> @NonNull Observable<T>
concatEager(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources)
Concatenates an
ObservableSource
sequence of
ObservableSource
s eagerly into a single stream of values.
static <T> @NonNull Observable<T>
concatEager(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources, int maxConcurrency, int bufferSize)
Concatenates an
ObservableSource
sequence of
ObservableSource
s eagerly into a single stream of values and runs a limited number of inner sequences at once.
static <T> @NonNull Observable<T>
concatEagerDelayError(@NonNull Iterable<? extends ObservableSource<? extends T>> sources)
Concatenates a sequence of
ObservableSource
s eagerly into a single stream of values, delaying errors until all the inner sequences terminate.
static <T> @NonNull Observable<T>
concatEagerDelayError(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, int maxConcurrency, int bufferSize)
Concatenates a sequence of
ObservableSource
s eagerly into a single stream of values, delaying errors until all the inner sequences terminate and runs a limited number of inner sequences at once.
static <T> @NonNull Observable<T>
concatEagerDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources)
Concatenates an
ObservableSource
sequence of
ObservableSource
s eagerly into a single stream of values, delaying errors until all the inner and the outer sequence terminate.
static <T> @NonNull Observable<T>
concatEagerDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources, int maxConcurrency, int bufferSize)
Concatenates an
ObservableSource
sequence of
ObservableSource
s eagerly into a single stream of values, delaying errors until all the inner and the outer sequence terminate and runs a limited number of inner sequences at once.
<R> @NonNull Observable<R>
concatMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper)
Returns a new
Observable
that emits items resulting from applying a function that you supply to each item emitted by the current
Observable
, where that function returns an
ObservableSource
, and then emitting the items that result from concatenating those returned
ObservableSource
s.
<R> @NonNull Observable<R>
concatMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, int bufferSize)
Returns a new
Observable
that emits items resulting from applying a function that you supply to each item emitted by the current
Observable
, where that function returns an
ObservableSource
, and then emitting the items that result from concatenating those returned
ObservableSource
s.
<R> @NonNull Observable<R>
concatMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, int bufferSize, @NonNull Scheduler scheduler)
Returns a new
Observable
that emits items resulting from applying a function that you supply to each item emitted by the current
Observable
, where that function returns an
ObservableSource
, and then emitting the items that result from concatenating those returned
ObservableSource
s.
@NonNull Completable
concatMapCompletable(@NonNull Function<? super T,? extends CompletableSource> mapper)
Maps each element of the current
Observable
into
CompletableSource
s, subscribes to them one at a time in order and waits until the upstream and all
CompletableSource
s complete.
@NonNull Completable
concatMapCompletable(@NonNull Function<? super T,? extends CompletableSource> mapper, int capacityHint)
Maps each element of the current
Observable
into
CompletableSource
s, subscribes to them one at a time in order and waits until the upstream and all
CompletableSource
s complete.
@NonNull Completable
concatMapCompletableDelayError(@NonNull Function<? super T,? extends CompletableSource> mapper)
Maps the upstream items into
CompletableSource
s and subscribes to them one after the other terminates, delaying all errors till both the current
Observable
and all inner
CompletableSource
s terminate.
@NonNull Completable
concatMapCompletableDelayError(@NonNull Function<? super T,? extends CompletableSource> mapper, boolean tillTheEnd)
Maps the upstream items into
CompletableSource
s and subscribes to them one after the other terminates, optionally delaying all errors till both the current
Observable
and all inner
CompletableSource
s terminate.
@NonNull Completable
concatMapCompletableDelayError(@NonNull Function<? super T,? extends CompletableSource> mapper, boolean tillTheEnd, int bufferSize)
Maps the upstream items into
CompletableSource
s and subscribes to them one after the other terminates, optionally delaying all errors till both the current
Observable
and all inner
CompletableSource
s terminate.
<R> @NonNull Observable<R>
concatMapDelayError(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper)
Maps each of the items into an
ObservableSource
, subscribes to them one after the other, one at a time and emits their values in order while delaying any error from either this or any of the inner
ObservableSource
s till all of them terminate.
<R> @NonNull Observable<R>
concatMapDelayError(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, boolean tillTheEnd, int bufferSize)
Maps each of the items into an
ObservableSource
, subscribes to them one after the other, one at a time and emits their values in order while delaying any error from either this or any of the inner
ObservableSource
s till all of them terminate.
<R> @NonNull Observable<R>
concatMapDelayError(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, boolean tillTheEnd, int bufferSize, @NonNull Scheduler scheduler)
Maps each of the items into an
ObservableSource
, subscribes to them one after the other, one at a time and emits their values in order while delaying any error from either this or any of the inner
ObservableSource
s till all of them terminate.
<R> @NonNull Observable<R>
concatMapEager(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper)
Maps a sequence of values into
ObservableSource
s and concatenates these
ObservableSource
s eagerly into a single
Observable
sequence.
<R> @NonNull Observable<R>
concatMapEager(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, int maxConcurrency, int bufferSize)
Maps a sequence of values into
ObservableSource
s and concatenates these
ObservableSource
s eagerly into a single
Observable
sequence.
<R> @NonNull Observable<R>
concatMapEagerDelayError(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, boolean tillTheEnd)
Maps a sequence of values into
ObservableSource
s and concatenates these
ObservableSource
s eagerly into a single
Observable
sequence.
<R> @NonNull Observable<R>
concatMapEagerDelayError(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, boolean tillTheEnd, int maxConcurrency, int bufferSize)
Maps a sequence of values into
ObservableSource
s and concatenates these
ObservableSource
s eagerly into a single
Observable
sequence.
<U> @NonNull Observable<U>
concatMapIterable(@NonNull Function<? super T,? extends Iterable<? extends U>> mapper)
Returns an
Observable
that concatenate each item emitted by the current
Observable
with the values in an
Iterable
corresponding to that item that is generated by a selector.
<R> @NonNull Observable<R>
concatMapMaybe(@NonNull Function<? super T,? extends MaybeSource<? extends R>> mapper)
Maps the upstream items into
MaybeSource
s and subscribes to them one after the other succeeds or completes, emits their success value if available or terminates immediately if either the current
Observable
or the current inner
MaybeSource
fail.
<R> @NonNull Observable<R>
concatMapMaybe(@NonNull Function<? super T,? extends MaybeSource<? extends R>> mapper, int bufferSize)
Maps the upstream items into
MaybeSource
s and subscribes to them one after the other succeeds or completes, emits their success value if available or terminates immediately if either the current
Observable
or the current inner
MaybeSource
fail.
<R> @NonNull Observable<R>
concatMapMaybeDelayError(@NonNull Function<? super T,? extends MaybeSource<? extends R>> mapper)
Maps the upstream items into
MaybeSource
s and subscribes to them one after the other terminates, emits their success value if available and delaying all errors till both the current
Observable
and all inner
MaybeSource
s terminate.
<R> @NonNull Observable<R>
concatMapMaybeDelayError(@NonNull Function<? super T,? extends MaybeSource<? extends R>> mapper, boolean tillTheEnd)
Maps the upstream items into
MaybeSource
s and subscribes to them one after the other terminates, emits their success value if available and optionally delaying all errors till both the current
Observable
and all inner
MaybeSource
s terminate.
<R> @NonNull Observable<R>
concatMapMaybeDelayError(@NonNull Function<? super T,? extends MaybeSource<? extends R>> mapper, boolean tillTheEnd, int bufferSize)
Maps the upstream items into
MaybeSource
s and subscribes to them one after the other terminates, emits their success value if available and optionally delaying all errors till both the current
Observable
and all inner
MaybeSource
s terminate.
<R> @NonNull Observable<R>
concatMapSingle(@NonNull Function<? super T,? extends SingleSource<? extends R>> mapper)
Maps the upstream items into
SingleSource
s and subscribes to them one after the other succeeds, emits their success values or terminates immediately if either the current
Observable
or the current inner
SingleSource
fail.
<R> @NonNull Observable<R>
concatMapSingle(@NonNull Function<? super T,? extends SingleSource<? extends R>> mapper, int bufferSize)
Maps the upstream items into
SingleSource
s and subscribes to them one after the other succeeds, emits their success values or terminates immediately if either the current
Observable
or the current inner
SingleSource
fail.
<R> @NonNull Observable<R>
concatMapSingleDelayError(@NonNull Function<? super T,? extends SingleSource<? extends R>> mapper)
Maps the upstream items into
SingleSource
s and subscribes to them one after the other succeeds or fails, emits their success values and delays all errors till both the current
Observable
and all inner
SingleSource
s terminate.
<R> @NonNull Observable<R>
concatMapSingleDelayError(@NonNull Function<? super T,? extends SingleSource<? extends R>> mapper, boolean tillTheEnd)
Maps the upstream items into
SingleSource
s and subscribes to them one after the other succeeds or fails, emits their success values and optionally delays all errors till both the current
Observable
and all inner
SingleSource
s terminate.
<R> @NonNull Observable<R>
concatMapSingleDelayError(@NonNull Function<? super T,? extends SingleSource<? extends R>> mapper, boolean tillTheEnd, int bufferSize)
Maps the upstream items into
SingleSource
s and subscribes to them one after the other succeeds or fails, emits their success values and optionally delays errors till both the current
Observable
and all inner
SingleSource
s terminate.
<R> @NonNull Observable<R>
concatMapStream(@NonNull Function<? super T,? extends Stream<? extends R>> mapper)
Maps each upstream item into a
Stream
and emits the
Stream
's items to the downstream in a sequential fashion.
@NonNull Observable<T>
concatWith(@NonNull CompletableSource other)
Returns an
Observable
that emits items from the current
Observable
and when it completes normally, the other
CompletableSource
is subscribed to and the returned
Observable
emits its terminal events.
@NonNull Observable<T>
concatWith(@NonNull MaybeSource<? extends T> other)
Returns an
Observable
that emits the items from the current
Observable
followed by the success item or terminal events of the other
MaybeSource
.
@NonNull Observable<T>
concatWith(@NonNull ObservableSource<? extends T> other)
Returns an
Observable
that first emits the items emitted from the current
Observable
, then items from the
other
ObservableSource
without interleaving them.
@NonNull Observable<T>
concatWith(@NonNull SingleSource<? extends T> other)
Returns an
Observable
that emits the items from the current
Observable
followed by the success item or error event of the
other
SingleSource
.
@NonNull Single<Boolean>
contains(@NonNull Object item)
Returns a
Single
that emits a
Boolean
that indicates whether the current
Observable
emitted a specified item.
@NonNull Single<Long>
count()
Returns a
Single
that counts the total number of items emitted by the current
Observable
and emits this count as a 64-bit
Long
.
static <T> @NonNull Observable<T>
create(@NonNull ObservableOnSubscribe<T> source)
Provides an API (via a cold Observable
) that bridges the reactive world with the callback-style world.
<U> @NonNull Observable<T>
debounce(@NonNull Function<? super T,? extends ObservableSource<U>> debounceIndicator)
Returns an
Observable
that mirrors the current
Observable
, except that it drops items emitted by the current
Observable
that are followed by another item within a computed debounce duration denoted by an item emission or completion from a generated inner
ObservableSource
for that original item.
@NonNull Observable<T>
debounce(long timeout, @NonNull TimeUnit unit)
Returns an Observable
that mirrors the current Observable
, except that it drops items emitted by the current Observable
that are followed by newer items before a timeout value expires.
@NonNull Observable<T>
debounce(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that mirrors the current
Observable
, except that it drops items emitted by the current
Observable
that are followed by newer items before a timeout value expires on a specified
Scheduler
.
@NonNull Observable<T>
debounce(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Consumer<? super T> onDropped)
Returns an
Observable
that mirrors the current
Observable
, except that it drops items emitted by the current
Observable
that are followed by newer items before a timeout value expires on a specified
Scheduler
.
@NonNull Observable<T>
defaultIfEmpty(T defaultItem)
Returns an Observable
that emits the items emitted by the current Observable
or a specified default item if the current Observable
is empty.
static <T> @NonNull Observable<T>
defer(@NonNull Supplier<? extends ObservableSource<? extends T>> supplier)
Returns an
Observable
that calls an
ObservableSource
factory to create an
ObservableSource
for each new
Observer
that subscribes.
<U> @NonNull Observable<T>
delay(@NonNull Function<? super T,? extends ObservableSource<U>> itemDelayIndicator)
Returns an
Observable
that delays the emissions of the current
Observable
via a per-item derived
ObservableSource
's item emission or termination, on a per source item basis.
@NonNull Observable<T>
delay(long time, @NonNull TimeUnit unit)
Returns an Observable
that emits the items emitted by the current Observable
shifted forward in time by a specified delay.
@NonNull Observable<T>
delay(long time, @NonNull TimeUnit unit, boolean delayError)
Returns an Observable
that emits the items emitted by the current Observable
shifted forward in time by a specified delay.
@NonNull Observable<T>
delay(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an Observable
that emits the items emitted by the current Observable
shifted forward in time by a specified delay.
@NonNull Observable<T>
delay(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError)
Returns an Observable
that emits the items emitted by the current Observable
shifted forward in time by a specified delay.
<U,V> @NonNull Observable<T>
delay(@NonNull ObservableSource<U> subscriptionIndicator, @NonNull Function<? super T,? extends ObservableSource<V>> itemDelayIndicator)
Returns an
Observable
that delays the subscription to and emissions from the current
Observable
via
ObservableSource
s for the subscription itself and on a per-item basis.
@NonNull Observable<T>
delaySubscription(long time, @NonNull TimeUnit unit)
Returns an Observable
that delays the subscription to the current Observable
by a given amount of time.
@NonNull Observable<T>
delaySubscription(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that delays the subscription to the current
Observable
by a given amount of time, both waiting and subscribing on a given
Scheduler
.
<U> @NonNull Observable<T>
delaySubscription(@NonNull ObservableSource<U> subscriptionIndicator)
Returns an
Observable
that delays the subscription to the current
Observable
until the other
ObservableSource
emits an element or completes normally.
<R> @NonNull Observable<R>
dematerialize(@NonNull Function<? super T,Notification<R>> selector)
Returns an
Observable
that reverses the effect of
materialize
by transforming the
Notification
objects extracted from the source items via a selector function into their respective
Observer
signal types.
@NonNull Observable<T>
distinct()
Returns an
Observable
that emits all items emitted by the current
Observable
that are distinct based on
Object.equals(Object)
comparison.
<K> @NonNull Observable<T>
distinct(@NonNull Function<? super T,K> keySelector)
Returns an
Observable
that emits all items emitted by the current
Observable
that are distinct according to a key selector function and based on
Object.equals(Object)
comparison of the objects returned by the key selector function.
<K> @NonNull Observable<T>
distinct(@NonNull Function<? super T,K> keySelector, @NonNull Supplier<? extends Collection<? super K>> collectionSupplier)
Returns an
Observable
that emits all items emitted by the current
Observable
that are distinct according to a key selector function and based on
Object.equals(Object)
comparison of the objects returned by the key selector function.
@NonNull Observable<T>
distinctUntilChanged()
Returns an
Observable
that emits all items emitted by the current
Observable
that are distinct from their immediate predecessors based on
Object.equals(Object)
comparison.
@NonNull Observable<T>
distinctUntilChanged(@NonNull BiPredicate<? super T,? super T> comparer)
Returns an Observable
that emits all items emitted by the current Observable
that are distinct from their immediate predecessors when compared with each other via the provided comparator function.
<K> @NonNull Observable<T>
distinctUntilChanged(@NonNull Function<? super T,K> keySelector)
Returns an
Observable
that emits all items emitted by the current
Observable
that are distinct from their immediate predecessors, according to a key selector function and based on
Object.equals(Object)
comparison of those objects returned by the key selector function.
@NonNull Observable<T>
doAfterNext(@NonNull Consumer<? super T> onAfterNext)
Calls the specified
Consumer
with the current item after this item has been emitted to the downstream.
@NonNull Observable<T>
doAfterTerminate(@NonNull Action onAfterTerminate)
@NonNull Observable<T>
doFinally(@NonNull Action onFinally)
Calls the specified action after the current Observable
signals onError
or onCompleted
or gets disposed by the downstream.
@NonNull Observable<T>
doOnComplete(@NonNull Action onComplete)
Returns an
Observable
that invokes an
Action
when the current
Observable
calls
onComplete
.
@NonNull Observable<T>
doOnDispose(@NonNull Action onDispose)
Calls the given shared
Action
if the downstream disposes the sequence.
@NonNull Observable<T>
doOnEach(@NonNull Consumer<? super Notification<T>> onNotification)
Returns an
Observable
that invokes a
Consumer
with the appropriate
Notification
object when the current
Observable
signals an item or terminates.
@NonNull Observable<T>
doOnEach(@NonNull Observer<? super T> observer)
Returns an
Observable
that forwards the items and terminal events of the current
Observable
to its
Observer
s and to the given shared
Observer
instance.
@NonNull Observable<T>
doOnError(@NonNull Consumer<? super Throwable> onError)
Calls the given
Consumer
with the error
Throwable
if the current
Observable
failed before forwarding it to the downstream.
@NonNull Observable<T>
doOnLifecycle(@NonNull Consumer<? super Disposable> onSubscribe, @NonNull Action onDispose)
Calls the appropriate
onXXX
method (shared between all
Observer
s) for the lifecycle events of the sequence (subscription, disposal).
@NonNull Observable<T>
doOnNext(@NonNull Consumer<? super T> onNext)
Calls the given
Consumer
with the value emitted by the current
Observable
before forwarding it to the downstream.
@NonNull Observable<T>
doOnSubscribe(@NonNull Consumer<? super Disposable> onSubscribe)
Returns an
Observable
so that it invokes the given
Consumer
when the current
Observable
is subscribed from its
Observer
s.
@NonNull Observable<T>
doOnTerminate(@NonNull Action onTerminate)
Returns an Observable
so that it invokes an action when the current Observable
calls onComplete
or onError
.
@NonNull Maybe<T>
elementAt(long index)
Returns a
Maybe
that emits the single item at a specified index in a sequence of emissions from the current
Observable
or completes if the current
Observable
signals fewer elements than index.
@NonNull Single<T>
elementAt(long index, T defaultItem)
Returns a
Single
that emits the item found at a specified index in a sequence of emissions from the current
Observable
, or a default item if that index is out of range.
@NonNull Single<T>
elementAtOrError(long index)
Returns a
Single
that emits the item found at a specified index in a sequence of emissions from the current
Observable
or signals a
NoSuchElementException
if the current
Observable
signals fewer elements than index.
static <T> @NonNull Observable<T>
empty()
Returns an
Observable
that emits no items to the
Observer
and immediately invokes its
onComplete
method.
static <T> @NonNull Observable<T>
error(@NonNull Supplier<? extends Throwable> supplier)
Returns an
Observable
that invokes an
Observer
's
onError
method when the
Observer
subscribes to it.
static <T> @NonNull Observable<T>
error(@NonNull Throwable throwable)
Returns an
Observable
that invokes an
Observer
's
onError
method when the
Observer
subscribes to it.
@NonNull Observable<T>
filter(@NonNull Predicate<? super T> predicate)
Filters items emitted by the current
Observable
by only emitting those that satisfy a specified
Predicate
.
@NonNull Single<T>
first(T defaultItem)
Returns a
Single
that emits only the very first item emitted by the current
Observable
, or a default item if the current
Observable
completes without emitting any items.
@NonNull Maybe<T>
firstElement()
Returns a
Maybe
that emits only the very first item emitted by the current
Observable
, or completes if the current
Observable
is empty.
@NonNull Single<T>
firstOrError()
Returns a
Single
that emits only the very first item emitted by the current
Observable
or signals a
NoSuchElementException
if the current
Observable
is empty.
@NonNull CompletionStage<T>
firstOrErrorStage()
@NonNull CompletionStage<T>
firstStage(T defaultItem)
Signals the first upstream item (or the default item if the upstream is empty) via a
CompletionStage
.
<R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper)
Returns an
Observable
that emits items based on applying a function that you supply to each item emitted by the current
Observable
, where that function returns an
ObservableSource
, and then merging those returned
ObservableSource
s and emitting the results of this merger.
<R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, boolean delayErrors)
Returns an
Observable
that emits items based on applying a function that you supply to each item emitted by the current
Observable
, where that function returns an
ObservableSource
, and then merging those returned
ObservableSource
s and emitting the results of this merger.
<R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, boolean delayErrors, int maxConcurrency)
Returns an
Observable
that emits items based on applying a function that you supply to each item emitted by the current
Observable
, where that function returns an
ObservableSource
, and then merging those returned
ObservableSource
s and emitting the results of this merger, while limiting the maximum number of concurrent subscriptions to these
ObservableSource
s.
<R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, boolean delayErrors, int maxConcurrency, int bufferSize)
Returns an
Observable
that emits items based on applying a function that you supply to each item emitted by the current
Observable
, where that function returns an
ObservableSource
, and then merging those returned
ObservableSource
s and emitting the results of this merger, while limiting the maximum number of concurrent subscriptions to these
ObservableSource
s.
<R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> onNextMapper, @NonNull Function<? super Throwable,? extends ObservableSource<? extends R>> onErrorMapper, @NonNull Supplier<? extends ObservableSource<? extends R>> onCompleteSupplier)
Returns an
Observable
that applies a function to each item emitted or notification raised by the current
Observable
and then flattens the
ObservableSource
s returned from these functions and emits the resulting items.
<R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> onNextMapper, @NonNull Function<Throwable,? extends ObservableSource<? extends R>> onErrorMapper, @NonNull Supplier<? extends ObservableSource<? extends R>> onCompleteSupplier, int maxConcurrency)
Returns an
Observable
that applies a function to each item emitted or notification raised by the current
Observable
and then flattens the
ObservableSource
s returned from these functions and emits the resulting items, while limiting the maximum number of concurrent subscriptions to these
ObservableSource
s.
<R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, int maxConcurrency)
Returns an
Observable
that emits items based on applying a function that you supply to each item emitted by the current
Observable
, where that function returns an
ObservableSource
, and then merging those returned
ObservableSource
s and emitting the results of this merger, while limiting the maximum number of concurrent subscriptions to these
ObservableSource
s.
<U,R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends U>> mapper, @NonNull BiFunction<? super T,? super U,? extends R> combiner)
Returns an
Observable
that emits the results of a specified function to the pair of values emitted by the current
Observable
and the mapped inner
ObservableSource
.
<U,R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends U>> mapper, @NonNull BiFunction<? super T,? super U,? extends R> combiner, boolean delayErrors)
Returns an
Observable
that emits the results of a specified function to the pair of values emitted by the current
Observable
and the mapped inner
ObservableSource
.
<U,R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends U>> mapper, @NonNull BiFunction<? super T,? super U,? extends R> combiner, boolean delayErrors, int maxConcurrency)
Returns an
Observable
that emits the results of a specified function to the pair of values emitted by the current
Observable
and the mapped inner
ObservableSource
, while limiting the maximum number of concurrent subscriptions to these
ObservableSource
s.
<U,R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends U>> mapper, @NonNull BiFunction<? super T,? super U,? extends R> combiner, boolean delayErrors, int maxConcurrency, int bufferSize)
Returns an
Observable
that emits the results of a specified function to the pair of values emitted by the current
Observable
and the mapped inner
ObservableSource
, while limiting the maximum number of concurrent subscriptions to these
ObservableSource
s.
<U,R> @NonNull Observable<R>
flatMap(@NonNull Function<? super T,? extends ObservableSource<? extends U>> mapper, @NonNull BiFunction<? super T,? super U,? extends R> combiner, int maxConcurrency)
Returns an
Observable
that emits the results of a specified function to the pair of values emitted by the current
Observable
and the mapped inner
ObservableSource
, while limiting the maximum number of concurrent subscriptions to these
ObservableSource
s.
@NonNull Completable
flatMapCompletable(@NonNull Function<? super T,? extends CompletableSource> mapper)
Maps each element of the current
Observable
into
CompletableSource
s, subscribes to them and waits until the upstream and all
CompletableSource
s complete.
@NonNull Completable
flatMapCompletable(@NonNull Function<? super T,? extends CompletableSource> mapper, boolean delayErrors)
Maps each element of the current
Observable
into
CompletableSource
s, subscribes to them and waits until the upstream and all
CompletableSource
s complete, optionally delaying all errors.
<U> @NonNull Observable<U>
flatMapIterable(@NonNull Function<? super T,? extends Iterable<? extends U>> mapper)
Merges
Iterable
s generated by a mapper
Function
for each individual item emitted by the current
Observable
into a single
Observable
sequence.
<U,V> @NonNull Observable<V>
flatMapIterable(@NonNull Function<? super T,? extends Iterable<? extends U>> mapper, @NonNull BiFunction<? super T,? super U,? extends V> combiner)
Merges
Iterable
s generated by a mapper
Function
for each individual item emitted by the current
Observable
into a single
Observable
sequence where the resulting items will be the combination of the original item and each inner item of the respective
Iterable
as returned by the
resultSelector
BiFunction
.
<R> @NonNull Observable<R>
flatMapMaybe(@NonNull Function<? super T,? extends MaybeSource<? extends R>> mapper)
Maps each element of the current
Observable
into
MaybeSource
s, subscribes to all of them and merges their
onSuccess
values, in no particular order, into a single
Observable
sequence.
<R> @NonNull Observable<R>
flatMapMaybe(@NonNull Function<? super T,? extends MaybeSource<? extends R>> mapper, boolean delayErrors)
Maps each element of the current
Observable
into
MaybeSource
s, subscribes to them and merges their
onSuccess
values, in no particular order, into a single
Observable
sequence, optionally delaying all errors.
<R> @NonNull Observable<R>
flatMapSingle(@NonNull Function<? super T,? extends SingleSource<? extends R>> mapper)
Maps each element of the current
Observable
into
SingleSource
s, subscribes to all of them and merges their
onSuccess
values, in no particular order, into a single
Observable
sequence.
<R> @NonNull Observable<R>
flatMapSingle(@NonNull Function<? super T,? extends SingleSource<? extends R>> mapper, boolean delayErrors)
Maps each element of the current
Observable
into
SingleSource
s, subscribes to them and merges their
onSuccess
values, in no particular order, into a single
Observable
sequence, optionally delaying all errors.
<R> @NonNull Observable<R>
flatMapStream(@NonNull Function<? super T,? extends Stream<? extends R>> mapper)
Maps each upstream item into a
Stream
and emits the
Stream
's items to the downstream in a sequential fashion.
@NonNull Disposable
forEach(@NonNull Consumer<? super T> onNext)
@NonNull Disposable
forEachWhile(@NonNull Predicate<? super T> onNext)
Subscribes to the
ObservableSource
and calls a
Predicate
for each item of the current
Observable
, on its emission thread, until the predicate returns
false
.
@NonNull Disposable
forEachWhile(@NonNull Predicate<? super T> onNext, @NonNull Consumer<? super Throwable> onError)
Subscribes to the
ObservableSource
and calls a
Predicate
for each item or a
Consumer
with the error of the current
Observable
, on their original emission threads, until the predicate returns
false
.
@NonNull Disposable
forEachWhile(@NonNull Predicate<? super T> onNext, @NonNull Consumer<? super Throwable> onError, @NonNull Action onComplete)
Subscribes to the
ObservableSource
and calls a
Predicate
for each item, a
Consumer
with the error or an
Action
upon completion of the current
Observable
, on their original emission threads, until the predicate returns
false
.
static <T> @NonNull Observable<T>
fromAction(@NonNull Action action)
Returns an
Observable
instance that runs the given
Action
for each
Observer
and emits either its exception or simply completes.
static <T> @NonNull Observable<T>
fromArray(T... items)
static <T> @NonNull Observable<T>
fromCallable(@NonNull Callable<? extends T> callable)
Returns an Observable
that, when an observer subscribes to it, invokes a function you specify and then emits the value returned from that function.
static <T> @NonNull Observable<T>
fromCompletable(@NonNull CompletableSource completableSource)
static <T> @NonNull Observable<T>
fromCompletionStage(@NonNull CompletionStage<T> stage)
Signals the completion value or error of the given (hot)
CompletionStage
-based asynchronous calculation.
static <T> @NonNull Observable<T>
fromFuture(@NonNull Future<? extends T> future)
Converts a
Future
into an
Observable
.
static <T> @NonNull Observable<T>
fromFuture(@NonNull Future<? extends T> future, long timeout, @NonNull TimeUnit unit)
Converts a
Future
into an
Observable
, with a timeout on the
Future
.
static <T> @NonNull Observable<T>
fromIterable(@NonNull Iterable<? extends T> source)
Converts an
Iterable
sequence into an
Observable
that emits the items in the sequence.
static <T> @NonNull Observable<T>
fromMaybe(@NonNull MaybeSource<T> maybe)
Returns an
Observable
instance that when subscribed to, subscribes to the
MaybeSource
instance and emits
onSuccess
as a single item or forwards any
onComplete
or
onError
signal.
static <T> @NonNull Observable<T>
fromOptional(@NonNull Optional<T> optional)
Converts the existing value of the provided optional into a
just(Object)
or an empty optional into an
empty()
Observable
instance.
static <T> @NonNull Observable<T>
fromPublisher(@NonNull Publisher<? extends T> publisher)
Converts an arbitrary
Reactive StreamsPublisher
into an
Observable
.
static <T> @NonNull Observable<T>
fromRunnable(@NonNull Runnable run)
Returns an
Observable
instance that runs the given
Runnable
for each
Observer
and emits either its unchecked exception or simply completes.
static <T> @NonNull Observable<T>
fromSingle(@NonNull SingleSource<T> source)
Returns an
Observable
instance that when subscribed to, subscribes to the
SingleSource
instance and emits
onSuccess
as a single item or forwards the
onError
signal.
static <T> @NonNull Observable<T>
fromStream(@NonNull Stream<T> stream)
Converts a
Stream
into a finite
Observable
and emits its items in the sequence.
static <T> @NonNull Observable<T>
fromSupplier(@NonNull Supplier<? extends T> supplier)
Returns an Observable
that, when an observer subscribes to it, invokes a supplier function you specify and then emits the value returned from that function.
static <T> @NonNull Observable<T>
generate(@NonNull Consumer<Emitter<T>> generator)
Returns a cold, synchronous and stateless generator of values.
static <T,S> @NonNull Observable<T>
generate(@NonNull Supplier<S> initialState, @NonNull BiConsumer<S,Emitter<T>> generator)
Returns a cold, synchronous and stateful generator of values.
static <T,S> @NonNull Observable<T>
generate(@NonNull Supplier<S> initialState, @NonNull BiConsumer<S,Emitter<T>> generator, @NonNull Consumer<? super S> disposeState)
Returns a cold, synchronous and stateful generator of values.
static <T,S> @NonNull Observable<T>
generate(@NonNull Supplier<S> initialState, @NonNull BiFunction<S,Emitter<T>,S> generator)
Returns a cold, synchronous and stateful generator of values.
static <T,S> @NonNull Observable<T>
generate(@NonNull Supplier<S> initialState, @NonNull BiFunction<S,Emitter<T>,S> generator, @NonNull Consumer<? super S> disposeState)
Returns a cold, synchronous and stateful generator of values.
<K> @NonNull Observable<GroupedObservable<K,T>>
groupBy(@NonNull Function<? super T,? extends K> keySelector)
Groups the items emitted by the current
Observable
according to a specified criterion, and emits these grouped items as
GroupedObservable
s.
<K> @NonNull Observable<GroupedObservable<K,T>>
groupBy(@NonNull Function<? super T,? extends K> keySelector, boolean delayError)
Groups the items emitted by the current
Observable
according to a specified criterion, and emits these grouped items as
GroupedObservable
s.
<K,V> @NonNull Observable<GroupedObservable<K,V>>
groupBy(@NonNull Function<? super T,? extends K> keySelector, Function<? super T,? extends V> valueSelector)
Groups the items emitted by the current
Observable
according to a specified criterion, and emits these grouped items as
GroupedObservable
s.
<K,V> @NonNull Observable<GroupedObservable<K,V>>
groupBy(@NonNull Function<? super T,? extends K> keySelector, @NonNull Function<? super T,? extends V> valueSelector, boolean delayError)
Groups the items emitted by the current
Observable
according to a specified criterion, and emits these grouped items as
GroupedObservable
s.
<K,V> @NonNull Observable<GroupedObservable<K,V>>
groupBy(@NonNull Function<? super T,? extends K> keySelector, @NonNull Function<? super T,? extends V> valueSelector, boolean delayError, int bufferSize)
Groups the items emitted by the current
Observable
according to a specified criterion, and emits these grouped items as
GroupedObservable
s.
<TRight,TLeftEnd,TRightEnd,R>
@NonNull Observable<R>
groupJoin(@NonNull ObservableSource<? extends TRight> other, @NonNull Function<? super T,? extends ObservableSource<TLeftEnd>> leftEnd, @NonNull Function<? super TRight,? extends ObservableSource<TRightEnd>> rightEnd, @NonNull BiFunction<? super T,? super Observable<TRight>,? extends R> resultSelector)
Returns an
Observable
that correlates two
ObservableSource
s when they overlap in time and groups the results.
@NonNull Observable<T>
hide()
Hides the identity of the current
Observable
and its
Disposable
.
@NonNull Completable
ignoreElements()
Ignores all items emitted by the current Observable
and only calls onComplete
or onError
.
static @NonNull Observable<Long>
interval(long initialDelay, long period, @NonNull TimeUnit unit)
Returns an Observable
that emits a 0L
after the initialDelay
and ever increasing numbers after each period
of time thereafter.
static @NonNull Observable<Long>
interval(long initialDelay, long period, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits a
0L
after the
initialDelay
and ever increasing numbers after each
period
of time thereafter, on a specified
Scheduler
.
static @NonNull Observable<Long>
interval(long period, @NonNull TimeUnit unit)
Returns an Observable
that emits a sequential number every specified interval of time.
static @NonNull Observable<Long>
interval(long period, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits a sequential number every specified interval of time, on a specified
Scheduler
.
static @NonNull Observable<Long>
intervalRange(long start, long count, long initialDelay, long period, @NonNull TimeUnit unit)
Signals a range of long values, the first after some initial delay and the rest periodically after.
static @NonNull Observable<Long>
intervalRange(long start, long count, long initialDelay, long period, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Signals a range of long values, the first after some initial delay and the rest periodically after.
@NonNull Single<Boolean>
isEmpty()
Returns a
Single
that emits
true
if the current
Observable
is empty, otherwise
false
.
<TRight,TLeftEnd,TRightEnd,R>
@NonNull Observable<R>
join(@NonNull ObservableSource<? extends TRight> other, @NonNull Function<? super T,? extends ObservableSource<TLeftEnd>> leftEnd, @NonNull Function<? super TRight,? extends ObservableSource<TRightEnd>> rightEnd, @NonNull BiFunction<? super T,? super TRight,? extends R> resultSelector)
Correlates the items emitted by two
ObservableSource
s based on overlapping durations.
static <T> @NonNull Observable<T>
just(T item)
Returns an Observable
that signals the given (constant reference) item and then completes.
static <T> @NonNull Observable<T>
just(T item1, T item2)
Converts two items into an Observable
that emits those items.
static <T> @NonNull Observable<T>
just(T item1, T item2, T item3)
Converts three items into an Observable
that emits those items.
static <T> @NonNull Observable<T>
just(T item1, T item2, T item3, T item4)
Converts four items into an Observable
that emits those items.
static <T> @NonNull Observable<T>
just(T item1, T item2, T item3, T item4, T item5)
Converts five items into an Observable
that emits those items.
static <T> @NonNull Observable<T>
just(T item1, T item2, T item3, T item4, T item5, T item6)
Converts six items into an Observable
that emits those items.
static <T> @NonNull Observable<T>
just(T item1, T item2, T item3, T item4, T item5, T item6, T item7)
Converts seven items into an Observable
that emits those items.
static <T> @NonNull Observable<T>
just(T item1, T item2, T item3, T item4, T item5, T item6, T item7, T item8)
Converts eight items into an Observable
that emits those items.
static <T> @NonNull Observable<T>
just(T item1, T item2, T item3, T item4, T item5, T item6, T item7, T item8, T item9)
Converts nine items into an Observable
that emits those items.
static <T> @NonNull Observable<T>
just(T item1, T item2, T item3, T item4, T item5, T item6, T item7, T item8, T item9, T item10)
Converts ten items into an Observable
that emits those items.
@NonNull Single<T>
last(T defaultItem)
Returns a
Single
that emits only the last item emitted by the current
Observable
, or a default item if the current
Observable
completes without emitting any items.
@NonNull Maybe<T>
lastElement()
Returns a
Maybe
that emits the last item emitted by the current
Observable
or completes if the current
Observable
is empty.
@NonNull Single<T>
lastOrError()
Returns a
Single
that emits only the last item emitted by the current
Observable
or signals a
NoSuchElementException
if the current
Observable
is empty.
@NonNull CompletionStage<T>
lastOrErrorStage()
@NonNull CompletionStage<T>
lastStage(T defaultItem)
Signals the last upstream item (or the default item if the upstream is empty) via a
CompletionStage
.
<R> @NonNull Observable<R>
lift(@NonNull ObservableOperator<? extends R,? super T> lifter)
This method requires advanced knowledge about building operators, please consider other standard composition methods first;
Returns an
Observable
which, when subscribed to, invokes the
apply(Observer)
method of the provided
ObservableOperator
for each individual downstream
Observer
and allows the insertion of a custom operator by accessing the downstream's
Observer
during this subscription phase and providing a new
Observer
, containing the custom operator's intended business logic, that will be used in the subscription process going further upstream.
<R> @NonNull Observable<R>
map(@NonNull Function<? super T,? extends R> mapper)
Returns an Observable
that applies a specified function to each item emitted by the current Observable
and emits the results of these function applications.
<R> @NonNull Observable<R>
mapOptional(@NonNull Function<? super T,Optional<? extends R>> mapper)
Maps each upstream value into an
Optional
and emits the contained item if not empty.
@NonNull Observable<Notification<T>>
materialize()
Returns an
Observable
that represents all of the emissions
andnotifications from the current
Observable
into emissions marked with their original types within
Notification
objects.
static <T> @NonNull Observable<T>
merge(@NonNull Iterable<? extends ObservableSource<? extends T>> sources)
static <T> @NonNull Observable<T>
merge(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, int maxConcurrency)
Flattens an
Iterable
of
ObservableSource
s into one
Observable
, without any transformation, while limiting the number of concurrent subscriptions to these
ObservableSource
s.
static <T> @NonNull Observable<T>
merge(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, int maxConcurrency, int bufferSize)
Flattens an
Iterable
of
ObservableSource
s into one
Observable
, without any transformation, while limiting the number of concurrent subscriptions to these
ObservableSource
s.
static <T> @NonNull Observable<T>
merge(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources)
Flattens an
ObservableSource
that emits
ObservableSource
s into a single
Observable
that emits the items emitted by those
ObservableSource
s, without any transformation.
static <T> @NonNull Observable<T>
merge(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources, int maxConcurrency)
Flattens an
ObservableSource
that emits
ObservableSource
s into a single
Observable
that emits the items emitted by those
ObservableSource
s, without any transformation, while limiting the maximum number of concurrent subscriptions to these
ObservableSource
s.
static <T> @NonNull Observable<T>
merge(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2)
Flattens two
ObservableSource
s into a single
Observable
, without any transformation.
static <T> @NonNull Observable<T>
merge(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2, @NonNull ObservableSource<? extends T> source3)
Flattens three
ObservableSource
s into a single
Observable
, without any transformation.
static <T> @NonNull Observable<T>
merge(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2, @NonNull ObservableSource<? extends T> source3, @NonNull ObservableSource<? extends T> source4)
Flattens four
ObservableSource
s into a single
Observable
, without any transformation.
static <T> @NonNull Observable<T>
mergeArray(int maxConcurrency, int bufferSize, ObservableSource<? extends T>... sources)
Flattens an array of
ObservableSource
s into one
Observable
, without any transformation, while limiting the number of concurrent subscriptions to these
ObservableSource
s.
static <T> @NonNull Observable<T>
mergeArray(ObservableSource<? extends T>... sources)
Flattens an array of
ObservableSource
s into one
Observable
, without any transformation.
static <T> @NonNull Observable<T>
mergeArrayDelayError(int maxConcurrency, int bufferSize, ObservableSource<? extends T>... sources)
Flattens an array of
ObservableSource
s into one
Observable
, in a way that allows an
Observer
to receive all successfully emitted items from each of the
ObservableSource
s without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to these
ObservableSource
s.
static <T> @NonNull Observable<T>
mergeArrayDelayError(ObservableSource<? extends T>... sources)
Flattens an array of
ObservableSource
s into one
Observable
, in a way that allows an
Observer
to receive all successfully emitted items from each of the
ObservableSource
s without being interrupted by an error notification from one of them.
static <T> @NonNull Observable<T>
mergeDelayError(@NonNull Iterable<? extends ObservableSource<? extends T>> sources)
Flattens an
Iterable
of
ObservableSource
s into one
Observable
, in a way that allows an
Observer
to receive all successfully emitted items from each of the returned
ObservableSource
s without being interrupted by an error notification from one of them.
static <T> @NonNull Observable<T>
mergeDelayError(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, int maxConcurrency)
Flattens an
Iterable
of
ObservableSource
s into one
Observable
, in a way that allows an
Observer
to receive all successfully emitted items from each of the returned
ObservableSource
s without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to these
ObservableSource
s.
static <T> @NonNull Observable<T>
mergeDelayError(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, int maxConcurrency, int bufferSize)
Flattens an
Iterable
of
ObservableSource
s into one
Observable
, in a way that allows an
Observer
to receive all successfully emitted items from each of the returned
ObservableSource
s without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to these
ObservableSource
s.
static <T> @NonNull Observable<T>
mergeDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources)
Flattens an
ObservableSource
that emits
ObservableSource
s into one
Observable
, in a way that allows an
Observer
to receive all successfully emitted items from all of the emitted
ObservableSource
s without being interrupted by an error notification from one of them.
static <T> @NonNull Observable<T>
mergeDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources, int maxConcurrency)
Flattens an
ObservableSource
that emits
ObservableSource
s into one
Observable
, in a way that allows an
Observer
to receive all successfully emitted items from all of the emitted
ObservableSource
s without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to these
ObservableSource
s.
static <T> @NonNull Observable<T>
mergeDelayError(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2)
Flattens two
ObservableSource
s into one
Observable
, in a way that allows an
Observer
to receive all successfully emitted items from each of the
ObservableSource
s without being interrupted by an error notification from one of them.
static <T> @NonNull Observable<T>
mergeDelayError(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2, @NonNull ObservableSource<? extends T> source3)
Flattens three
ObservableSource
s into one
Observable
, in a way that allows an
Observer
to receive all successfully emitted items from all of the
ObservableSource
s without being interrupted by an error notification from one of them.
static <T> @NonNull Observable<T>
mergeDelayError(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2, @NonNull ObservableSource<? extends T> source3, @NonNull ObservableSource<? extends T> source4)
Flattens four
ObservableSource
s into one
Observable
, in a way that allows an
Observer
to receive all successfully emitted items from all of the
ObservableSource
s without being interrupted by an error notification from one of them.
@NonNull Observable<T>
mergeWith(@NonNull CompletableSource other)
Relays the items of the current
Observable
and completes only when the other
CompletableSource
completes as well.
@NonNull Observable<T>
mergeWith(@NonNull MaybeSource<? extends T> other)
Merges the sequence of items of the current
Observable
with the success value of the other
MaybeSource
or waits both to complete normally if the
MaybeSource
is empty.
@NonNull Observable<T>
mergeWith(@NonNull ObservableSource<? extends T> other)
Flattens the current
Observable
and another
ObservableSource
into a single
Observable
sequence, without any transformation.
@NonNull Observable<T>
mergeWith(@NonNull SingleSource<? extends T> other)
Merges the sequence of items of the current
Observable
with the success value of the other
SingleSource
.
static <T> @NonNull Observable<T>
never()
Returns an
Observable
that never sends any items or notifications to an
Observer
.
@NonNull Observable<T>
observeOn(@NonNull Scheduler scheduler)
Returns an
Observable
to perform the current
Observable
's emissions and notifications on a specified
Scheduler
, asynchronously with an unbounded buffer with
Flowable.bufferSize()
"island size".
@NonNull Observable<T>
observeOn(@NonNull Scheduler scheduler, boolean delayError)
Returns an
Observable
to perform the current
Observable
's emissions and notifications on a specified
Scheduler
, asynchronously with an unbounded buffer with
Flowable.bufferSize()
"island size" and optionally delays
onError
notifications.
@NonNull Observable<T>
observeOn(@NonNull Scheduler scheduler, boolean delayError, int bufferSize)
Returns an
Observable
to perform the current
Observable
's emissions and notifications on a specified
Scheduler
, asynchronously with an unbounded buffer of configurable "island size" and optionally delays
onError
notifications.
<U> @NonNull Observable<U>
ofType(@NonNull Class<U> clazz)
Filters the items emitted by the current Observable
, only emitting those of the specified type.
@NonNull Observable<T>
onErrorComplete()
Returns an Observable
instance that if the current Observable
emits an error, it will emit an onComplete
and swallow the throwable.
@NonNull Observable<T>
onErrorComplete(@NonNull Predicate<? super Throwable> predicate)
Returns an Observable
instance that if the current Observable
emits an error and the predicate returns true
, it will emit an onComplete
and swallow the throwable.
@NonNull Observable<T>
onErrorResumeNext(@NonNull Function<? super Throwable,? extends ObservableSource<? extends T>> fallbackSupplier)
Resumes the flow with an
ObservableSource
returned for the failure
Throwable
of the current
Observable
by a function instead of signaling the error via
onError
.
@NonNull Observable<T>
onErrorResumeWith(@NonNull ObservableSource<? extends T> fallback)
Resumes the flow with the given
ObservableSource
when the current
Observable
fails instead of signaling the error via
onError
.
@NonNull Observable<T>
onErrorReturn(@NonNull Function<? super Throwable,? extends T> itemSupplier)
Ends the flow with a last item returned by a function for the
Throwable
error signaled by the current
Observable
instead of signaling the error via
onError
.
@NonNull Observable<T>
onErrorReturnItem(T item)
Ends the flow with the given last item when the current Observable
fails instead of signaling the error via onError
.
@NonNull Observable<T>
onTerminateDetach()
Nulls out references to the upstream producer and downstream
Observer
if the sequence is terminated or downstream calls
dispose()
.
@NonNull ConnectableObservable<T>
publish()
<R> @NonNull Observable<R>
publish(@NonNull Function<? super Observable<T>,? extends ObservableSource<R>> selector)
Returns an
Observable
that emits the results of invoking a specified selector on items emitted by a
ConnectableObservable
that shares a single subscription to the current
Observable
sequence.
static @NonNull Observable<Integer>
range(int start, int count)
Returns an
Observable
that emits a sequence of
Integer
s within a specified range.
static @NonNull Observable<Long>
rangeLong(long start, long count)
Returns an
Observable
that emits a sequence of
Long
s within a specified range.
@NonNull Maybe<T>
reduce(@NonNull BiFunction<T,T,T> reducer)
Returns a
Maybe
that applies a specified accumulator function to the first item emitted by the current
Observable
, then feeds the result of that function along with the second item emitted by the current
Observable
into the same function, and so on until all items have been emitted by the current and finite
Observable
, and emits the final result from the final call to your function as its sole item.
<R> @NonNull Single<R>
reduce(R seed, @NonNull BiFunction<R,? super T,R> reducer)
Returns a
Single
that applies a specified accumulator function to the first item emitted by the current
Observable
and a specified seed value, then feeds the result of that function along with the second item emitted by the current
Observable
into the same function, and so on until all items have been emitted by the current and finite
Observable
, emitting the final result from the final call to your function as its sole item.
<R> @NonNull Single<R>
reduceWith(@NonNull Supplier<R> seedSupplier, @NonNull BiFunction<R,? super T,R> reducer)
Returns a
Single
that applies a specified accumulator function to the first item emitted by the current
Observable
and a seed value derived from calling a specified
seedSupplier
, then feeds the result of that function along with the second item emitted by the current
Observable
into the same function, and so on until all items have been emitted by the current and finite
Observable
, emitting the final result from the final call to your function as its sole item.
@NonNull Observable<T>
repeat()
Returns an Observable
that repeats the sequence of items emitted by the current Observable
indefinitely.
@NonNull Observable<T>
repeat(long times)
Returns an Observable
that repeats the sequence of items emitted by the current Observable
at most count
times.
@NonNull Observable<T>
repeatUntil(@NonNull BooleanSupplier stop)
Returns an Observable
that repeats the sequence of items emitted by the current Observable
until the provided stop function returns true
.
@NonNull Observable<T>
repeatWhen(@NonNull Function<? super Observable<Object>,? extends ObservableSource<?>> handler)
Returns an Observable
that emits the same values as the current Observable
with the exception of an onComplete
.
@NonNull ConnectableObservable<T>
replay()
Returns a
ConnectableObservable
that shares a single subscription to the current
Observable
that will replay all of its items and notifications to any future
Observer
.
<R> @NonNull Observable<R>
replay(@NonNull Function<? super Observable<T>,? extends ObservableSource<R>> selector)
Returns an
Observable
that emits items that are the results of invoking a specified selector on the items emitted by a
ConnectableObservable
that shares a single subscription to the current
Observable
.
<R> @NonNull Observable<R>
replay(@NonNull Function<? super Observable<T>,? extends ObservableSource<R>> selector, int bufferSize)
Returns an
Observable
that emits items that are the results of invoking a specified selector on items emitted by a
ConnectableObservable
that shares a single subscription to the current
Observable
, replaying
bufferSize
notifications.
<R> @NonNull Observable<R>
replay(@NonNull Function<? super Observable<T>,? extends ObservableSource<R>> selector, int bufferSize, boolean eagerTruncate)
Returns an
Observable
that emits items that are the results of invoking a specified selector on items emitted by a
ConnectableObservable
that shares a single subscription to the current
Observable
, replaying
bufferSize
notifications.
<R> @NonNull Observable<R>
replay(@NonNull Function<? super Observable<T>,? extends ObservableSource<R>> selector, int bufferSize, long time, @NonNull TimeUnit unit)
Returns an
Observable
that emits items that are the results of invoking a specified selector on items emitted by a
ConnectableObservable
that shares a single subscription to the current
Observable
, replaying no more than
bufferSize
items that were emitted within a specified time window.
<R> @NonNull Observable<R>
replay(@NonNull Function<? super Observable<T>,? extends ObservableSource<R>> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits items that are the results of invoking a specified selector on items emitted by a
ConnectableObservable
that shares a single subscription to the current
Observable
, replaying no more than
bufferSize
items that were emitted within a specified time window.
<R> @NonNull Observable<R>
replay(@NonNull Function<? super Observable<T>,? extends ObservableSource<R>> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate)
Returns an
Observable
that emits items that are the results of invoking a specified selector on items emitted by a
ConnectableObservable
that shares a single subscription to the current
Observable
, replaying no more than
bufferSize
items that were emitted within a specified time window.
<R> @NonNull Observable<R>
replay(@NonNull Function<? super Observable<T>,? extends ObservableSource<R>> selector, long time, @NonNull TimeUnit unit)
Returns an
Observable
that emits items that are the results of invoking a specified selector on items emitted by a
ConnectableObservable
that shares a single subscription to the current
Observable
, replaying all items that were emitted within a specified time window.
<R> @NonNull Observable<R>
replay(@NonNull Function<? super Observable<T>,? extends ObservableSource<R>> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits items that are the results of invoking a specified selector on items emitted by a
ConnectableObservable
that shares a single subscription to the current
Observable
, replaying all items that were emitted within a specified time window.
<R> @NonNull Observable<R>
replay(@NonNull Function<? super Observable<T>,? extends ObservableSource<R>> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate)
Returns an
Observable
that emits items that are the results of invoking a specified selector on items emitted by a
ConnectableObservable
that shares a single subscription to the current
Observable
, replaying all items that were emitted within a specified time window.
@NonNull ConnectableObservable<T>
replay(int bufferSize)
Returns a
ConnectableObservable
that shares a single subscription to the current
Observable
that replays at most
bufferSize
items emitted by the current
Observable
.
@NonNull ConnectableObservable<T>
replay(int bufferSize, boolean eagerTruncate)
Returns a
ConnectableObservable
that shares a single subscription to the current
Observable
that replays at most
bufferSize
items emitted by the current
Observable
.
@NonNull ConnectableObservable<T>
replay(int bufferSize, long time, @NonNull TimeUnit unit)
Returns a
ConnectableObservable
that shares a single subscription to the current
Observable
and replays at most
bufferSize
items that were emitted during a specified time window.
@NonNull ConnectableObservable<T>
replay(int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns a
ConnectableObservable
that shares a single subscription to the current
Observable
and that replays a maximum of
bufferSize
items that are emitted within a specified time window.
@NonNull ConnectableObservable<T>
replay(int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate)
Returns a
ConnectableObservable
that shares a single subscription to the current
Observable
and that replays a maximum of
bufferSize
items that are emitted within a specified time window.
@NonNull ConnectableObservable<T>
replay(long time, @NonNull TimeUnit unit)
Returns a
ConnectableObservable
that shares a single subscription to the current
Observable
and replays all items emitted by the current
Observable
within a specified time window.
@NonNull ConnectableObservable<T>
replay(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns a
ConnectableObservable
that shares a single subscription to the current
Observable
and replays all items emitted by the current
Observable
within a specified time window.
@NonNull ConnectableObservable<T>
replay(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate)
Returns a
ConnectableObservable
that shares a single subscription to the current
Observable
and replays all items emitted by the current
Observable
within a specified time window.
@NonNull Observable<T>
retry()
Returns an Observable
that mirrors the current Observable
, resubscribing to it if it calls onError
(infinite retry count).
@NonNull Observable<T>
retry(@NonNull BiPredicate<? super Integer,? super Throwable> predicate)
Returns an Observable
that mirrors the current Observable
, resubscribing to it if it calls onError
and the predicate returns true
for that specific exception and retry count.
@NonNull Observable<T>
retry(long times)
Returns an Observable
that mirrors the current Observable
, resubscribing to it if it calls onError
up to a specified number of retries.
@NonNull Observable<T>
retry(long times, @NonNull Predicate<? super Throwable> predicate)
Retries at most times or until the predicate returns false
, whichever happens first.
@NonNull Observable<T>
retry(@NonNull Predicate<? super Throwable> predicate)
Retries the current Observable
if the predicate returns true
.
@NonNull Observable<T>
retryUntil(@NonNull BooleanSupplier stop)
Retries until the given stop function returns true
.
@NonNull Observable<T>
retryWhen(@NonNull Function<? super Observable<Throwable>,? extends ObservableSource<?>> handler)
Returns an Observable
that emits the same values as the current Observable
with the exception of an onError
.
void
safeSubscribe(@NonNull Observer<? super T> observer)
Subscribes to the current
Observable
and wraps the given
Observer
into a
SafeObserver
(if not already a
SafeObserver
) that deals with exceptions thrown by a misbehaving
Observer
(that doesn't follow the
Reactive Streamsspecification).
@NonNull Observable<T>
sample(long period, @NonNull TimeUnit unit)
Returns an Observable
that emits the most recently emitted item (if any) emitted by the current Observable
within periodic time intervals.
@NonNull Observable<T>
sample(long period, @NonNull TimeUnit unit, boolean emitLast)
Returns an Observable
that emits the most recently emitted item (if any) emitted by the current Observable
within periodic time intervals and optionally emit the very last upstream item when the upstream completes.
@NonNull Observable<T>
sample(long period, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits the most recently emitted item (if any) emitted by the current
Observable
within periodic time intervals, where the intervals are defined on a particular
Scheduler
.
@NonNull Observable<T>
sample(long period, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean emitLast)
Returns an
Observable
that emits the most recently emitted item (if any) emitted by the current
Observable
within periodic time intervals, where the intervals are defined on a particular
Scheduler
and optionally emit the very last upstream item when the upstream completes.
@NonNull Observable<T>
sample(long period, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean emitLast, @NonNull Consumer<? super T> onDropped)
Returns an
Observable
that emits the most recently emitted item (if any) emitted by the current
Observable
within periodic time intervals, where the intervals are defined on a particular
Scheduler
.
<U> @NonNull Observable<T>
sample(@NonNull ObservableSource<U> sampler)
Returns an
Observable
that, when the specified
sampler
ObservableSource
emits an item or completes, emits the most recently emitted item (if any) emitted by the current
Observable
since the previous emission from the
sampler
ObservableSource
.
<U> @NonNull Observable<T>
sample(@NonNull ObservableSource<U> sampler, boolean emitLast)
Returns an
Observable
that, when the specified
sampler
ObservableSource
emits an item or completes, emits the most recently emitted item (if any) emitted by the current
Observable
since the previous emission from the
sampler
ObservableSource
and optionally emit the very last upstream item when the upstream or other
ObservableSource
complete.
@NonNull Observable<T>
scan(@NonNull BiFunction<T,T,T> accumulator)
Returns an Observable
that emits the first value emitted by the current Observable
, then emits one value for each subsequent value emitted by the current Observable
.
<R> @NonNull Observable<R>
scan(R initialValue, @NonNull BiFunction<R,? super T,R> accumulator)
Returns an Observable
that emits the provided initial (seed) value, then emits one value for each value emitted by the current Observable
.
<R> @NonNull Observable<R>
scanWith(@NonNull Supplier<R> seedSupplier, @NonNull BiFunction<R,? super T,R> accumulator)
Returns an Observable
that emits the provided initial (seed) value, then emits one value for each value emitted by the current Observable
.
static <T> @NonNull Single<Boolean>
sequenceEqual(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2)
Returns a
Single
that emits a
Boolean
value that indicates whether two
ObservableSource
sequences are the same by comparing the items emitted by each
ObservableSource
pairwise.
static <T> @NonNull Single<Boolean>
sequenceEqual(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2, @NonNull BiPredicate<? super T,? super T> isEqual)
Returns a
Single
that emits a
Boolean
value that indicates whether two
ObservableSource
sequences are the same by comparing the items emitted by each
ObservableSource
pairwise based on the results of a specified equality function.
static <T> @NonNull Single<Boolean>
sequenceEqual(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2, @NonNull BiPredicate<? super T,? super T> isEqual, int bufferSize)
Returns a
Single
that emits a
Boolean
value that indicates whether two
ObservableSource
sequences are the same by comparing the items emitted by each
ObservableSource
pairwise based on the results of a specified equality function.
static <T> @NonNull Single<Boolean>
sequenceEqual(@NonNull ObservableSource<? extends T> source1, @NonNull ObservableSource<? extends T> source2, int bufferSize)
Returns a
Single
that emits a
Boolean
value that indicates whether two
ObservableSource
sequences are the same by comparing the items emitted by each
ObservableSource
pairwise.
@NonNull Observable<T>
serialize()
@NonNull Observable<T>
share()
Returns a new Observable
that multicasts (and shares a single subscription to) the current Observable
.
@NonNull Single<T>
single(T defaultItem)
Returns a
Single
that emits the single item emitted by the current
Observable
, if the current
Observable
emits only a single item, or a default item if the current
Observable
emits no items.
@NonNull Maybe<T>
singleElement()
Returns a
Maybe
that completes if the current
Observable
is empty or emits the single item emitted by the current
Observable
, or signals an
IllegalArgumentException
if the current
Observable
emits more than one item.
@NonNull Single<T>
singleOrError()
Returns a
Single
that emits the single item emitted by the current
Observable
if it emits only a single item, otherwise if the current
Observable
completes without emitting any items or emits more than one item a
NoSuchElementException
or
IllegalArgumentException
will be signaled respectively.
@NonNull CompletionStage<T>
singleOrErrorStage()
@NonNull CompletionStage<T>
singleStage(T defaultItem)
@NonNull Observable<T>
skip(long count)
Returns an Observable
that skips the first count
items emitted by the current Observable
and emits the remainder.
@NonNull Observable<T>
skip(long time, @NonNull TimeUnit unit)
Returns an Observable
that skips values emitted by the current Observable
before a specified time window elapses.
@NonNull Observable<T>
skip(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that skips values emitted by the current
Observable
before a specified time window on a specified
Scheduler
elapses.
@NonNull Observable<T>
skipLast(int count)
Returns an Observable
that drops a specified number of items from the end of the sequence emitted by the current Observable
.
@NonNull Observable<T>
skipLast(long time, @NonNull TimeUnit unit)
Returns an Observable
that drops items emitted by the current Observable
during a specified time window before the source completes.
@NonNull Observable<T>
skipLast(long time, @NonNull TimeUnit unit, boolean delayError)
Returns an Observable
that drops items emitted by the current Observable
during a specified time window before the source completes.
@NonNull Observable<T>
skipLast(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an Observable
that drops items emitted by the current Observable
during a specified time window (defined on a specified scheduler) before the source completes.
@NonNull Observable<T>
skipLast(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError)
Returns an Observable
that drops items emitted by the current Observable
during a specified time window (defined on a specified scheduler) before the source completes.
@NonNull Observable<T>
skipLast(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError, int bufferSize)
Returns an Observable
that drops items emitted by the current Observable
during a specified time window (defined on a specified scheduler) before the source completes.
<U> @NonNull Observable<T>
skipUntil(@NonNull ObservableSource<U> other)
Returns an
Observable
that skips items emitted by the current
Observable
until a second
ObservableSource
emits an item.
@NonNull Observable<T>
skipWhile(@NonNull Predicate<? super T> predicate)
Returns an Observable
that skips all items emitted by the current Observable
as long as a specified condition holds true
, but emits all further source items as soon as the condition becomes false
.
@NonNull Observable<T>
sorted()
Returns an Observable
that emits the events emitted by the current Observable
, in a sorted order.
@NonNull Observable<T>
sorted(@NonNull Comparator<? super T> comparator)
Returns an Observable
that emits the events emitted by the current Observable
, in a sorted order based on a specified comparison function.
@NonNull Observable<T>
startWith(@NonNull CompletableSource other)
Returns an
Observable
which first runs the other
CompletableSource
then the current
Observable
if the other completed normally.
@NonNull Observable<T>
startWith(@NonNull MaybeSource<T> other)
Returns an
Observable
which first runs the other
MaybeSource
then the current
Observable
if the other succeeded or completed normally.
@NonNull Observable<T>
startWith(@NonNull ObservableSource<? extends T> other)
Returns an
Observable
that emits the items in a specified
ObservableSource
before it begins to emit items emitted by the current
Observable
.
@NonNull Observable<T>
startWith(@NonNull SingleSource<T> other)
Returns an
Observable
which first runs the other
SingleSource
then the current
Observable
if the other succeeded normally.
@NonNull Observable<T>
startWithArray(T... items)
Returns an Observable
that emits the specified items before it begins to emit items emitted by the current Observable
.
@NonNull Observable<T>
startWithItem(T item)
Returns an Observable
that emits a specified item before it begins to emit items emitted by the current Observable
.
@NonNull Observable<T>
startWithIterable(@NonNull Iterable<? extends T> items)
Returns an
Observable
that emits the items in a specified
Iterable
before it begins to emit items emitted by the current
Observable
.
@NonNull Disposable
subscribe()
Subscribes to the current Observable
and ignores onNext
and onComplete
emissions.
@NonNull Disposable
subscribe(@NonNull Consumer<? super T> onNext)
Subscribes to the current Observable
and provides a callback to handle the items it emits.
@NonNull Disposable
subscribe(@NonNull Consumer<? super T> onNext, @NonNull Consumer<? super Throwable> onError)
Subscribes to the current Observable
and provides callbacks to handle the items it emits and any error notification it signals.
@NonNull Disposable
subscribe(@NonNull Consumer<? super T> onNext, @NonNull Consumer<? super Throwable> onError, @NonNull Action onComplete)
Subscribes to the current Observable
and provides callbacks to handle the items it emits and any error or completion notification it signals.
@NonNull Disposable
subscribe(@NonNull Consumer<? super T> onNext, @NonNull Consumer<? super Throwable> onError, @NonNull Action onComplete, @NonNull DisposableContainer container)
Wraps the given onXXX callbacks into a
Disposable
Observer
, adds it to the given
DisposableContainer
and ensures, that if the upstream terminates or this particular
Disposable
is disposed, the
Observer
is removed from the given container.
void
subscribe(@NonNull Observer<? super T> observer)
protected abstract void
subscribeActual(@NonNull Observer<? super T> observer)
Operator implementations (both source and intermediate) should implement this method that performs the necessary business logic and handles the incoming
Observer
s.
@NonNull Observable<T>
subscribeOn(@NonNull Scheduler scheduler)
Asynchronously subscribes
Observer
s to the current
Observable
on the specified
Scheduler
.
<E extends Observer<? super T>>
E
subscribeWith(E observer)
Subscribes a given
Observer
(subclass) to the current
Observable
and returns the given
Observer
instance as is.
@NonNull Observable<T>
switchIfEmpty(@NonNull ObservableSource<? extends T> other)
Returns an
Observable
that emits the items emitted by the current
Observable
or the items of an alternate
ObservableSource
if the current
Observable
is empty.
<R> @NonNull Observable<R>
switchMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper)
Returns a new
Observable
by applying a function that you supply to each item emitted by the current
Observable
that returns an
ObservableSource
, and then emitting the items emitted by the most recently emitted of these
ObservableSource
s.
<R> @NonNull Observable<R>
switchMap(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, int bufferSize)
Returns a new
Observable
by applying a function that you supply to each item emitted by the current
Observable
that returns an
ObservableSource
, and then emitting the items emitted by the most recently emitted of these
ObservableSource
s.
@NonNull Completable
switchMapCompletable(@NonNull Function<? super T,? extends CompletableSource> mapper)
Maps the items of the current
Observable
into
CompletableSource
s, subscribes to the newer one while disposing the subscription to the previous
CompletableSource
, thus keeping at most one active
CompletableSource
running.
@NonNull Completable
switchMapCompletableDelayError(@NonNull Function<? super T,? extends CompletableSource> mapper)
Maps the upstream values into
CompletableSource
s, subscribes to the newer one while disposing the subscription to the previous
CompletableSource
, thus keeping at most one active
CompletableSource
running and delaying any main or inner errors until all of them terminate.
<R> @NonNull Observable<R>
switchMapDelayError(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper)
Returns a new
Observable
by applying a function that you supply to each item emitted by the current
Observable
that returns an
ObservableSource
, and then emitting the items emitted by the most recently emitted of these
ObservableSource
s and delays any error until all
ObservableSource
s terminate.
<R> @NonNull Observable<R>
switchMapDelayError(@NonNull Function<? super T,? extends ObservableSource<? extends R>> mapper, int bufferSize)
Returns a new
Observable
by applying a function that you supply to each item emitted by the current
Observable
that returns an
ObservableSource
, and then emitting the items emitted by the most recently emitted of these
ObservableSource
s and delays any error until all
ObservableSource
s terminate.
<R> @NonNull Observable<R>
switchMapMaybe(@NonNull Function<? super T,? extends MaybeSource<? extends R>> mapper)
Maps the items of the current
Observable
into
MaybeSource
s and switches (subscribes) to the newer ones while disposing the older ones (and ignoring their signals) and emits the latest success value of the current one if available while failing immediately if the current
Observable
or any of the active inner
MaybeSource
s fail.
<R> @NonNull Observable<R>
switchMapMaybeDelayError(@NonNull Function<? super T,? extends MaybeSource<? extends R>> mapper)
Maps the upstream items into
MaybeSource
s and switches (subscribes) to the newer ones while disposing the older ones (and ignoring their signals) and emits the latest success value of the current one if available, delaying errors from the current
Observable
or the inner
MaybeSource
s until all terminate.
<R> @NonNull Observable<R>
switchMapSingle(@NonNull Function<? super T,? extends SingleSource<? extends R>> mapper)
Returns a new
Observable
by applying a function that you supply to each item emitted by the current
Observable
that returns a
SingleSource
, and then emitting the item emitted by the most recently emitted of these
SingleSource
s.
<R> @NonNull Observable<R>
switchMapSingleDelayError(@NonNull Function<? super T,? extends SingleSource<? extends R>> mapper)
Returns a new
Observable
by applying a function that you supply to each item emitted by the current
Observable
that returns a
SingleSource
, and then emitting the item emitted by the most recently emitted of these
SingleSource
s and delays any error until all
SingleSource
s terminate.
static <T> @NonNull Observable<T>
switchOnNext(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources)
Converts an
ObservableSource
that emits
ObservableSource
s into an
Observable
that emits the items emitted by the most recently emitted of those
ObservableSource
s.
static <T> @NonNull Observable<T>
switchOnNext(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources, int bufferSize)
Converts an
ObservableSource
that emits
ObservableSource
s into an
Observable
that emits the items emitted by the most recently emitted of those
ObservableSource
s.
static <T> @NonNull Observable<T>
switchOnNextDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources)
Converts an
ObservableSource
that emits
ObservableSource
s into an
Observable
that emits the items emitted by the most recently emitted of those
ObservableSource
s and delays any exception until all
ObservableSource
s terminate.
static <T> @NonNull Observable<T>
switchOnNextDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends T>> sources, int bufferSize)
Converts an
ObservableSource
that emits
ObservableSource
s into an
Observable
that emits the items emitted by the most recently emitted of those
ObservableSource
s and delays any exception until all
ObservableSource
s terminate.
@NonNull Observable<T>
take(long count)
Returns an Observable
that emits only the first count
items emitted by the current Observable
.
@NonNull Observable<T>
take(long time, @NonNull TimeUnit unit)
Returns an Observable
that emits those items emitted by the current Observable
before a specified time runs out.
@NonNull Observable<T>
take(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits those items emitted by the current
Observable
before a specified time (on a specified
Scheduler
) runs out.
@NonNull Observable<T>
takeLast(int count)
Returns an Observable
that emits at most the last count
items emitted by the current Observable
.
@NonNull Observable<T>
takeLast(long count, long time, @NonNull TimeUnit unit)
Returns an Observable
that emits at most a specified number of items from the current Observable
that were emitted in a specified window of time before the current Observable
completed.
@NonNull Observable<T>
takeLast(long count, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits at most a specified number of items from the current
Observable
that were emitted in a specified window of time before the current
Observable
completed, where the timing information is provided by a given
Scheduler
.
@NonNull Observable<T>
takeLast(long count, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError, int bufferSize)
Returns an
Observable
that emits at most a specified number of items from the current
Observable
that were emitted in a specified window of time before the current
Observable
completed, where the timing information is provided by a given
Scheduler
.
@NonNull Observable<T>
takeLast(long time, @NonNull TimeUnit unit)
Returns an Observable
that emits the items from the current Observable
that were emitted in a specified window of time before the current Observable
completed.
@NonNull Observable<T>
takeLast(long time, @NonNull TimeUnit unit, boolean delayError)
Returns an Observable
that emits the items from the current Observable
that were emitted in a specified window of time before the current Observable
completed.
@NonNull Observable<T>
takeLast(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits the items from the current
Observable
that were emitted in a specified window of time before the current
Observable
completed, where the timing information is provided by a specified
Scheduler
.
@NonNull Observable<T>
takeLast(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError)
Returns an
Observable
that emits the items from the current
Observable
that were emitted in a specified window of time before the current
Observable
completed, where the timing information is provided by a specified
Scheduler
.
@NonNull Observable<T>
takeLast(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError, int bufferSize)
Returns an
Observable
that emits the items from the current
Observable
that were emitted in a specified window of time before the current
Observable
completed, where the timing information is provided by a specified
Scheduler
.
<U> @NonNull Observable<T>
takeUntil(@NonNull ObservableSource<U> other)
Returns an
Observable
that emits the items emitted by the current
Observable
until a second
ObservableSource
emits an item or completes.
@NonNull Observable<T>
takeUntil(@NonNull Predicate<? super T> stopPredicate)
Returns an Observable
that emits items emitted by the current Observable
, checks the specified predicate for each item, and then completes when the condition is satisfied.
@NonNull Observable<T>
takeWhile(@NonNull Predicate<? super T> predicate)
Returns an Observable
that emits items emitted by the current Observable
so long as each item satisfied a specified condition, and then completes as soon as this condition is not satisfied.
@NonNull TestObserver<T>
test()
Creates a
TestObserver
and subscribes it to the current
Observable
.
@NonNull TestObserver<T>
test(boolean dispose)
Creates a
TestObserver
, optionally disposes it and then subscribes it to the current
Observable
.
@NonNull Observable<T>
throttleFirst(long windowDuration, @NonNull TimeUnit unit)
Returns an Observable
that emits only the first item emitted by the current Observable
during sequential time windows of a specified duration.
@NonNull Observable<T>
throttleFirst(long skipDuration, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits only the first item emitted by the current
Observable
during sequential time windows of a specified duration, where the windows are managed by a specified
Scheduler
.
@NonNull Observable<T>
throttleFirst(long skipDuration, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Consumer<? super T> onDropped)
Returns an
Observable
that emits only the first item emitted by the current
Observable
during sequential time windows of a specified duration, where the windows are managed by a specified
Scheduler
.
@NonNull Observable<T>
throttleLast(long intervalDuration, @NonNull TimeUnit unit)
Returns an Observable
that emits only the last item emitted by the current Observable
during sequential time windows of a specified duration.
@NonNull Observable<T>
throttleLast(long intervalDuration, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits only the last item emitted by the current
Observable
during sequential time windows of a specified duration, where the duration is governed by a specified
Scheduler
.
@NonNull Observable<T>
throttleLast(long intervalDuration, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Consumer<? super T> onDropped)
Returns an
Observable
that emits only the last item emitted by the current
Observable
during sequential time windows of a specified duration, where the duration is governed by a specified
Scheduler
.
@NonNull Observable<T>
throttleLatest(long timeout, @NonNull TimeUnit unit)
Throttles items from the current Observable
by first emitting the next item from upstream, then periodically emitting the latest item (if any) when the specified timeout elapses between them.
@NonNull Observable<T>
throttleLatest(long timeout, @NonNull TimeUnit unit, boolean emitLast)
Throttles items from the current Observable
by first emitting the next item from upstream, then periodically emitting the latest item (if any) when the specified timeout elapses between them.
@NonNull Observable<T>
throttleLatest(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Throttles items from the current Observable
by first emitting the next item from upstream, then periodically emitting the latest item (if any) when the specified timeout elapses between them.
@NonNull Observable<T>
throttleLatest(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean emitLast)
Throttles items from the current Observable
by first emitting the next item from upstream, then periodically emitting the latest item (if any) when the specified timeout elapses between them.
@NonNull Observable<T>
throttleLatest(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean emitLast, @NonNull Consumer<? super T> onDropped)
Throttles items from the current Observable
by first emitting the next item from upstream, then periodically emitting the latest item (if any) when the specified timeout elapses between them, invoking the consumer for any dropped item.
@NonNull Observable<T>
throttleWithTimeout(long timeout, @NonNull TimeUnit unit)
Returns an Observable
that mirrors the current Observable
, except that it drops items emitted by the current Observable
that are followed by newer items before a timeout value expires.
@NonNull Observable<T>
throttleWithTimeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that mirrors the current
Observable
, except that it drops items emitted by the current
Observable
that are followed by newer items before a timeout value expires on a specified
Scheduler
.
@NonNull Observable<T>
throttleWithTimeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Consumer<? super T> onDropped)
Returns an
Observable
that mirrors the current
Observable
, except that it drops items emitted by the current
Observable
that are followed by newer items before a timeout value expires on a specified
Scheduler
.
@NonNull Observable<Timed<T>>
timeInterval()
Returns an Observable
that emits records of the time interval between consecutive items emitted by the current Observable
.
@NonNull Observable<Timed<T>>
timeInterval(@NonNull Scheduler scheduler)
Returns an
Observable
that emits records of the time interval between consecutive items emitted by the current
Observable
, where this interval is computed on a specified
Scheduler
.
@NonNull Observable<Timed<T>>
timeInterval(@NonNull TimeUnit unit)
Returns an Observable
that emits records of the time interval between consecutive items emitted by the current Observable
.
@NonNull Observable<Timed<T>>
timeInterval(@NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits records of the time interval between consecutive items emitted by the current
Observable
, where this interval is computed on a specified
Scheduler
.
<V> @NonNull Observable<T>
timeout(@NonNull Function<? super T,? extends ObservableSource<V>> itemTimeoutIndicator)
Returns an
Observable
that mirrors the current
Observable
, but notifies observers of a
TimeoutException
if an item emitted by the current
Observable
doesn't arrive within a window of time after the emission of the previous item, where that period of time is measured by an
ObservableSource
that is a function of the previous item.
<V> @NonNull Observable<T>
timeout(@NonNull Function<? super T,? extends ObservableSource<V>> itemTimeoutIndicator, @NonNull ObservableSource<? extends T> fallback)
Returns an
Observable
that mirrors the current
Observable
, but that switches to a fallback
ObservableSource
if an item emitted by the current
Observable
doesn't arrive within a window of time after the emission of the previous item, where that period of time is measured by an
ObservableSource
that is a function of the previous item.
@NonNull Observable<T>
timeout(long timeout, @NonNull TimeUnit unit)
Returns an Observable
that mirrors the current Observable
but applies a timeout policy for each emitted item.
@NonNull Observable<T>
timeout(long timeout, @NonNull TimeUnit unit, @NonNull ObservableSource<? extends T> fallback)
Returns an Observable
that mirrors the current Observable
but applies a timeout policy for each emitted item.
@NonNull Observable<T>
timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that mirrors the current
Observable
but applies a timeout policy for each emitted item, where this policy is governed on a specified
Scheduler
.
@NonNull Observable<T>
timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull ObservableSource<? extends T> fallback)
Returns an
Observable
that mirrors the current
Observable
but applies a timeout policy for each emitted item using a specified
Scheduler
.
<U,V> @NonNull Observable<T>
timeout(@NonNull ObservableSource<U> firstTimeoutIndicator, @NonNull Function<? super T,? extends ObservableSource<V>> itemTimeoutIndicator)
Returns an
Observable
that mirrors the current
Observable
, but notifies observers of a
TimeoutException
if either the first item emitted by the current
Observable
or any subsequent item doesn't arrive within time windows defined by indicator
ObservableSource
s.
<U,V> @NonNull Observable<T>
timeout(@NonNull ObservableSource<U> firstTimeoutIndicator, @NonNull Function<? super T,? extends ObservableSource<V>> itemTimeoutIndicator, @NonNull ObservableSource<? extends T> fallback)
Returns an
Observable
that mirrors the current
Observable
, but switches to a fallback
ObservableSource
if either the first item emitted by the current
Observable
or any subsequent item doesn't arrive within time windows defined by indicator
ObservableSource
s.
static @NonNull Observable<Long>
timer(long delay, @NonNull TimeUnit unit)
Returns an Observable
that emits 0L
after a specified delay, and then completes.
static @NonNull Observable<Long>
timer(long delay, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits
0L
after a specified delay, on a specified
Scheduler
, and then completes.
@NonNull Observable<Timed<T>>
timestamp()
Returns an
Observable
that emits each item emitted by the current
Observable
, wrapped in a
Timed
object.
@NonNull Observable<Timed<T>>
timestamp(@NonNull Scheduler scheduler)
Returns an
Observable
that emits each item emitted by the current
Observable
, wrapped in a
Timed
object whose timestamps are provided by a specified
Scheduler
.
@NonNull Observable<Timed<T>>
timestamp(@NonNull TimeUnit unit)
Returns an
Observable
that emits each item emitted by the current
Observable
, wrapped in a
Timed
object.
@NonNull Observable<Timed<T>>
timestamp(@NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an
Observable
that emits each item emitted by the current
Observable
, wrapped in a
Timed
object whose timestamps are provided by a specified
Scheduler
.
<R> R
to(@NonNull ObservableConverter<T,? extends R> converter)
Calls the specified converter function during assembly time and returns its resulting value.
@NonNull Flowable<T>
toFlowable(@NonNull BackpressureStrategy strategy)
Converts the current
Observable
into a
Flowable
by applying the specified backpressure strategy.
@NonNull Future<T>
toFuture()
Returns a
Future
representing the only value emitted by the current
Observable
.
@NonNull Single<List<T>>
toList()
Returns a
Single
that emits a single item, a
List
composed of all the items emitted by the current and finite
Observable
.
@NonNull Single<List<T>>
toList(int capacityHint)
Returns a
Single
that emits a single item, a
List
composed of all the items emitted by the current and finite
Observable
.
<U extends Collection<? super T>>
@NonNull Single<U>
toList(@NonNull Supplier<U> collectionSupplier)
Returns a
Single
that emits a single item, a
Collection
(subclass) composed of all the items emitted by the finite upstream
Observable
.
<K> @NonNull Single<Map<K,T>>
toMap(@NonNull Function<? super T,? extends K> keySelector)
Returns a
Single
that emits a single
HashMap
containing all items emitted by the current and finite
Observable
, mapped by the keys returned by a specified
keySelector
function.
<K,V> @NonNull Single<Map<K,V>>
toMap(@NonNull Function<? super T,? extends K> keySelector, @NonNull Function<? super T,? extends V> valueSelector)
Returns a
Single
that emits a single
HashMap
containing values corresponding to items emitted by the current and finite
Observable
, mapped by the keys and values returned by the given selector functions.
<K,V> @NonNull Single<Map<K,V>>
toMap(@NonNull Function<? super T,? extends K> keySelector, @NonNull Function<? super T,? extends V> valueSelector, @NonNull Supplier<? extends Map<K,V>> mapSupplier)
Returns a
Single
that emits a single
Map
(subclass), returned by a specified
mapFactory
function, that contains keys and values extracted from the items, via selector functions, emitted by the current and finite
Observable
.
<K> @NonNull Single<Map<K,Collection<T>>>
toMultimap(@NonNull Function<? super T,? extends K> keySelector)
Returns a
Single
that emits a single
HashMap
that contains an
ArrayList
of items emitted by the current and finite
Observable
keyed by a specified
keySelector
function.
<K,V> @NonNull Single<Map<K,Collection<V>>>
toMultimap(@NonNull Function<? super T,? extends K> keySelector, Function<? super T,? extends V> valueSelector)
Returns a
Single
that emits a single
HashMap
that contains an
ArrayList
of values extracted by a specified
valueSelector
function from items emitted by the current and finite
Observable
, keyed by a specified
keySelector
function.
<K,V> @NonNull Single<Map<K,Collection<V>>>
toMultimap(@NonNull Function<? super T,? extends K> keySelector, @NonNull Function<? super T,? extends V> valueSelector, @NonNull Supplier<? extends Map<K,Collection<V>>> mapSupplier, @NonNull Function<? super K,? extends Collection<? super V>> collectionFactory)
Returns a
Single
that emits a single
Map
(subclass), returned by a specified
mapFactory
function, that contains a custom
Collection
of values, extracted by a specified
valueSelector
function from items emitted by the current and finite
Observable
, and keyed by the
keySelector
function.
<K,V> @NonNull Single<Map<K,Collection<V>>>
toMultimap(@NonNull Function<? super T,? extends K> keySelector, @NonNull Function<? super T,? extends V> valueSelector, @NonNull Supplier<Map<K,Collection<V>>> mapSupplier)
Returns a
Single
that emits a single
Map
(subclass), returned by a specified
mapFactory
function, that contains an
ArrayList
of values, extracted by a specified
valueSelector
function from items emitted by the current and finite
Observable
and keyed by the
keySelector
function.
@NonNull Single<List<T>>
toSortedList()
Returns a
Single
that emits a
List
that contains the items emitted by the current and finite
Observable
, in a sorted order.
@NonNull Single<List<T>>
toSortedList(@NonNull Comparator<? super T> comparator)
Returns a
Single
that emits a
List
that contains the items emitted by the current and finite
Observable
, in a sorted order based on a specified comparison function.
@NonNull Single<List<T>>
toSortedList(@NonNull Comparator<? super T> comparator, int capacityHint)
Returns a
Single
that emits a
List
that contains the items emitted by the current and finite
Observable
, in a sorted order based on a specified comparison function.
@NonNull Single<List<T>>
toSortedList(int capacityHint)
Returns a
Single
that emits a
List
that contains the items emitted by the current and finite
Observable
, in a sorted order.
static <T> @NonNull Observable<T>
unsafeCreate(@NonNull ObservableSource<T> onSubscribe)
Create an
Observable
by wrapping an
ObservableSource
which has to be implemented according to the Observable
specification derived from the Reactive Streams specification by handling disposal correctly; no safeguards are provided by the Observable
itself
.
@NonNull Observable<T>
unsubscribeOn(@NonNull Scheduler scheduler)
Return an
Observable
that schedules the downstream
Observer
s'
dispose
calls aimed at the current
Observable
on the given
Scheduler
.
static <T,D> @NonNull Observable<T>
using(@NonNull Supplier<? extends D> resourceSupplier, @NonNull Function<? super D,? extends ObservableSource<? extends T>> sourceSupplier, @NonNull Consumer<? super D> resourceCleanup)
Constructs an
Observable
that creates a dependent resource object, an
ObservableSource
with that resource and calls the provided
resourceDisposer
function if this inner source terminates or the downstream disposes the flow.
static <T,D> @NonNull Observable<T>
using(@NonNull Supplier<? extends D> resourceSupplier, @NonNull Function<? super D,? extends ObservableSource<? extends T>> sourceSupplier, @NonNull Consumer<? super D> resourceCleanup, boolean eager)
Constructs an
Observable
that creates a dependent resource object, an
ObservableSource
with that resource and calls the provided
disposer
function if this inner source terminates or the downstream disposes the flow; doing it before these end-states have been reached if
eager == true
, after otherwise.
@NonNull Observable<Observable<T>>
window(long count)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long count, long skip)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long count, long skip, int bufferSize)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long timespan, long timeskip, @NonNull TimeUnit unit)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long timespan, long timeskip, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long timespan, long timeskip, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, int bufferSize)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long timespan, @NonNull TimeUnit unit)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long timespan, @NonNull TimeUnit unit, long count)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long timespan, @NonNull TimeUnit unit, long count, boolean restart)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long timespan, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long timespan, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, long count)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long timespan, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, long count, boolean restart)
Returns an Observable
that emits windows of items it collects from the current Observable
.
@NonNull Observable<Observable<T>>
window(long timespan, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, long count, boolean restart, int bufferSize)
Returns an Observable
that emits windows of items it collects from the current Observable
.
<B> @NonNull Observable<Observable<T>>
window(@NonNull ObservableSource<B> boundaryIndicator)
Returns an
Observable
that emits non-overlapping windows of items it collects from the current
Observable
where the boundary of each window is determined by the items emitted from a specified boundary-governing
ObservableSource
.
<B> @NonNull Observable<Observable<T>>
window(@NonNull ObservableSource<B> boundaryIndicator, int bufferSize)
Returns an
Observable
that emits non-overlapping windows of items it collects from the current
Observable
where the boundary of each window is determined by the items emitted from a specified boundary-governing
ObservableSource
.
<U,V> @NonNull Observable<Observable<T>>
window(@NonNull ObservableSource<U> openingIndicator, @NonNull Function<? super U,? extends ObservableSource<V>> closingIndicator)
Returns an Observable
that emits windows of items it collects from the current Observable
.
<U,V> @NonNull Observable<Observable<T>>
window(@NonNull ObservableSource<U> openingIndicator, @NonNull Function<? super U,? extends ObservableSource<V>> closingIndicator, int bufferSize)
Returns an Observable
that emits windows of items it collects from the current Observable
.
<R> @NonNull Observable<R>
withLatestFrom(@NonNull Iterable<? extends ObservableSource<?>> others, @NonNull Function<? super Object[],R> combiner)
Combines the value emission from the current
Observable
with the latest emissions from the other
ObservableSource
s via a function to produce the output item.
<R> @NonNull Observable<R>
withLatestFrom(@NonNull ObservableSource<?>[] others, @NonNull Function<? super Object[],R> combiner)
Combines the value emission from the current
Observable
with the latest emissions from the other
ObservableSource
s via a function to produce the output item.
<U,R> @NonNull Observable<R>
withLatestFrom(@NonNull ObservableSource<? extends U> other, @NonNull BiFunction<? super T,? super U,? extends R> combiner)
Merges the specified
ObservableSource
into the current
Observable
sequence by using the
resultSelector
function only when the current
Observable
emits an item.
<T1,T2,R> @NonNull Observable<R>
withLatestFrom(@NonNull ObservableSource<T1> source1, @NonNull ObservableSource<T2> source2, @NonNull Function3<? super T,? super T1,? super T2,R> combiner)
Combines the value emission from the current
Observable
with the latest emissions from the other
ObservableSource
s via a function to produce the output item.
<T1,T2,T3,R>
@NonNull Observable<R>
withLatestFrom(@NonNull ObservableSource<T1> source1, @NonNull ObservableSource<T2> source2, @NonNull ObservableSource<T3> source3, @NonNull Function4<? super T,? super T1,? super T2,? super T3,R> combiner)
Combines the value emission from the current
Observable
with the latest emissions from the other
ObservableSource
s via a function to produce the output item.
<T1,T2,T3,T4,R>
@NonNull Observable<R>
withLatestFrom(@NonNull ObservableSource<T1> source1, @NonNull ObservableSource<T2> source2, @NonNull ObservableSource<T3> source3, @NonNull ObservableSource<T4> source4, @NonNull Function5<? super T,? super T1,? super T2,? super T3,? super T4,R> combiner)
Combines the value emission from the current
Observable
with the latest emissions from the other
ObservableSource
s via a function to produce the output item.
static <T> @NonNull Observable<T>
wrap(@NonNull ObservableSource<T> source)
static <T,R> @NonNull Observable<R>
zip(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, @NonNull Function<? super Object[],? extends R> zipper)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of items emitted, in sequence, by an
Iterable
of other
ObservableSource
s.
static <T,R> @NonNull Observable<R>
zip(@NonNull Iterable<? extends ObservableSource<? extends T>> sources, @NonNull Function<? super Object[],? extends R> zipper, boolean delayError, int bufferSize)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of items emitted, in sequence, by an
Iterable
of other
ObservableSource
s.
static <T1,T2,R> @NonNull Observable<R>
zip(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull BiFunction<? super T1,? super T2,? extends R> zipper)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of two items emitted, in sequence, by two other
ObservableSource
s.
static <T1,T2,R> @NonNull Observable<R>
zip(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull BiFunction<? super T1,? super T2,? extends R> zipper, boolean delayError)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of two items emitted, in sequence, by two other
ObservableSource
s.
static <T1,T2,R> @NonNull Observable<R>
zip(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull BiFunction<? super T1,? super T2,? extends R> zipper, boolean delayError, int bufferSize)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of two items emitted, in sequence, by two other
ObservableSource
s.
static <T1,T2,T3,R>
@NonNull Observable<R>
zip(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull Function3<? super T1,? super T2,? super T3,? extends R> zipper)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of three items emitted, in sequence, by three other
ObservableSource
s.
static <T1,T2,T3,T4,R>
@NonNull Observable<R>
zip(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull Function4<? super T1,? super T2,? super T3,? super T4,? extends R> zipper)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of four items emitted, in sequence, by four other
ObservableSource
s.
static <T1,T2,T3,T4,T5,R>
@NonNull Observable<R>
zip(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull ObservableSource<? extends T5> source5, @NonNull Function5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> zipper)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of five items emitted, in sequence, by five other
ObservableSource
s.
static <T1,T2,T3,T4,T5,T6,R>
@NonNull Observable<R>
zip(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull ObservableSource<? extends T5> source5, @NonNull ObservableSource<? extends T6> source6, @NonNull Function6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> zipper)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of six items emitted, in sequence, by six other
ObservableSource
s.
static <T1,T2,T3,T4,T5,T6,T7,R>
@NonNull Observable<R>
zip(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull ObservableSource<? extends T5> source5, @NonNull ObservableSource<? extends T6> source6, @NonNull ObservableSource<? extends T7> source7, @NonNull Function7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> zipper)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of seven items emitted, in sequence, by seven other
ObservableSource
s.
static <T1,T2,T3,T4,T5,T6,T7,T8,R>
@NonNull Observable<R>
zip(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull ObservableSource<? extends T5> source5, @NonNull ObservableSource<? extends T6> source6, @NonNull ObservableSource<? extends T7> source7, @NonNull ObservableSource<? extends T8> source8, @NonNull Function8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> zipper)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of eight items emitted, in sequence, by eight other
ObservableSource
s.
static <T1,T2,T3,T4,T5,T6,T7,T8,T9,R>
@NonNull Observable<R>
zip(@NonNull ObservableSource<? extends T1> source1, @NonNull ObservableSource<? extends T2> source2, @NonNull ObservableSource<? extends T3> source3, @NonNull ObservableSource<? extends T4> source4, @NonNull ObservableSource<? extends T5> source5, @NonNull ObservableSource<? extends T6> source6, @NonNull ObservableSource<? extends T7> source7, @NonNull ObservableSource<? extends T8> source8, @NonNull ObservableSource<? extends T9> source9, @NonNull Function9<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? super T9,? extends R> zipper)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of nine items emitted, in sequence, by nine other
ObservableSource
s.
static <T,R> @NonNull Observable<R>
zipArray(@NonNull Function<? super Object[],? extends R> zipper, boolean delayError, int bufferSize, ObservableSource<? extends T>... sources)
Returns an
Observable
that emits the results of a specified combiner function applied to combinations of items emitted, in sequence, by an array of other
ObservableSource
s.
<U,R> @NonNull Observable<R>
zipWith(@NonNull Iterable<U> other, @NonNull BiFunction<? super T,? super U,? extends R> zipper)
Returns an
Observable
that emits items that are the result of applying a specified function to pairs of values, one each from the current
Observable
and a specified
Iterable
sequence.
<U,R> @NonNull Observable<R>
zipWith(@NonNull ObservableSource<? extends U> other, @NonNull BiFunction<? super T,? super U,? extends R> zipper)
Returns an
Observable
that emits items that are the result of applying a specified function to pairs of values, one each from the current
Observable
and another specified
ObservableSource
.
<U,R> @NonNull Observable<R>
zipWith(@NonNull ObservableSource<? extends U> other, @NonNull BiFunction<? super T,? super U,? extends R> zipper, boolean delayError)
Returns an
Observable
that emits items that are the result of applying a specified function to pairs of values, one each from the current
Observable
and another specified
ObservableSource
.
<U,R> @NonNull Observable<R>
zipWith(@NonNull ObservableSource<? extends U> other, @NonNull BiFunction<? super T,? super U,? extends R> zipper, boolean delayError, int bufferSize)
Returns an
Observable
that emits items that are the result of applying a specified function to pairs of values, one each from the current
Observable
and another specified
ObservableSource
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4