Top Description Constructors Methods
io.reactivex.rxjava3.core

public abstract Class Observable<T>

extends Object
implements ObservableSource<T>
Class Inheritance
All Implemented Interfaces
io.reactivex.rxjava3.core.ObservableSource
Known Direct Subclasses
io.reactivex.rxjava3.internal.jdk8.ObservableCollectWithCollector, io.reactivex.rxjava3.internal.jdk8.MaybeFlattenStreamAsObservable, io.reactivex.rxjava3.internal.jdk8.ObservableFlatMapStream, io.reactivex.rxjava3.internal.jdk8.ObservableFromCompletionStage, io.reactivex.rxjava3.internal.jdk8.ObservableFromStream, io.reactivex.rxjava3.internal.jdk8.ObservableMapOptional, io.reactivex.rxjava3.internal.jdk8.SingleFlattenStreamAsObservable, io.reactivex.rxjava3.internal.operators.completable.CompletableToObservable, io.reactivex.rxjava3.internal.operators.maybe.MaybeFlatMapIterableObservable, io.reactivex.rxjava3.internal.operators.maybe.MaybeToObservable, io.reactivex.rxjava3.internal.operators.mixed.CompletableAndThenObservable, io.reactivex.rxjava3.internal.operators.mixed.MaybeFlatMapObservable, io.reactivex.rxjava3.internal.operators.mixed.ObservableConcatMapMaybe, io.reactivex.rxjava3.internal.operators.mixed.ObservableConcatMapSingle, io.reactivex.rxjava3.internal.operators.mixed.ObservableSwitchMapMaybe, io.reactivex.rxjava3.internal.operators.mixed.ObservableSwitchMapSingle, io.reactivex.rxjava3.internal.operators.mixed.SingleFlatMapObservable, io.reactivex.rxjava3.internal.operators.observable.AbstractObservableWithUpstream, io.reactivex.rxjava3.internal.operators.observable.ObservableAmb, io.reactivex.rxjava3.internal.operators.observable.ObservableAutoConnect, io.reactivex.rxjava3.internal.operators.observable.ObservableRange, io.reactivex.rxjava3.internal.operators.observable.ObservableRangeLong, io.reactivex.rxjava3.internal.operators.observable.ObservableRefCount, io.reactivex.rxjava3.internal.operators.observable.ObservableReplay.MulticastReplay, io.reactivex.rxjava3.internal.operators.observable.ObservableScalarXMap.ScalarXMapObservable, io.reactivex.rxjava3.internal.operators.observable.ObservableSequenceEqual, io.reactivex.rxjava3.internal.operators.observable.ObservableFromAction, io.reactivex.rxjava3.internal.operators.observable.ObservableFromArray, io.reactivex.rxjava3.internal.operators.observable.ObservableFromCallable, io.reactivex.rxjava3.internal.operators.observable.ObservableFromCompletable, io.reactivex.rxjava3.internal.operators.observable.ObservableFromFuture, io.reactivex.rxjava3.internal.operators.observable.ObservableFromIterable, io.reactivex.rxjava3.internal.operators.observable.ObservableFromPublisher, io.reactivex.rxjava3.internal.operators.observable.ObservableFromRunnable, io.reactivex.rxjava3.internal.operators.observable.ObservableFromSupplier, io.reactivex.rxjava3.internal.operators.observable.ObservableFromUnsafeSource, io.reactivex.rxjava3.internal.operators.observable.ObservableGenerate, io.reactivex.rxjava3.internal.operators.observable.ObservableError, io.reactivex.rxjava3.internal.operators.observable.ObservableNever, io.reactivex.rxjava3.internal.operators.observable.ObservableDefer, io.reactivex.rxjava3.internal.operators.observable.ObservableDelaySubscriptionOther, io.reactivex.rxjava3.internal.operators.observable.ObservableEmpty, io.reactivex.rxjava3.internal.operators.observable.ObservableInterval, io.reactivex.rxjava3.internal.operators.observable.ObservableIntervalRange, io.reactivex.rxjava3.internal.operators.observable.ObservableJust, io.reactivex.rxjava3.internal.operators.observable.ObservableTimer, io.reactivex.rxjava3.internal.operators.observable.ObservableUsing, io.reactivex.rxjava3.internal.operators.observable.ObservableWindowBoundarySelector.WindowBoundaryMainObserver.WindowEndObserverIntercept, io.reactivex.rxjava3.internal.operators.observable.ObservableWindowSubscribeIntercept, io.reactivex.rxjava3.internal.operators.observable.ObservableZip, io.reactivex.rxjava3.internal.operators.observable.ObservableZipIterable, io.reactivex.rxjava3.internal.operators.observable.ObservableCombineLatest, io.reactivex.rxjava3.internal.operators.observable.ObservableCreate, io.reactivex.rxjava3.internal.operators.single.SingleFlatMapIterableObservable, io.reactivex.rxjava3.internal.operators.single.SingleToObservable, io.reactivex.rxjava3.observables.ConnectableObservable, io.reactivex.rxjava3.observables.GroupedObservable, io.reactivex.rxjava3.subjects.Subject
Type Parameters
<T>
the type of the items emitted by the Observable
Imports
java.util.*, java.util.concurrent.*, java.util.stream.*, org.reactivestreams.Publisher, io.reactivex.rxjava3.annotations.*, io.reactivex.rxjava3.disposables.*, io.reactivex.rxjava3.exceptions.*, io.reactivex.rxjava3.functions.*, io.reactivex.rxjava3.internal.functions.*, io.reactivex.rxjava3.internal.jdk8.*, io.reactivex.rxjava3.internal.observers.*, io.reactivex.rxjava3.internal.operators.flowable.*, io.reactivex.rxjava3.internal.operators.maybe.MaybeToObservable, io.reactivex.rxjava3.internal.operators.mixed.*, io.reactivex.rxjava3.internal.operators.observable.*, io.reactivex.rxjava3.internal.operators.single.SingleToObservable, io.reactivex.rxjava3.internal.util.*, io.reactivex.rxjava3.observables.*, io.reactivex.rxjava3.observers.*, io.reactivex.rxjava3.operators.ScalarSupplier, io.reactivex.rxjava3.plugins.RxJavaPlugins, io.reactivex.rxjava3.schedulers.*

The Observable class is the non-backpressured, optionally multi-valued base reactive class that offers factory methods, intermediate operators and the ability to consume synchronous and/or asynchronous reactive dataflows.

Many operators in the class accept ObservableSource(s), the base reactive interface for such non-backpressured flows, which Observable itself implements as well.

The Observable's operators, by default, run with a buffer size of 128 elements (see Flowable#bufferSize()), that can be overridden globally via the system parameter rx3.buffer-size. Most operators, however, have overloads that allow setting their internal buffer size explicitly.

The documentation for this class makes use of marble diagrams. The following legend explains these diagrams:

The design of this class was derived from the Reactive-Streams design and specification by removing any backpressure-related infrastructure and implementation detail, replacing the org.reactivestreams.Subscription with Disposable as the primary means to dispose of a flow.

The Observable follows the protocol


     onSubscribe onNext* (onError | onComplete)?
where the stream can be disposed through the Disposable instance provided to consumers through Observer.onSubscribe.

Unlike the Observable of version 1.x, subscribe(Observer) does not allow external disposal of a subscription and the Observer instance is expected to expose such capability.

Example:


Disposable d = Observable.just("Hello world!")
    .delay(1, TimeUnit.SECONDS)
    .subscribeWith(new DisposableObserver<String>() {
        @Override public void onStart() {
            System.out.println("Start!");
        }
        @Override public void onNext(String t) {
            System.out.println(t);
        }
        @Override public void onError(Throwable t) {
            t.printStackTrace();
        }
        @Override public void onComplete() {
            System.out.println("Done!");
        }
    });

Thread.sleep(500);
// the sequence can now be disposed via dispose()
d.dispose();
See Also
Flowable, io.reactivex.rxjava3.observers.DisposableObserver

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final @NonNull Single<Boolean>

Returns:

the new Single instance
all
(@NonNull Predicate<? super T>
a function that evaluates an item and returns a Boolean
predicate
)

Returns a Single that emits a Boolean that indicates whether all of the items emitted by the current Observable satisfy a condition.

public static <
the common element type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
amb
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
an Iterable of ObservableSource sources competing to react first. A subscription to each source will occur in the same order as in the Iterable.
sources
)

Mirrors the one ObservableSource in an Iterable of several ObservableSources that first either emits an item or sends a termination notification.

public static <
the common element type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
ambArray
(@NonNull ObservableSource<? extends T>...
an array of ObservableSource sources competing to react first. A subscription to each source will occur in the same order as in the array.
sources
)

Mirrors the one ObservableSource in an array of several ObservableSources that first either emits an item or sends a termination notification.

public final @NonNull Observable<T>

Returns:

the new Observable instance
ambWith
(@NonNull ObservableSource<? extends T>
an ObservableSource competing to react first. A subscription to this provided source will occur after subscribing to the current source.
other
)

Mirrors the current Observable or the other ObservableSource provided of which the first either emits an item or sends a termination notification.

public final @NonNull Single<Boolean>

Returns:

the new Single instance
any
(@NonNull Predicate<? super T>
the condition to test items emitted by the current Observable
predicate
)

Returns a Single that emits true if any item emitted by the current Observable satisfies a specified condition, otherwise false

Note

this always emits false if the current Observable is empty.

public final T

Returns:

the first item emitted by the current Observable
blockingFirst
()

Returns the first item emitted by the current Observable, or throws NoSuchElementException if it emits no items.

public final T

Returns:

the first item emitted by the current Observable, or the default value if it emits no items
blockingFirst
(T
a default value to return if the current Observable emits no items
defaultItem
)

Returns the first item emitted by the current Observable, or a default value if it emits no items.

public final void
blockingForEach(@NonNull Consumer<? super T>
the Consumer to invoke for each item emitted by the Observable
onNext
)

Consumes the current Observable in a blocking fashion and invokes the given Consumer with each upstream item on the current thread until the upstream terminates.

public final void
blockingForEach(@NonNull Consumer<? super T>
the Consumer to invoke for each item emitted by the Observable
onNext
,
int
the number of items expected to be buffered (allows reducing buffer reallocations)
capacityHint
)

Consumes the current Observable in a blocking fashion and invokes the given Consumer with each upstream item on the current thread until the upstream terminates.

public final @NonNull Iterable<T>

Returns:

the new Iterable instance
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.

public final @NonNull Iterable<T>

Returns:

the new Iterable instance
blockingIterable
(int
the expected number of items to be buffered
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.

public final T

Returns:

the last item emitted by the current Observable
blockingLast
()

Returns the last item emitted by the current Observable, or throws NoSuchElementException if the current Observable emits no items.

public final T

Returns:

the last item emitted by the Observable, or the default value if it emits no items
blockingLast
(T
a default value to return if the current Observable emits no items
defaultItem
)

Returns the last item emitted by the current Observable, or a default value if it emits no items.

public final @NonNull Iterable<T>

Returns:

the new Iterable instance
blockingLatest
()

Returns an Iterable that returns the latest item emitted by the current Observable, waiting if necessary for one to become available.

public final @NonNull Iterable<T>

Returns:

the new Iterable instance
blockingMostRecent
(T
the initial value that the Iterable sequence will yield if the current Observable has not yet emitted an item
initialItem
)

Returns an Iterable that always returns the item most recently emitted by the current Observable.

public final @NonNull Iterable<T>

Returns:

the new Iterable instance
blockingNext
()

Returns an Iterable that blocks until the current Observable emits another item, then returns that item.

public final T

Returns:

the single item emitted by the current Observable
blockingSingle
()

If the current Observable completes after emitting a single item, return that item, otherwise throw a NoSuchElementException.

public final T

Returns:

the single item emitted by the current Observable, or the default value if it emits no items
blockingSingle
(T
a default value to return if the current Observable emits no items
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.

public final @NonNull Stream<T>

Returns:

the new Stream instance
blockingStream
()

Creates a sequential Stream to consume or process the current Observable in a blocking manner via the Java Stream API.

public final @NonNull Stream<T>

Returns:

the new Stream instance
blockingStream
(int
the expected number of items to be buffered
capacityHint
)

Creates a sequential Stream to consume or process the current Observable in a blocking manner via the Java Stream API.

public final void
blockingSubscribe()

Runs the current Observable to a terminal event, ignoring any values and rethrowing any exception.

public final void
blockingSubscribe(@NonNull Consumer<? super T>
the callback action for each source value
onNext
)

Subscribes to the source and calls the given callbacks on the current thread.

public final void
blockingSubscribe(@NonNull Consumer<? super T>
the callback action for each source value
onNext
,
@NonNull Consumer<? super Throwable>
the callback action for an error event
onError
)

Subscribes to the source and calls the given callbacks on the current thread.

public final void
blockingSubscribe(@NonNull Consumer<? super T>
the callback action for each source value
onNext
,
@NonNull Consumer<? super Throwable>
the callback action for an error event
onError
,
@NonNull Action
the callback action for the completion event.
onComplete
)

Subscribes to the source and calls the given callbacks on the current thread.

public final void
blockingSubscribe(@NonNull Observer<? super T>
the Observer instance to forward events and calls to in the current thread
observer
)

Subscribes to the source and calls the Observer methods on the current thread.

public final @NonNull Observable<@NonNull List<T>>

Returns:

the new Observable instance
buffer
(int
the maximum number of items in each buffer before it should be emitted
count
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final @NonNull Observable<@NonNull List<T>>

Returns:

the new Observable instance
buffer
(int
the maximum size of each buffer before it should be emitted
count
,
int
how many items emitted by the current Observable should be skipped before starting a new buffer. Note that when skip and count are equal, this is the same operation as buffer(int).
skip
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final <
the collection subclass type to buffer into
U extends Collection<? super T>
>
@NonNull Observable<U>

Returns:

the new Observable instance
buffer
(int
the maximum size of each buffer before it should be emitted
count
,
int
how many items emitted by the current Observable should be skipped before starting a new buffer. Note that when skip and count are equal, this is the same operation as buffer(int).
skip
,
@NonNull Supplier<U>
a factory function that returns an instance of the collection subclass to be used and returned as the buffer
bufferSupplier
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final <
the collection subclass type to buffer into
U extends Collection<? super T>
>
@NonNull Observable<U>

Returns:

the new Observable instance
buffer
(int
the maximum number of items in each buffer before it should be emitted
count
,
@NonNull Supplier<U>
a factory function that returns an instance of the collection subclass to be used and returned as the buffer
bufferSupplier
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final @NonNull Observable<@NonNull List<T>>

Returns:

the new Observable instance
buffer
(long
the period of time each buffer collects items before it is emitted
timespan
,
long
the period of time after which a new buffer will be created
timeskip
,
@NonNull TimeUnit
the unit of time that applies to the timespan and timeskip arguments
unit
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final @NonNull Observable<@NonNull List<T>>

Returns:

the new Observable instance
buffer
(long
the period of time each buffer collects items before it is emitted
timespan
,
long
the period of time after which a new buffer will be created
timeskip
,
@NonNull TimeUnit
the unit of time that applies to the timespan and timeskip arguments
unit
,
@NonNull Scheduler
the Scheduler to use when determining the end and start of a buffer
scheduler
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final <
the collection subclass type to buffer into
U extends Collection<? super T>
>
@NonNull Observable<U>

Returns:

the new Observable instance
buffer
(long
the period of time each buffer collects items before it is emitted
timespan
,
long
the period of time after which a new buffer will be created
timeskip
,
@NonNull TimeUnit
the unit of time that applies to the timespan and timeskip arguments
unit
,
@NonNull Scheduler
the Scheduler to use when determining the end and start of a buffer
scheduler
,
@NonNull Supplier<U>
a factory function that returns an instance of the collection subclass to be used and returned as the buffer
bufferSupplier
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final @NonNull Observable<@NonNull List<T>>

Returns:

the new Observable instance
buffer
(long
the period of time each buffer collects items before it is emitted and replaced with a new buffer
timespan
,
@NonNull TimeUnit
the unit of time that applies to the timespan argument
unit
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final @NonNull Observable<@NonNull List<T>>

Returns:

the new Observable instance
buffer
(long
the period of time each buffer collects items before it is emitted and replaced with a new buffer
timespan
,
@NonNull TimeUnit
the unit of time which applies to the timespan argument
unit
,
int
the maximum size of each buffer before it is emitted
count
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final @NonNull Observable<@NonNull List<T>>

Returns:

the new Observable instance
buffer
(long
the period of time each buffer collects items before it is emitted and replaced with a new buffer
timespan
,
@NonNull TimeUnit
the unit of time which applies to the timespan argument
unit
,
@NonNull Scheduler
the Scheduler to use when determining the end and start of a buffer
scheduler
,
int
the maximum size of each buffer before it is emitted
count
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final <
the collection subclass type to buffer into
U extends Collection<? super T>
>
@NonNull Observable<U>

Returns:

the new Observable instance
buffer
(long
the period of time each buffer collects items before it is emitted and replaced with a new buffer
timespan
,
@NonNull TimeUnit
the unit of time which applies to the timespan argument
unit
,
@NonNull Scheduler
the Scheduler to use when determining the end and start of a buffer
scheduler
,
int
the maximum size of each buffer before it is emitted
count
,
@NonNull Supplier<U>
a factory function that returns an instance of the collection subclass to be used and returned as the buffer
bufferSupplier
,
boolean
if true, the time window is restarted when the max capacity of the current buffer is reached
restartTimerOnMaxSize
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final @NonNull Observable<@NonNull List<T>>

Returns:

the new Observable instance
buffer
(long
the period of time each buffer collects items before it is emitted and replaced with a new buffer
timespan
,
@NonNull TimeUnit
the unit of time which applies to the timespan argument
unit
,
@NonNull Scheduler
the Scheduler to use when determining the end and start of a buffer
scheduler
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final <
the element type of the buffer-opening ObservableSource
TOpening
,
the element type of the individual buffer-closing ObservableSources
TClosing
>
@NonNull Observable<@NonNull List<T>>

Returns:

the new Observable instance
buffer
(@NonNull ObservableSource<? extends TOpening>
the ObservableSource that, when it emits an item, causes a new buffer to be created
openingIndicator
,
@NonNull Function<? super TOpening, ? extends ObservableSource<? extends TClosing>>
the Function that is used to produce an ObservableSource for every buffer created. When this indicator ObservableSource emits an item, the associated buffer is emitted.
closingIndicator
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final <
the element type of the buffer-opening ObservableSource
TOpening
,
the element type of the individual buffer-closing ObservableSources
TClosing
,
the collection subclass type to buffer into
U extends Collection<? super T>
>
@NonNull Observable<U>

Returns:

the new Observable instance
buffer
(@NonNull ObservableSource<? extends TOpening>
the ObservableSource that, when it emits an item, causes a new buffer to be created
openingIndicator
,
@NonNull Function<? super TOpening, ? extends ObservableSource<? extends TClosing>>
the Function that is used to produce an ObservableSource for every buffer created. When this indicator ObservableSource emits an item, the associated buffer is emitted.
closingIndicator
,
@NonNull Supplier<U>
a factory function that returns an instance of the collection subclass to be used and returned as the buffer
bufferSupplier
)

Returns an Observable that emits buffers of items it collects from the current Observable.

public final <
the boundary value type (ignored)
B
>
@NonNull Observable<@NonNull List<T>>

Returns:

the new Observable instance
buffer
(@NonNull ObservableSource<B>
the boundary ObservableSource
boundaryIndicator
)

Returns an Observable that emits non-overlapping buffered items from the current Observable each time the specified boundary ObservableSource emits an item.

public final <
the boundary value type (ignored)
B
>
@NonNull Observable<@NonNull List<T>>

Returns:

the new Observable instance
buffer
(@NonNull ObservableSource<B>
the boundary ObservableSource
boundaryIndicator
,
int
the initial capacity of each buffer chunk
initialCapacity
)

Returns an Observable that emits non-overlapping buffered items from the current Observable each time the specified boundary ObservableSource emits an item.

public final <
the boundary value type (ignored)
B
,
the collection subclass type to buffer into
U extends Collection<? super T>
>
@NonNull Observable<U>

Returns:

the new Observable instance
buffer
(@NonNull ObservableSource<B>
the boundary ObservableSource
boundaryIndicator
,
@NonNull Supplier<U>
a factory function that returns an instance of the collection subclass to be used and returned as the buffer
bufferSupplier
)

Returns an Observable that emits non-overlapping buffered items from the current Observable each time the specified boundary ObservableSource emits an item.

public static int

Returns:

the default 'island' size or capacity-increment hint
bufferSize
()

Returns the default 'island' size or capacity-increment hint for unbounded buffers.

public final @NonNull Observable<T>

Returns:

the new Observable instance
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
cacheWithInitialCapacity
(int
hint for number of items to cache (for optimizing underlying data structure)
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.

public final <
the output value type cast to
U
>
@NonNull Observable<U>

Returns:

the new Observable instance
cast
(@NonNull Class<U>
the target class type that cast will cast the items emitted by the current Observable into before emitting them from the resulting Observable
clazz
)

Returns an Observable that emits the items emitted by the current Observable, converted to the specified type.

public final <
the accumulator and output type
U
>
@NonNull Single<U>

Returns:

the new Single instance
collect
(@NonNull Supplier<? extends U>
the mutable data structure that will collect the items
initialItemSupplier
,
@NonNull BiConsumer<? super U, ? super T>
a function that accepts the state and an emitted item, and modifies the accumulator accordingly accordingly
collector
)

Collects items emitted by the finite source Observable into a single mutable data structure and returns a Single that emits this structure.

public final <
the non-null result type
R
,
the intermediate container type used for the accumulation
A
>
@NonNull Single<R>

Returns:

the new Single instance
collect
(@NonNull Collector<? super T, A, R>
the interface defining the container supplier, accumulator and finisher functions; see Collectors for some standard implementations
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.

public final <
the accumulator and output type
U
>
@NonNull Single<U>

Returns:

the new Single instance
collectInto
(U
the mutable data structure that will collect the items
initialItem
,
@NonNull BiConsumer<? super U, ? super T>
a function that accepts the state and an emitted item, and modifies the accumulator accordingly accordingly
collector
)

Collects items emitted by the finite source Observable into a single mutable data structure and returns a Single that emits this structure.

public static <
the common base type of source values
T
,
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatest
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the collection of source ObservableSources
sources
,
@NonNull Function<? super Object[], ? extends R>
the aggregation function used to combine the items emitted by the returned ObservableSources
combiner
)

Combines a collection of source ObservableSources by emitting an item that aggregates the latest values of each of the returned ObservableSources each time an item is received from any of the returned ObservableSources, where this aggregation is defined by a specified function.

public static <
the common base type of source values
T
,
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatest
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the collection of source ObservableSources
sources
,
@NonNull Function<? super Object[], ? extends R>
the aggregation function used to combine the items emitted by the returned ObservableSources
combiner
,
int
the expected number of row combination items to be buffered internally
bufferSize
)

Combines an Iterable of source ObservableSources by emitting an item that aggregates the latest values of each of the returned ObservableSources each time an item is received from any of the returned ObservableSources, where this aggregation is defined by a specified function.

public static <
the element type of the first source
T1
,
the element type of the second source
T2
,
the combined output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatest
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
the second source ObservableSource
source2
,
@NonNull BiFunction<? super T1, ? super T2, ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
)

Combines two source ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from either of the ObservableSources, where this aggregation is defined by a specified function.

public static <
the element type of the first source
T1
,
the element type of the second source
T2
,
the element type of the third source
T3
,
the combined output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatest
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
the second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
the third source ObservableSource
source3
,
@NonNull Function3<? super T1, ? super T2, ? super T3, ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
)

Combines three source ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function.

public static <
the element type of the first source
T1
,
the element type of the second source
T2
,
the element type of the third source
T3
,
the element type of the fourth source
T4
,
the combined output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatest
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
the second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
the third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
the fourth source ObservableSource
source4
,
@NonNull Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
)

Combines four source ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function.

public static <
the element type of the first source
T1
,
the element type of the second source
T2
,
the element type of the third source
T3
,
the element type of the fourth source
T4
,
the element type of the fifth source
T5
,
the combined output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatest
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
the second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
the third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
the fourth source ObservableSource
source4
,
@NonNull ObservableSource<? extends T5>
the fifth source ObservableSource
source5
,
@NonNull Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
)

Combines five source ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function.

public static <
the element type of the first source
T1
,
the element type of the second source
T2
,
the element type of the third source
T3
,
the element type of the fourth source
T4
,
the element type of the fifth source
T5
,
the element type of the sixth source
T6
,
the combined output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatest
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
the second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
the third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
the fourth source ObservableSource
source4
,
@NonNull ObservableSource<? extends T5>
the fifth source ObservableSource
source5
,
@NonNull ObservableSource<? extends T6>
the sixth source ObservableSource
source6
,
@NonNull Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
)

Combines six source ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function.

public static <
the element type of the first source
T1
,
the element type of the second source
T2
,
the element type of the third source
T3
,
the element type of the fourth source
T4
,
the element type of the fifth source
T5
,
the element type of the sixth source
T6
,
the element type of the seventh source
T7
,
the combined output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatest
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
the second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
the third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
the fourth source ObservableSource
source4
,
@NonNull ObservableSource<? extends T5>
the fifth source ObservableSource
source5
,
@NonNull ObservableSource<? extends T6>
the sixth source ObservableSource
source6
,
@NonNull ObservableSource<? extends T7>
the seventh source ObservableSource
source7
,
@NonNull Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
)

Combines seven source ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function.

public static <
the element type of the first source
T1
,
the element type of the second source
T2
,
the element type of the third source
T3
,
the element type of the fourth source
T4
,
the element type of the fifth source
T5
,
the element type of the sixth source
T6
,
the element type of the seventh source
T7
,
the element type of the eighth source
T8
,
the combined output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatest
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
the second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
the third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
the fourth source ObservableSource
source4
,
@NonNull ObservableSource<? extends T5>
the fifth source ObservableSource
source5
,
@NonNull ObservableSource<? extends T6>
the sixth source ObservableSource
source6
,
@NonNull ObservableSource<? extends T7>
the seventh source ObservableSource
source7
,
@NonNull ObservableSource<? extends T8>
the eighth source ObservableSource
source8
,
@NonNull Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
)

Combines eight source ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function.

public static <
the element type of the first source
T1
,
the element type of the second source
T2
,
the element type of the third source
T3
,
the element type of the fourth source
T4
,
the element type of the fifth source
T5
,
the element type of the sixth source
T6
,
the element type of the seventh source
T7
,
the element type of the eighth source
T8
,
the element type of the ninth source
T9
,
the combined output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatest
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
the second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
the third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
the fourth source ObservableSource
source4
,
@NonNull ObservableSource<? extends T5>
the fifth source ObservableSource
source5
,
@NonNull ObservableSource<? extends T6>
the sixth source ObservableSource
source6
,
@NonNull ObservableSource<? extends T7>
the seventh source ObservableSource
source7
,
@NonNull ObservableSource<? extends T8>
the eighth source ObservableSource
source8
,
@NonNull ObservableSource<? extends T9>
the ninth source ObservableSource
source9
,
@NonNull Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
)

Combines nine source ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function.

public static <
the common base type of source values
T
,
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatestArray
(@NonNull ObservableSource<? extends T>[]
the collection of source ObservableSources
sources
,
@NonNull Function<? super Object[], ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
)

Combines an array of source ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the returned ObservableSources, where this aggregation is defined by a specified function.

public static <
the common base type of source values
T
,
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatestArray
(@NonNull ObservableSource<? extends T>[]
the collection of source ObservableSources
sources
,
@NonNull Function<? super Object[], ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
,
int
the expected number of row combination items to be buffered internally
bufferSize
)

Combines an array of source ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function.

public static <
the common base type of source values
T
,
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatestArrayDelayError
(@NonNull ObservableSource<? extends T>[]
the collection of source ObservableSources
sources
,
@NonNull Function<? super Object[], ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
)

Combines an array of ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function.

public static <
the common base type of source values
T
,
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatestArrayDelayError
(@NonNull ObservableSource<? extends T>[]
the collection of source ObservableSources
sources
,
@NonNull Function<? super Object[], ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
,
int
the expected number of row combination items to be buffered internally
bufferSize
)

Combines an array of ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function and delays any error from the sources until all source ObservableSources terminate.

public static <
the common base type of source values
T
,
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatestDelayError
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the Iterable of source ObservableSources
sources
,
@NonNull Function<? super Object[], ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
)

Combines an Iterable of ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function and delays any error from the sources until all source ObservableSources terminate.

public static <
the common base type of source values
T
,
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
combineLatestDelayError
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the collection of source ObservableSources
sources
,
@NonNull Function<? super Object[], ? extends R>
the aggregation function used to combine the items emitted by the ObservableSources
combiner
,
int
the expected number of row combination items to be buffered internally
bufferSize
)

Combines an Iterable of ObservableSources by emitting an item that aggregates the latest values of each of the ObservableSources each time an item is received from any of the ObservableSources, where this aggregation is defined by a specified function and delays any error from the sources until all source ObservableSources terminate.

public final <
the value type of the output ObservableSource
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
compose
(@NonNull ObservableTransformer<? super T, ? extends R>
implements the function that transforms the current Observable
composer
)

Transform the current Observable by applying a particular ObservableTransformer function to it.

public static <
the common value type of the sources
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
concat
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the Iterable sequence of ObservableSources
sources
)

Concatenates elements of each ObservableSource provided via an Iterable sequence into a single sequence of elements without interleaving them.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
concat
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
an ObservableSource that emits ObservableSources
sources
)

Returns an Observable that emits the items emitted by each of the ObservableSources emitted by the ObservableSource, one after the other, without interleaving them.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
concat
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
an ObservableSource that emits ObservableSources
sources
,
int
the number of inner ObservableSources expected to be buffered.
bufferSize
)

Returns an Observable that emits the items emitted by each of the ObservableSources emitted by the outer ObservableSource, one after the other, without interleaving them.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
concat
(@NonNull ObservableSource<? extends T>
an ObservableSource to be concatenated
source1
,
ObservableSource<? extends T>
an ObservableSource to be concatenated
source2
)

Returns an Observable that emits the items emitted by two ObservableSources, one after the other, without interleaving them.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
concat
(@NonNull ObservableSource<? extends T>
an ObservableSource to be concatenated
source1
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be concatenated
source2
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be concatenated
source3
)

Returns an Observable that emits the items emitted by three ObservableSources, one after the other, without interleaving them.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
concat
(@NonNull ObservableSource<? extends T>
an ObservableSource to be concatenated
source1
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be concatenated
source2
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be concatenated
source3
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be concatenated
source4
)

Returns an Observable that emits the items emitted by four ObservableSources, one after the other, without interleaving them.

public static <
the common base value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
concatArray
(@NonNull ObservableSource<? extends T>...
the array of sources
sources
)

Concatenates a variable number of ObservableSource sources.

public static <
the common base value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
concatArrayDelayError
(@NonNull ObservableSource<? extends T>...
the array of sources
sources
)

Concatenates a variable number of ObservableSource sources and delays errors from any of them till all terminate.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatArrayEager
(@NonNull ObservableSource<? extends T>...
an array of ObservableSources that need to be eagerly concatenated
sources
)

Concatenates an array of ObservableSources eagerly into a single stream of values.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatArrayEager
(int
the maximum number of concurrent subscriptions at a time, Integer#MAX_VALUE is interpreted as indication to subscribe to all sources at once
maxConcurrency
,
int
the number of elements expected from each ObservableSource to be buffered
bufferSize
,
@NonNull ObservableSource<? extends T>...
an array of ObservableSources that need to be eagerly concatenated
sources
)

Concatenates an array of ObservableSources eagerly into a single stream of values.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatArrayEagerDelayError
(@NonNull ObservableSource<? extends T>...
an array of ObservableSources that need to be eagerly concatenated
sources
)

Concatenates an array of ObservableSources eagerly into a single stream of values and delaying any errors until all sources terminate.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatArrayEagerDelayError
(int
the maximum number of concurrent subscriptions at a time, Integer#MAX_VALUE is interpreted as indication to subscribe to all sources at once
maxConcurrency
,
int
the number of elements expected from each ObservableSource to be buffered
bufferSize
,
@NonNull ObservableSource<? extends T>...
an array of ObservableSources that need to be eagerly concatenated
sources
)

Concatenates an array of ObservableSources eagerly into a single stream of values and delaying any errors until all sources terminate.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable with the concatenating behavior
concatDelayError
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the Iterable sequence of ObservableSources
sources
)

Concatenates the Iterable sequence of ObservableSources 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 ObservableSources terminate.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable with the concatenating behavior
concatDelayError
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
the ObservableSource sequence of ObservableSources
sources
)

Concatenates the ObservableSource sequence of ObservableSources 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 ObservableSources terminate.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable with the concatenating behavior
concatDelayError
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
the ObservableSource sequence of ObservableSources
sources
,
int
the number of inner ObservableSources expected to be buffered
bufferSize
,
boolean
if true, exceptions from the outer and all inner ObservableSources are delayed to the end if false, exception from the outer ObservableSource is delayed till the active ObservableSource terminates
tillTheEnd
)

Concatenates the ObservableSource sequence of ObservableSources 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 ObservableSources terminate.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatEager
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
a sequence of ObservableSources that need to be eagerly concatenated
sources
)

Concatenates a sequence of ObservableSources eagerly into a single stream of values.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatEager
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
a sequence of ObservableSources that need to be eagerly concatenated
sources
,
int
the maximum number of concurrently running inner ObservableSources; Integer#MAX_VALUE is interpreted as all inner ObservableSources can be active at the same time
maxConcurrency
,
int
the number of elements expected from each inner ObservableSource to be buffered
bufferSize
)

Concatenates a sequence of ObservableSources eagerly into a single stream of values and runs a limited number of inner sequences at once.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatEager
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
a sequence of ObservableSources that need to be eagerly concatenated
sources
)

Concatenates an ObservableSource sequence of ObservableSources eagerly into a single stream of values.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatEager
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
a sequence of ObservableSources that need to be eagerly concatenated
sources
,
int
the maximum number of concurrently running inner ObservableSources; Integer#MAX_VALUE is interpreted as all inner ObservableSources can be active at the same time
maxConcurrency
,
int
the number of inner ObservableSource expected to be buffered
bufferSize
)

Concatenates an ObservableSource sequence of ObservableSources eagerly into a single stream of values and runs a limited number of inner sequences at once.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatEagerDelayError
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
a sequence of ObservableSources that need to be eagerly concatenated
sources
)

Concatenates a sequence of ObservableSources eagerly into a single stream of values, delaying errors until all the inner sequences terminate.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatEagerDelayError
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
a sequence of ObservableSources that need to be eagerly concatenated
sources
,
int
the maximum number of concurrently running inner ObservableSources; Integer#MAX_VALUE is interpreted as all inner ObservableSources can be active at the same time
maxConcurrency
,
int
the number of elements expected from each inner ObservableSource to be buffered
bufferSize
)

Concatenates a sequence of ObservableSources 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.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatEagerDelayError
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
a sequence of ObservableSources that need to be eagerly concatenated
sources
)

Concatenates an ObservableSource sequence of ObservableSources eagerly into a single stream of values, delaying errors until all the inner and the outer sequence terminate.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance with the specified concatenation behavior
concatEagerDelayError
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
a sequence of ObservableSources that need to be eagerly concatenated
sources
,
int
the maximum number of concurrently running inner ObservableSources; Integer#MAX_VALUE is interpreted as all inner ObservableSources can be active at the same time
maxConcurrency
,
int
the number of inner ObservableSource expected to be buffered
bufferSize
)

Concatenates an ObservableSource sequence of ObservableSources 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.

public final <
the type of the inner ObservableSource sources and thus the output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
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 ObservableSources.

public final <
the type of the inner ObservableSource sources and thus the output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
mapper
,
int
the number of elements expected from the current Observable to be buffered
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 ObservableSources.

public final <
the type of the inner ObservableSource sources and thus the output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
mapper
,
int
the number of elements expected from the current Observable to be buffered
bufferSize
,
@NonNull Scheduler
the scheduler where the mapper function will be executed
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 ObservableSources.

public final @NonNull Completable

Returns:

the new Completable instance
concatMapCompletable
(@NonNull Function<? super T, ? extends CompletableSource>
a function that, when applied to an item emitted by the current Observable, returns a CompletableSource
mapper
)

Maps each element of the current Observable into CompletableSources, subscribes to them one at a time in order and waits until the upstream and all CompletableSources complete.

public final @NonNull Completable

Returns:

the new Completable instance
concatMapCompletable
(@NonNull Function<? super T, ? extends CompletableSource>
a function that, when applied to an item emitted by the current Observable, returns a CompletableSource
mapper
,
int
the number of upstream items expected to be buffered until the current CompletableSource, mapped from the current item, completes.
capacityHint
)

Maps each element of the current Observable into CompletableSources, subscribes to them one at a time in order and waits until the upstream and all CompletableSources complete.

public final @NonNull Completable

Returns:

the new Completable instance
concatMapCompletableDelayError
(@NonNull Function<? super T, ? extends CompletableSource>
the function called with the upstream item and should return a CompletableSource to become the next source to be subscribed to
mapper
)

Maps the upstream items into CompletableSources and subscribes to them one after the other terminates, delaying all errors till both the current Observable and all inner CompletableSources terminate.

public final @NonNull Completable

Returns:

the new Completable instance
concatMapCompletableDelayError
(@NonNull Function<? super T, ? extends CompletableSource>
the function called with the upstream item and should return a CompletableSource to become the next source to be subscribed to
mapper
,
boolean
If true, errors from the current Observable or any of the inner CompletableSources are delayed until all of them terminate. If false, an error from the current Observable is delayed until the current inner CompletableSource terminates and only then is it emitted to the downstream.
tillTheEnd
)

Maps the upstream items into CompletableSources and subscribes to them one after the other terminates, optionally delaying all errors till both the current Observable and all inner CompletableSources terminate.

public final @NonNull Completable

Returns:

the new Completable instance
concatMapCompletableDelayError
(@NonNull Function<? super T, ? extends CompletableSource>
the function called with the upstream item and should return a CompletableSource to become the next source to be subscribed to
mapper
,
boolean
If true, errors from the current Observable or any of the inner CompletableSources are delayed until all of them terminate. If false, an error from the current Observable is delayed until the current inner CompletableSource terminates and only then is it emitted to the downstream.
tillTheEnd
,
int
The number of upstream items expected to be buffered so that fresh items are ready to be mapped when a previous CompletableSource terminates.
bufferSize
)

Maps the upstream items into CompletableSources and subscribes to them one after the other terminates, optionally delaying all errors till both the current Observable and all inner CompletableSources terminate.

public final <
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance with the concatenation behavior
concatMapDelayError
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
the function that maps the items of the current Observable into the inner ObservableSources.
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 ObservableSources till all of them terminate.

public final <
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance with the concatenation behavior
concatMapDelayError
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
the function that maps the items of the current Observable into the inner ObservableSources.
mapper
,
boolean
if true, all errors from the outer and inner ObservableSource sources are delayed until the end, if false, an error from the main source is signaled when the current Observable source terminates
tillTheEnd
,
int
the number of elements expected from the current Observable to be buffered
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 ObservableSources till all of them terminate.

public final <
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance with the concatenation behavior
concatMapDelayError
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
the function that maps the items of the current Observable into the inner ObservableSources.
mapper
,
boolean
if true, all errors from the outer and inner ObservableSource sources are delayed until the end, if false, an error from the main source is signaled when the current Observable source terminates
tillTheEnd
,
int
the number of elements expected from the current Observable to be buffered
bufferSize
,
@NonNull Scheduler
the scheduler where the mapper function will be executed
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 ObservableSources till all of them terminate.

public final <
the value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance with the specified concatenation behavior
concatMapEager
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
the function that maps a sequence of values into a sequence of ObservableSources that will be eagerly concatenated
mapper
)

Maps a sequence of values into ObservableSources and concatenates these ObservableSources eagerly into a single Observable sequence.

public final <
the value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance with the specified concatenation behavior
concatMapEager
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
the function that maps a sequence of values into a sequence of ObservableSources that will be eagerly concatenated
mapper
,
int
the maximum number of concurrent subscribed ObservableSources
maxConcurrency
,
int
hints about the number of expected items from each inner ObservableSource, must be positive
bufferSize
)

Maps a sequence of values into ObservableSources and concatenates these ObservableSources eagerly into a single Observable sequence.

public final <
the value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance with the specified concatenation behavior
concatMapEagerDelayError
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
the function that maps a sequence of values into a sequence of ObservableSources that will be eagerly concatenated
mapper
,
boolean
if true, all errors from the outer and inner ObservableSource sources are delayed until the end, if false, an error from the main source is signaled when the current Observable source terminates
tillTheEnd
)

Maps a sequence of values into ObservableSources and concatenates these ObservableSources eagerly into a single Observable sequence.

public final <
the value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance with the specified concatenation behavior
concatMapEagerDelayError
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
the function that maps a sequence of values into a sequence of ObservableSources that will be eagerly concatenated
mapper
,
boolean
if true, exceptions from the current Observable and all the inner ObservableSources are delayed until all of them terminate, if false, exception from the current Observable is delayed until the currently running ObservableSource terminates
tillTheEnd
,
int
the maximum number of concurrent subscribed ObservableSources
maxConcurrency
,
int
the number of elements expected from the current Observable and each inner ObservableSource to be buffered
bufferSize
)

Maps a sequence of values into ObservableSources and concatenates these ObservableSources eagerly into a single Observable sequence.

public final <
the type of item emitted by the resulting Observable
U
>
@NonNull Observable<U>

Returns:

the new Observable instance
concatMapIterable
(@NonNull Function<? super T, @NonNull ? extends Iterable<? extends U>>
a function that returns an Iterable sequence of values for when given an item emitted by the current Observable
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.

public final <
the result type of the inner MaybeSources
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMapMaybe
(@NonNull Function<? super T, ? extends MaybeSource<? extends R>>
the function called with the upstream item and should return a MaybeSource to become the next source to be subscribed to
mapper
)

Maps the upstream items into MaybeSources 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.

public final <
the result type of the inner MaybeSources
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMapMaybe
(@NonNull Function<? super T, ? extends MaybeSource<? extends R>>
the function called with the upstream item and should return a MaybeSource to become the next source to be subscribed to
mapper
,
int
The number of upstream items expected to be buffered so that fresh items are ready to be mapped when a previous MaybeSource terminates.
bufferSize
)

Maps the upstream items into MaybeSources 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.

public final <
the result type of the inner MaybeSources
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMapMaybeDelayError
(@NonNull Function<? super T, ? extends MaybeSource<? extends R>>
the function called with the upstream item and should return a MaybeSource to become the next source to be subscribed to
mapper
)

Maps the upstream items into MaybeSources 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 MaybeSources terminate.

public final <
the result type of the inner MaybeSources
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMapMaybeDelayError
(@NonNull Function<? super T, ? extends MaybeSource<? extends R>>
the function called with the upstream item and should return a MaybeSource to become the next source to be subscribed to
mapper
,
boolean
If true, errors from the current Observable or any of the inner MaybeSources are delayed until all of them terminate. If false, an error from the current Observable is delayed until the current inner MaybeSource terminates and only then is it emitted to the downstream.
tillTheEnd
)

Maps the upstream items into MaybeSources 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 MaybeSources terminate.

public final <
the result type of the inner MaybeSources
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMapMaybeDelayError
(@NonNull Function<? super T, ? extends MaybeSource<? extends R>>
the function called with the upstream item and should return a MaybeSource to become the next source to be subscribed to
mapper
,
boolean
If true, errors from the current Observable or any of the inner MaybeSources are delayed until all of them terminate. If false, an error from the current Observable is delayed until the current inner MaybeSource terminates and only then is it emitted to the downstream.
tillTheEnd
,
int
The number of upstream items expected to be buffered so that fresh items are ready to be mapped when a previous MaybeSource terminates.
bufferSize
)

Maps the upstream items into MaybeSources 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 MaybeSources terminate.

public final <
the result type of the inner SingleSources
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMapSingle
(@NonNull Function<? super T, ? extends SingleSource<? extends R>>
the function called with the upstream item and should return a SingleSource to become the next source to be subscribed to
mapper
)

Maps the upstream items into SingleSources 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.

public final <
the result type of the inner SingleSources
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMapSingle
(@NonNull Function<? super T, ? extends SingleSource<? extends R>>
the function called with the upstream item and should return a SingleSource to become the next source to be subscribed to
mapper
,
int
The number of upstream items expected to be buffered so that fresh items are ready to be mapped when a previous SingleSource terminates.
bufferSize
)

Maps the upstream items into SingleSources 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.

public final <
the result type of the inner SingleSources
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMapSingleDelayError
(@NonNull Function<? super T, ? extends SingleSource<? extends R>>
the function called with the upstream item and should return a SingleSource to become the next source to be subscribed to
mapper
)

Maps the upstream items into SingleSources 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 SingleSources terminate.

public final <
the result type of the inner SingleSources
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMapSingleDelayError
(@NonNull Function<? super T, ? extends SingleSource<? extends R>>
the function called with the upstream item and should return a SingleSource to become the next source to be subscribed to
mapper
,
boolean
If true, errors from the current Observable or any of the inner SingleSources are delayed until all of them terminate. If false, an error from the current Observable is delayed until the current inner SingleSource terminates and only then is it emitted to the downstream.
tillTheEnd
)

Maps the upstream items into SingleSources 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 SingleSources terminate.

public final <
the result type of the inner SingleSources
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMapSingleDelayError
(@NonNull Function<? super T, ? extends SingleSource<? extends R>>
the function called with the upstream item and should return a SingleSource to become the next source to be subscribed to
mapper
,
boolean
If true, errors from the current Observable or any of the inner SingleSources are delayed until all of them terminate. If false, an error from the current Observable is delayed until the current inner SingleSource terminates and only then is it emitted to the downstream.
tillTheEnd
,
int
The number of upstream items expected to be buffered so that fresh items are ready to be mapped when a previous SingleSource terminates.
bufferSize
)

Maps the upstream items into SingleSources 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 SingleSources terminate.

public final <
the element type of the Streams and the result
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
concatMapStream
(@NonNull Function<? super T, @NonNull ? extends Stream<? extends R>>
the function that receives an upstream item and should return a Stream whose elements will be emitted to the downstream
mapper
)

Maps each upstream item into a Stream and emits the Stream's items to the downstream in a sequential fashion.

public final @NonNull Observable<T>

Returns:

the new Observable instance
concatWith
(@NonNull ObservableSource<? extends T>
an ObservableSource to be concatenated after the current
other
)

Returns an Observable that first emits the items emitted from the current Observable, then items from the other ObservableSource without interleaving them.

public final @NonNull Observable<T>

Returns:

the new Observable instance
concatWith
(@NonNull SingleSource<? extends T>
the SingleSource whose signal should be emitted after the current Observable completes normally.
other
)

Returns an Observable that emits the items from the current Observable followed by the success item or error event of the other SingleSource.

public final @NonNull Observable<T>

Returns:

the new Observable instance
concatWith
(@NonNull MaybeSource<? extends T>
the MaybeSource whose signal should be emitted after the current Observable completes normally.
other
)

Returns an Observable that emits the items from the current Observable followed by the success item or terminal events of the other MaybeSource.

public final @NonNull Observable<T>

Returns:

the new Observable instance
concatWith
(@NonNull CompletableSource
the CompletableSource to subscribe to once the current Observable completes normally
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.

public final @NonNull Single<Boolean>

Returns:

the new Single instance
contains
(@NonNull Object
the item to search for in the emissions from the current Observable
item
)

Returns a Single that emits a Boolean that indicates whether the current Observable emitted a specified item.

public final @NonNull Single<Long>

Returns:

the new Single instance
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.

public static <
the element type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
create
(@NonNull ObservableOnSubscribe<T>
the emitter that is called when an Observer subscribes to the returned Observable
source
)

Provides an API (via a cold Observable) that bridges the reactive world with the callback-style world.

public final <
the debounce value type (ignored)
U
>
@NonNull Observable<T>

Returns:

the new Observable instance
debounce
(@NonNull Function<? super T, ? extends ObservableSource<U>>
function to return a sequence that indicates the throttle duration for each item via its own emission or completion
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
debounce
(long
the length of the window of time that must pass after the emission of an item from the current Observable in which the Observable emits no items in order for the item to be emitted by the resulting Observable
timeout
,
@NonNull TimeUnit
the unit of time for the specified timeout
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
debounce
(long
the time each item has to be "the most recent" of those emitted by the current Observable to ensure that it's not dropped
timeout
,
@NonNull TimeUnit
the unit of time for the specified timeout
unit
,
@NonNull Scheduler
the Scheduler to use internally to manage the timers that handle the timeout for each item
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
debounce
(long
the time each item has to be "the most recent" of those emitted by the current Observable to ensure that it's not dropped
timeout
,
@NonNull TimeUnit
the unit of time for the specified timeout
unit
,
@NonNull Scheduler
the Scheduler to use internally to manage the timers that handle the timeout for each item
scheduler
,
@NonNull Consumer<? super T>
called with the current entry when it has been replaced by a new one
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
defaultIfEmpty
(T
the item to emit if the current Observable emits no items
defaultItem
)

Returns an Observable that emits the items emitted by the current Observable or a specified default item if the current Observable is empty.

public static <
the type of the items emitted by the ObservableSource
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
defer
(@NonNull Supplier<? extends @NonNull ObservableSource<? extends T>>
the ObservableSource factory function to invoke for each Observer that subscribes to the resulting Observable
supplier
)

Returns an Observable that calls an ObservableSource factory to create an ObservableSource for each new Observer that subscribes.

public final <
the item delay value type (ignored)
U
>
@NonNull Observable<T>

Returns:

the new Observable instance
delay
(@NonNull Function<? super T, ? extends ObservableSource<U>>
a function that returns an ObservableSource for each item emitted by the current Observable, which is then used to delay the emission of that item by the resulting Observable until the ObservableSource returned from itemDelay emits an item
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
delay
(long
the delay to shift the source by
time
,
@NonNull TimeUnit
the TimeUnit in which period is defined
unit
)

Returns an Observable that emits the items emitted by the current Observable shifted forward in time by a specified delay.

public final @NonNull Observable<T>

Returns:

the new Observable instance
delay
(long
the delay to shift the source by
time
,
@NonNull TimeUnit
the TimeUnit in which period is defined
unit
,
boolean
if true, the upstream exception is signaled with the given delay, after all preceding normal elements, if false, the upstream exception is signaled immediately
delayError
)

Returns an Observable that emits the items emitted by the current Observable shifted forward in time by a specified delay.

public final @NonNull Observable<T>

Returns:

the new Observable instance
delay
(long
the delay to shift the source by
time
,
@NonNull TimeUnit
the time unit of delay
unit
,
@NonNull Scheduler
the Scheduler to use for delaying
scheduler
)

Returns an Observable that emits the items emitted by the current Observable shifted forward in time by a specified delay.

public final @NonNull Observable<T>

Returns:

the new Observable instance
delay
(long
the delay to shift the source by
time
,
@NonNull TimeUnit
the time unit of delay
unit
,
@NonNull Scheduler
the Scheduler to use for delaying
scheduler
,
boolean
if true, the upstream exception is signaled with the given delay, after all preceding normal elements, if false, the upstream exception is signaled immediately
delayError
)

Returns an Observable that emits the items emitted by the current Observable shifted forward in time by a specified delay.

public final <
the subscription delay value type (ignored)
U
,
the item delay value type (ignored)
V
>
@NonNull Observable<T>

Returns:

the new Observable instance
delay
(@NonNull ObservableSource<U>
a function that returns an ObservableSource that triggers the subscription to the current Observable once it emits any item
subscriptionIndicator
,
@NonNull Function<? super T, ? extends ObservableSource<V>>
a function that returns an ObservableSource for each item emitted by the current Observable, which is then used to delay the emission of that item by the resulting Observable until the ObservableSource returned from itemDelay emits an item
itemDelayIndicator
)

Returns an Observable that delays the subscription to and emissions from the current Observable via ObservableSources for the subscription itself and on a per-item basis.

public final <
the value type of the other Observable, irrelevant
U
>
@NonNull Observable<T>

Returns:

the new Observable instance
delaySubscription
(@NonNull ObservableSource<U>
the other ObservableSource that should trigger the subscription to the current Observable.
subscriptionIndicator
)

Returns an Observable that delays the subscription to the current Observable until the other ObservableSource emits an element or completes normally.

public final @NonNull Observable<T>

Returns:

the new Observable instance
delaySubscription
(long
the time to delay the subscription
time
,
@NonNull TimeUnit
the time unit of delay
unit
)

Returns an Observable that delays the subscription to the current Observable by a given amount of time.

public final @NonNull Observable<T>

Returns:

the new Observable instance
delaySubscription
(long
the time to delay the subscription
time
,
@NonNull TimeUnit
the time unit of delay
unit
,
@NonNull Scheduler
the Scheduler on which the waiting and subscription will happen
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.

public final <
the output value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
dematerialize
(@NonNull Function<? super T, Notification<R>>
function that returns the upstream item and should return a Notification to signal the corresponding Observer event to the downstream.
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
distinct
()

Returns an Observable that emits all items emitted by the current Observable that are distinct based on Object#equals(Object) comparison.

public final <
the key type
K
>
@NonNull Observable<T>

Returns:

the new Observable instance
distinct
(@NonNull Function<? super T, K>
a function that projects an emitted item to a key value that is used to decide whether an item is distinct from another one or not
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.

public final <
the key type
K
>
@NonNull Observable<T>

Returns:

the new Observable instance
distinct
(@NonNull Function<? super T, K>
a function that projects an emitted item to a key value that is used to decide whether an item is distinct from another one or not
keySelector
,
@NonNull Supplier<? extends Collection<? super K>>
function called for each individual Observer to return a Collection subtype for holding the extracted keys and whose add() method's return indicates uniqueness.
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
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.

public final <
the key type
K
>
@NonNull Observable<T>

Returns:

the new Observable instance
distinctUntilChanged
(@NonNull Function<? super T, K>
a function that projects an emitted item to a key value that is used to decide whether an item is distinct from another one or not
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
distinctUntilChanged
(@NonNull BiPredicate<? super T, ? super T>
the function that receives the previous item and the current item and is expected to return true if the two are equal, thus skipping the current value.
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
doAfterNext
(@NonNull Consumer<? super T>
the Consumer that will be called after emitting an item from upstream to the downstream
onAfterNext
)

Calls the specified Consumer with the current item after this item has been emitted to the downstream.

public final @NonNull Observable<T>

Returns:

the new Observable instance
doAfterTerminate
(@NonNull Action
an Action to be invoked after the current Observable finishes
onAfterTerminate
)

Registers an Action to be called when the current Observable invokes either onComplete or onError.

public final @NonNull Observable<T>

Returns:

the new Observable instance
doFinally
(@NonNull Action
the action called when the current Observable terminates or gets disposed
onFinally
)

Calls the specified action after the current Observable signals onError or onCompleted or gets disposed by the downstream.

public final @NonNull Observable<T>

Returns:

the new Observable instance
doOnComplete
(@NonNull Action
the action to invoke when the current Observable calls onComplete
onComplete
)

Returns an Observable that invokes an Action when the current Observable calls onComplete.

public final @NonNull Observable<T>

Returns:

the new Observable instance
doOnDispose
(@NonNull Action
the action that gets called when the current Observable's Disposable is disposed
onDispose
)

Calls the given shared Action if the downstream disposes the sequence.

private @NonNull Observable<T>

Returns:

the new Observable instance
doOnEach
(@NonNull Consumer<? super T>
the Consumer to invoke when the current Observable calls onNext
onNext
,
@NonNull Consumer<? super Throwable>
the Consumer to invoke when the current Observable calls onError
onError
,
@NonNull Action
the Action to invoke when the current Observable calls onComplete
onComplete
,
@NonNull Action
the Action to invoke when the current Observable calls onAfterTerminate
onAfterTerminate
)

Calls the appropriate onXXX consumer (shared between all Observers) whenever a signal with the same type passes through, before forwarding them to the downstream.

public final @NonNull Observable<T>

Returns:

the new Observable instance
doOnEach
(@NonNull Consumer<? super Notification<T>>
the action to invoke for each item emitted by the current Observable
onNotification
)

Returns an Observable that invokes a Consumer with the appropriate Notification object when the current Observable signals an item or terminates.

public final @NonNull Observable<T>

Returns:

the new Observable instance
doOnEach
(@NonNull Observer<? super T>
the observer to be notified about onNext, onError and onComplete events on its respective methods before the actual downstream Observer gets notified.
observer
)

Returns an Observable that forwards the items and terminal events of the current Observable to its Observers and to the given shared Observer instance.

public final @NonNull Observable<T>

Returns:

the new Observable instance
doOnError
(@NonNull Consumer<? super Throwable>
the action to invoke if the current Observable calls onError
onError
)

Calls the given Consumer with the error Throwable if the current Observable failed before forwarding it to the downstream.

public final @NonNull Observable<T>

Returns:

the new Observable instance
doOnLifecycle
(@NonNull Consumer<? super Disposable> onSubscribe, @NonNull Action
called when the downstream disposes the Disposable via dispose()
onDispose
)

Calls the appropriate onXXX method (shared between all Observers) for the lifecycle events of the sequence (subscription, disposal).

public final @NonNull Observable<T>

Returns:

the new Observable instance
doOnNext
(@NonNull Consumer<? super T>
the action to invoke when the current Observable calls onNext
onNext
)

Calls the given Consumer with the value emitted by the current Observable before forwarding it to the downstream.

public final @NonNull Observable<T>

Returns:

the new Observable instance
doOnSubscribe
(@NonNull Consumer<? super Disposable>
the Consumer that gets called when an Observer subscribes to the current Observable
onSubscribe
)

Returns an Observable so that it invokes the given Consumer when the current Observable is subscribed from its Observers.

public final @NonNull Observable<T>

Returns:

the new Observable instance
doOnTerminate
(@NonNull Action
the action to invoke when the current Observable calls onComplete or onError
onTerminate
)

Returns an Observable so that it invokes an action when the current Observable calls onComplete or onError.

public final @NonNull Maybe<T>

Returns:

the new Maybe instance
elementAt
(long
the zero-based index of the item to retrieve
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.

public final @NonNull Single<T>

Returns:

the new Single instance
elementAt
(long
the zero-based index of the item to retrieve
index
,
T
the default item
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.

public final @NonNull Single<T>

Returns:

the new Single instance
elementAtOrError
(long
the zero-based index of the item to retrieve
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.

public static <
the type of the items (ostensibly) emitted by the Observable
T
>
@NonNull Observable<T>

Returns:

the shared Observable instance
empty
()

Returns an Observable that emits no items to the Observer and immediately invokes its onComplete method.

public static <
the type of the items (ostensibly) emitted by the Observable
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
error
(@NonNull Supplier<? extends @NonNull Throwable>
a Supplier factory to return a Throwable for each individual Observer
supplier
)

Returns an Observable that invokes an Observer's onError method when the Observer subscribes to it.

public static <
the type of the items (ostensibly) emitted by the Observable
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
error
(@NonNull Throwable
the particular Throwable to pass to onError
throwable
)

Returns an Observable that invokes an Observer's onError method when the Observer subscribes to it.

public final @NonNull Observable<T>

Returns:

the new Observable instance
filter
(@NonNull Predicate<? super T>
a function that evaluates each item emitted by the current Observable, returning true if it passes the filter
predicate
)

Filters items emitted by the current Observable by only emitting those that satisfy a specified Predicate.

public final @NonNull Single<T>

Returns:

the new Single instance
first
(T
the default item to emit if the current Observable doesn't emit anything
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.

public final @NonNull Maybe<T>

Returns:

the new Maybe instance
firstElement
()

Returns a Maybe that emits only the very first item emitted by the current Observable, or completes if the current Observable is empty.

public final @NonNull Single<T>

Returns:

the new Single instance
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.

public final @NonNull CompletionStage<T>

Returns:

the new CompletionStage instance
firstOrErrorStage
()

Signals the first upstream item or a NoSuchElementException if the upstream is empty via a CompletionStage.

public final @NonNull CompletionStage<T>

Returns:

the new CompletionStage instance
firstStage
(T
the item to signal if the upstream is empty
defaultItem
)

Signals the first upstream item (or the default item if the upstream is empty) via a CompletionStage.

public final <
the value type of the inner ObservableSources and the output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
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 ObservableSources and emitting the results of this merger.

public final <
the value type of the inner ObservableSources and the output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
mapper
,
boolean
if true, exceptions from the current Observable and all inner ObservableSources are delayed until all of them terminate if false, the first one signaling an exception will terminate the whole sequence immediately
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 ObservableSources and emitting the results of this merger.

public final <
the value type of the inner ObservableSources and the output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
mapper
,
boolean
if true, exceptions from the current Observable and all inner ObservableSources are delayed until all of them terminate if false, the first one signaling an exception will terminate the whole sequence immediately
delayErrors
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
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 ObservableSources and emitting the results of this merger, while limiting the maximum number of concurrent subscriptions to these ObservableSources.

public final <
the value type of the inner ObservableSources and the output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
mapper
,
boolean
if true, exceptions from the current Observable and all inner ObservableSources are delayed until all of them terminate if false, the first one signaling an exception will terminate the whole sequence immediately
delayErrors
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
maxConcurrency
,
int
the number of elements expected from each inner ObservableSource to be buffered
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 ObservableSources and emitting the results of this merger, while limiting the maximum number of concurrent subscriptions to these ObservableSources.

public final <
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that returns an ObservableSource to merge for each item emitted by the current Observable
onNextMapper
,
@NonNull Function<? super Throwable, ? extends ObservableSource<? extends R>>
a function that returns an ObservableSource to merge for an onError notification from the current Observable
onErrorMapper
,
@NonNull Supplier<? extends ObservableSource<? extends R>>
a function that returns an ObservableSource to merge for an onComplete notification from the current Observable
onCompleteSupplier
)

Returns an Observable that applies a function to each item emitted or notification raised by the current Observable and then flattens the ObservableSources returned from these functions and emits the resulting items.

public final <
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that returns an ObservableSource to merge for each item emitted by the current Observable
onNextMapper
,
@NonNull Function<Throwable, ? extends ObservableSource<? extends R>>
a function that returns an ObservableSource to merge for an onError notification from the current Observable
onErrorMapper
,
@NonNull Supplier<? extends ObservableSource<? extends R>>
a function that returns an ObservableSource to merge for an onComplete notification from the current Observable
onCompleteSupplier
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
maxConcurrency
)

Returns an Observable that applies a function to each item emitted or notification raised by the current Observable and then flattens the ObservableSources returned from these functions and emits the resulting items, while limiting the maximum number of concurrent subscriptions to these ObservableSources.

public final <
the value type of the inner ObservableSources and the output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
mapper
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
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 ObservableSources and emitting the results of this merger, while limiting the maximum number of concurrent subscriptions to these ObservableSources.

public final <
the type of items emitted by the collection ObservableSource
U
,
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends U>>
a function that returns an ObservableSource for each item emitted by the current Observable
mapper
,
@NonNull BiFunction<? super T, ? super U, ? extends R>
a function that combines one item emitted by each of the source and collection ObservableSources and returns an item to be emitted by the resulting Observable
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.

public final <
the type of items emitted by the collection ObservableSource
U
,
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends U>>
a function that returns an ObservableSource for each item emitted by the current Observable
mapper
,
@NonNull BiFunction<? super T, ? super U, ? extends R>
a function that combines one item emitted by each of the source and collection ObservableSources and returns an item to be emitted by the resulting Observable
combiner
,
boolean
if true, exceptions from the current Observable and all inner ObservableSources are delayed until all of them terminate if false, the first one signaling an exception will terminate the whole sequence immediately
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.

public final <
the type of items emitted by the collection ObservableSource
U
,
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends U>>
a function that returns an ObservableSource for each item emitted by the current Observable
mapper
,
@NonNull BiFunction<? super T, ? super U, ? extends R>
a function that combines one item emitted by each of the source and collection ObservableSources and returns an item to be emitted by the resulting Observable
combiner
,
boolean
if true, exceptions from the current Observable and all inner ObservableSources are delayed until all of them terminate if false, the first one signaling an exception will terminate the whole sequence immediately
delayErrors
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
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 ObservableSources.

public final <
the type of items emitted by the collection ObservableSource
U
,
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends U>>
a function that returns an ObservableSource for each item emitted by the current Observable
mapper
,
@NonNull BiFunction<? super T, ? super U, ? extends R>
a function that combines one item emitted by each of the source and collection ObservableSources and returns an item to be emitted by the resulting Observable
combiner
,
boolean
if true, exceptions from the current Observable and all inner ObservableSources are delayed until all of them terminate if false, the first one signaling an exception will terminate the whole sequence immediately
delayErrors
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
maxConcurrency
,
int
the number of elements expected from the inner ObservableSource to be buffered
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 ObservableSources.

public final <
the type of items emitted by the collection ObservableSource
U
,
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends U>>
a function that returns an ObservableSource for each item emitted by the current Observable
mapper
,
@NonNull BiFunction<? super T, ? super U, ? extends R>
a function that combines one item emitted by each of the source and collection ObservableSources and returns an item to be emitted by the resulting Observable
combiner
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
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 ObservableSources.

public final @NonNull Completable

Returns:

the new Completable instance
flatMapCompletable
(@NonNull Function<? super T, ? extends CompletableSource>
the function that received each source value and transforms them into CompletableSources.
mapper
)

Maps each element of the current Observable into CompletableSources, subscribes to them and waits until the upstream and all CompletableSources complete.

public final @NonNull Completable

Returns:

the new Completable instance
flatMapCompletable
(@NonNull Function<? super T, ? extends CompletableSource>
the function that received each source value and transforms them into CompletableSources.
mapper
,
boolean
if true, errors from the upstream and inner CompletableSources are delayed until all of them terminate.
delayErrors
)

Maps each element of the current Observable into CompletableSources, subscribes to them and waits until the upstream and all CompletableSources complete, optionally delaying all errors.

public final <
the output type and the element type of the Iterables
U
>
@NonNull Observable<U>

Returns:

the new Observable instance
flatMapIterable
(@NonNull Function<? super T, @NonNull ? extends Iterable<? extends U>>
a function that returns an Iterable sequence of values for when given an item emitted by the current Observable
mapper
)

Merges Iterables generated by a mapper Function for each individual item emitted by the current Observable into a single Observable sequence.

public final <
the element type of the Iterables
U
,
the output type as determined by the resultSelector function
V
>
@NonNull Observable<V>

Returns:

the new Observable instance
flatMapIterable
(@NonNull Function<? super T, @NonNull ? extends Iterable<? extends U>>
a function that returns an Iterable sequence of values for each item emitted by the current Observable
mapper
,
@NonNull BiFunction<? super T, ? super U, ? extends V>
a function that returns an item based on the item emitted by the current Observable and the next item of the Iterable returned for that original item by the mapper
combiner
)

Merges Iterables 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.

public final <
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMapMaybe
(@NonNull Function<? super T, ? extends MaybeSource<? extends R>>
the function that received each source value and transforms them into MaybeSources.
mapper
)

Maps each element of the current Observable into MaybeSources, subscribes to all of them and merges their onSuccess values, in no particular order, into a single Observable sequence.

public final <
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMapMaybe
(@NonNull Function<? super T, ? extends MaybeSource<? extends R>>
the function that received each source value and transforms them into MaybeSources.
mapper
,
boolean
if true, errors from the upstream and inner MaybeSources are delayed until all of them terminate.
delayErrors
)

Maps each element of the current Observable into MaybeSources, subscribes to them and merges their onSuccess values, in no particular order, into a single Observable sequence, optionally delaying all errors.

public final <
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMapSingle
(@NonNull Function<? super T, ? extends SingleSource<? extends R>>
the function that received each source value and transforms them into SingleSources.
mapper
)

Maps each element of the current Observable into SingleSources, subscribes to all of them and merges their onSuccess values, in no particular order, into a single Observable sequence.

public final <
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMapSingle
(@NonNull Function<? super T, ? extends SingleSource<? extends R>>
the function that received each source value and transforms them into SingleSources.
mapper
,
boolean
if true, errors from the upstream and inner SingleSources are delayed until each of them terminates.
delayErrors
)

Maps each element of the current Observable into SingleSources, subscribes to them and merges their onSuccess values, in no particular order, into a single Observable sequence, optionally delaying all errors.

public final <
the element type of the Streams and the result
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
flatMapStream
(@NonNull Function<? super T, @NonNull ? extends Stream<? extends R>>
the function that receives an upstream item and should return a Stream whose elements will be emitted to the downstream
mapper
)

Maps each upstream item into a Stream and emits the Stream's items to the downstream in a sequential fashion.

public final @NonNull Disposable

Returns:

a Disposable that allows disposing the sequence if the current Observable runs asynchronously
forEach
(@NonNull Consumer<? super T>
the Consumer to execute for each item.
onNext
)

Subscribes to the ObservableSource and calls a Consumer for each item of the current Observable on its emission thread.

public final @NonNull Disposable

Returns:

a Disposable that allows disposing the sequence if the current Observable runs asynchronously
forEachWhile
(@NonNull Predicate<? super T>
the Predicate to execute for each item.
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.

public final @NonNull Disposable

Returns:

a Disposable that allows disposing the sequence if the current Observable runs asynchronously
forEachWhile
(@NonNull Predicate<? super T>
the Predicate to execute for each item.
onNext
,
@NonNull Consumer<? super Throwable>
the Consumer to execute when an error is emitted.
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.

public final @NonNull Disposable

Returns:

a Disposable that allows disposing the sequence if the current Observable runs asynchronously
forEachWhile
(@NonNull Predicate<? super T>
the Predicate to execute for each item.
onNext
,
@NonNull Consumer<? super Throwable>
the Consumer to execute when an error is emitted.
onError
,
@NonNull Action
the Action to execute when completion is signaled.
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.

public static <
the target type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromAction
(@NonNull Action
the Action to run for each Observer
action
)

Returns an Observable instance that runs the given Action for each Observer and emits either its exception or simply completes.

public static <
the type of items in the array and the type of items to be emitted by the resulting Observable
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromArray
(T...
the array of elements
items
)

Converts an array into an ObservableSource that emits the items in the array.

public static <
the type of the item returned by the Callable and emitted by the Observable
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromCallable
(@NonNull Callable<? extends T>
a function, the execution of which should be deferred; fromCallable will invoke this function only when an observer subscribes to the Observable that fromCallable returns
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.

public static <
the target type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromCompletable
(@NonNull CompletableSource
the CompletableSource to convert from
completableSource
)

Wraps a CompletableSource into an Observable.

public static <
the element type of the CompletionStage
T
>
@NonNull Observable<@NonNull T>

Returns:

the new Observable instance
fromCompletionStage
(@NonNull CompletionStage<T>
the CompletionStage to convert to Observable and signal its terminal value or error
stage
)

Signals the completion value or error of the given (hot) CompletionStage-based asynchronous calculation.

public static <
the type of object that the Future returns, and also the type of item to be emitted by the resulting Observable
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromFuture
(@NonNull Future<? extends T>
the source Future
future
)

Converts a Future into an Observable.

public static <
the type of object that the Future returns, and also the type of item to be emitted by the resulting Observable
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromFuture
(@NonNull Future<? extends T>
the source Future
future
,
long
the maximum time to wait before calling get
timeout
,
@NonNull TimeUnit
the TimeUnit of the timeout argument
unit
)

Converts a Future into an Observable, with a timeout on the Future.

public static <
the type of items in the Iterable sequence and the type of items to be emitted by the resulting Observable
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromIterable
(@NonNull Iterable<? extends T>
the source Iterable sequence
source
)

Converts an Iterable sequence into an Observable that emits the items in the sequence.

public static <
the value type of the MaybeSource element
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromMaybe
(@NonNull MaybeSource<T>
the MaybeSource instance to subscribe to, not null
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.

public static <
the element type of the optional value
T
>
@NonNull Observable<@NonNull T>

Returns:

the new Observable instance
fromOptional
(@NonNull Optional<T>
the optional value to convert into an Observable
optional
)

Converts the existing value of the provided optional into a just(Object) or an empty optional into an empty() Observable instance.

public static <
the value type of the flow
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromPublisher
(@NonNull Publisher<? extends T>
the Publisher to convert
publisher
)

Converts an arbitrary Reactive Streams Publisher into an Observable.

public static <
the target type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromRunnable
(@NonNull Runnable
the Runnable to run for each Observer
run
)

Returns an Observable instance that runs the given Runnable for each Observer and emits either its unchecked exception or simply completes.

public static <
the value type of the SingleSource element
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromSingle
(@NonNull SingleSource<T>
the SingleSource instance to subscribe to, not null
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.

public static <
the element type of the source Stream
T
>
@NonNull Observable<@NonNull T>

Returns:

the new Observable instance
fromStream
(@NonNull Stream<T>
the Stream of values to emit
stream
)

Converts a Stream into a finite Observable and emits its items in the sequence.

public static <
the type of the item emitted by the Observable
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
fromSupplier
(@NonNull Supplier<? extends T>
a function, the execution of which should be deferred; fromSupplier will invoke this function only when an observer subscribes to the Observable that fromSupplier returns
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.

public static <
the generated value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
generate
(@NonNull Consumer<Emitter<T>>
the Consumer called in a loop after a downstream Observer has subscribed. The callback then should call onNext, onError or onComplete to signal a value or a terminal event. Signaling multiple onNext in a call will make the operator signal IllegalStateException.
generator
)

Returns a cold, synchronous and stateless generator of values.

public static <
the generated value type
T
,
the type of the per-Observer state
S
>
@NonNull Observable<T>

Returns:

the new Observable instance
generate
(@NonNull Supplier<S>
the Supplier to generate the initial state for each Observer
initialState
,
@NonNull BiConsumer<S, Emitter<T>>
the BiConsumer called in a loop after a downstream Observer has subscribed. The callback then should call onNext, onError or onComplete to signal a value or a terminal event. Signaling multiple onNext in a call will make the operator signal IllegalStateException.
generator
)

Returns a cold, synchronous and stateful generator of values.

public static <
the generated value type
T
,
the type of the per-Observer state
S
>
@NonNull Observable<T>

Returns:

the new Observable instance
generate
(@NonNull Supplier<S>
the Supplier to generate the initial state for each Observer
initialState
,
@NonNull BiConsumer<S, Emitter<T>>
the BiConsumer called in a loop after a downstream Observer has subscribed. The callback then should call onNext, onError or onComplete to signal a value or a terminal event. Signaling multiple onNext in a call will make the operator signal IllegalStateException.
generator
,
@NonNull Consumer<? super S>
the Consumer that is called with the current state when the generator terminates the sequence or it gets disposed
disposeState
)

Returns a cold, synchronous and stateful generator of values.

public static <
the generated value type
T
,
the type of the per-Observer state
S
>
@NonNull Observable<T>

Returns:

the new Observable instance
generate
(@NonNull Supplier<S>
the Supplier to generate the initial state for each Observer
initialState
,
@NonNull BiFunction<S, Emitter<T>, S>
the BiConsumer called in a loop after a downstream Observer has subscribed. The callback then should call onNext, onError or onComplete to signal a value or a terminal event and should return a (new) state for the next invocation. Signaling multiple onNext in a call will make the operator signal IllegalStateException.
generator
)

Returns a cold, synchronous and stateful generator of values.

public static <
the generated value type
T
,
the type of the per-Observer state
S
>
@NonNull Observable<T>

Returns:

the new Observable instance
generate
(@NonNull Supplier<S>
the Supplier to generate the initial state for each Observer
initialState
,
@NonNull BiFunction<S, Emitter<T>, S>
the BiConsumer called in a loop after a downstream Observer has subscribed. The callback then should call onNext, onError or onComplete to signal a value or a terminal event and should return a (new) state for the next invocation. Signaling multiple onNext in a call will make the operator signal IllegalStateException.
generator
,
@NonNull Consumer<? super S>
the Consumer that is called with the current state when the generator terminates the sequence or it gets disposed
disposeState
)

Returns a cold, synchronous and stateful generator of values.

public final <
the key type
K
>
@NonNull Observable<GroupedObservable<K, T>>

Returns:

the new Observable instance
groupBy
(@NonNull Function<? super T, ? extends K>
a function that extracts the key for each item
keySelector
)

Groups the items emitted by the current Observable according to a specified criterion, and emits these grouped items as GroupedObservables.

public final <
the key type
K
>
@NonNull Observable<GroupedObservable<K, T>>

Returns:

the new Observable instance
groupBy
(@NonNull Function<? super T, ? extends K>
a function that extracts the key for each item
keySelector
,
boolean
if true, the exception from the current Observable is delayed in each group until that specific group emitted the normal values; if false, the exception bypasses values in the groups and is reported immediately.
delayError
)

Groups the items emitted by the current Observable according to a specified criterion, and emits these grouped items as GroupedObservables.

public final <
the key type
K
,
the element type
V
>
@NonNull Observable<GroupedObservable<K, V>>

Returns:

the new Observable instance
groupBy
(@NonNull Function<? super T, ? extends K>
a function that extracts the key for each item
keySelector
,
Function<? super T, ? extends V>
a function that extracts the return element for each item
valueSelector
)

Groups the items emitted by the current Observable according to a specified criterion, and emits these grouped items as GroupedObservables.

public final <
the key type
K
,
the element type
V
>
@NonNull Observable<GroupedObservable<K, V>>

Returns:

the new Observable instance
groupBy
(@NonNull Function<? super T, ? extends K>
a function that extracts the key for each item
keySelector
,
@NonNull Function<? super T, ? extends V>
a function that extracts the return element for each item
valueSelector
,
boolean
if true, the exception from the current Observable is delayed in each group until that specific group emitted the normal values; if false, the exception bypasses values in the groups and is reported immediately.
delayError
)

Groups the items emitted by the current Observable according to a specified criterion, and emits these grouped items as GroupedObservables.

public final <
the key type
K
,
the element type
V
>
@NonNull Observable<GroupedObservable<K, V>>

Returns:

the new Observable instance
groupBy
(@NonNull Function<? super T, ? extends K>
a function that extracts the key for each item
keySelector
,
@NonNull Function<? super T, ? extends V>
a function that extracts the return element for each item
valueSelector
,
boolean
if true, the exception from the current Observable is delayed in each group until that specific group emitted the normal values; if false, the exception bypasses values in the groups and is reported immediately.
delayError
,
int
the hint for how many GroupedObservables and element in each GroupedObservable should be buffered
bufferSize
)

Groups the items emitted by the current Observable according to a specified criterion, and emits these grouped items as GroupedObservables.

public final <
the value type of the right ObservableSource source
TRight
,
the element type of the left duration ObservableSources
TLeftEnd
,
the element type of the right duration ObservableSources
TRightEnd
,
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
groupJoin
(@NonNull ObservableSource<? extends TRight>
the other ObservableSource to correlate items from the current Observable with
other
,
@NonNull Function<? super T, ? extends ObservableSource<TLeftEnd>>
a function that returns an ObservableSource whose emissions indicate the duration of the values of the current Observable
leftEnd
,
@NonNull Function<? super TRight, ? extends ObservableSource<TRightEnd>>
a function that returns an ObservableSource whose emissions indicate the duration of the values of the right ObservableSource
rightEnd
,
@NonNull BiFunction<? super T, ? super Observable<TRight>, ? extends R>
a function that takes an item emitted by each ObservableSource and returns the value to be emitted by the resulting Observable
resultSelector
)

Returns an Observable that correlates two ObservableSources when they overlap in time and groups the results.

public final @NonNull Observable<T>

Returns:

the new Observable instance
hide
()

Hides the identity of the current Observable and its Disposable.

public final @NonNull Completable

Returns:

the new Completable instance
ignoreElements
()

Ignores all items emitted by the current Observable and only calls onComplete or onError.

public static @NonNull Observable<Long>

Returns:

the new Observable instance
interval
(long
the initial delay time to wait before emitting the first value of 0L
initialDelay
,
long
the period of time between emissions of the subsequent numbers
period
,
@NonNull TimeUnit
the time unit for both initialDelay and period
unit
)

Returns an Observable that emits a 0L after the initialDelay and ever increasing numbers after each period of time thereafter.

public static @NonNull Observable<Long>

Returns:

the new Observable instance
interval
(long
the initial delay time to wait before emitting the first value of 0L
initialDelay
,
long
the period of time between emissions of the subsequent numbers
period
,
@NonNull TimeUnit
the time unit for both initialDelay and period
unit
,
@NonNull Scheduler
the Scheduler on which the waiting happens and items are emitted
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.

public static @NonNull Observable<Long>

Returns:

the new Observable instance
interval
(long
the period size in time units (see below)
period
,
@NonNull TimeUnit
time units to use for the interval size
unit
)

Returns an Observable that emits a sequential number every specified interval of time.

public static @NonNull Observable<Long>

Returns:

the new Observable instance
interval
(long
the period size in time units (see below)
period
,
@NonNull TimeUnit
time units to use for the interval size
unit
,
@NonNull Scheduler
the Scheduler to use for scheduling the items
scheduler
)

Returns an Observable that emits a sequential number every specified interval of time, on a specified Scheduler.

public static @NonNull Observable<Long>

Returns:

the new Observable instance
intervalRange
(long
that start value of the range
start
,
long
the number of values to emit in total, if zero, the operator emits an onComplete after the initial delay.
count
,
long
the initial delay before signaling the first value (the start)
initialDelay
,
long
the period between subsequent values
period
,
@NonNull TimeUnit
the unit of measure of the initialDelay and period amounts
unit
)

Signals a range of long values, the first after some initial delay and the rest periodically after.

public static @NonNull Observable<Long>

Returns:

the new Observable instance
intervalRange
(long
that start value of the range
start
,
long
the number of values to emit in total, if zero, the operator emits an onComplete after the initial delay.
count
,
long
the initial delay before signaling the first value (the start)
initialDelay
,
long
the period between subsequent values
period
,
@NonNull TimeUnit
the unit of measure of the initialDelay and period amounts
unit
,
@NonNull Scheduler
the target scheduler where the values and terminal signals will be emitted
scheduler
)

Signals a range of long values, the first after some initial delay and the rest periodically after.

public final @NonNull Single<Boolean>

Returns:

the new Single instance
isEmpty
()

Returns a Single that emits true if the current Observable is empty, otherwise false.

public final <
the value type of the right ObservableSource source
TRight
,
the element type of the left duration ObservableSources
TLeftEnd
,
the element type of the right duration ObservableSources
TRightEnd
,
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
join
(@NonNull ObservableSource<? extends TRight>
the second ObservableSource to join items from
other
,
@NonNull Function<? super T, ? extends ObservableSource<TLeftEnd>>
a function to select a duration for each item emitted by the current Observable, used to determine overlap
leftEnd
,
@NonNull Function<? super TRight, ? extends ObservableSource<TRightEnd>>
a function to select a duration for each item emitted by the right ObservableSource, used to determine overlap
rightEnd
,
@NonNull BiFunction<? super T, ? super TRight, ? extends R>
a function that computes an item to be emitted by the resulting Observable for any two overlapping items emitted by the two ObservableSources
resultSelector
)

Correlates the items emitted by two ObservableSources based on overlapping durations.

public static <
the type of that item
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
just
(T
the item to emit
item
)

Returns an Observable that signals the given (constant reference) item and then completes.

public static <
the type of these items
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
just
(T
first item
item1
,
T
second item
item2
)

Converts two items into an Observable that emits those items.

public static <
the type of these items
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
just
(T
first item
item1
,
T
second item
item2
,
T
third item
item3
)

Converts three items into an Observable that emits those items.

public static <
the type of these items
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
just
(T
first item
item1
,
T
second item
item2
,
T
third item
item3
,
T
fourth item
item4
)

Converts four items into an Observable that emits those items.

public static <
the type of these items
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
just
(T
first item
item1
,
T
second item
item2
,
T
third item
item3
,
T
fourth item
item4
,
T
fifth item
item5
)

Converts five items into an Observable that emits those items.

public static <
the type of these items
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
just
(T
first item
item1
,
T
second item
item2
,
T
third item
item3
,
T
fourth item
item4
,
T
fifth item
item5
,
T
sixth item
item6
)

Converts six items into an Observable that emits those items.

public static <
the type of these items
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
just
(T
first item
item1
,
T
second item
item2
,
T
third item
item3
,
T
fourth item
item4
,
T
fifth item
item5
,
T
sixth item
item6
,
T
seventh item
item7
)

Converts seven items into an Observable that emits those items.

public static <
the type of these items
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
just
(T
first item
item1
,
T
second item
item2
,
T
third item
item3
,
T
fourth item
item4
,
T
fifth item
item5
,
T
sixth item
item6
,
T
seventh item
item7
,
T
eighth item
item8
)

Converts eight items into an Observable that emits those items.

public static <
the type of these items
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
just
(T
first item
item1
,
T
second item
item2
,
T
third item
item3
,
T
fourth item
item4
,
T
fifth item
item5
,
T
sixth item
item6
,
T
seventh item
item7
,
T
eighth item
item8
,
T
ninth item
item9
)

Converts nine items into an Observable that emits those items.

public static <
the type of these items
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
just
(T
first item
item1
,
T
second item
item2
,
T
third item
item3
,
T
fourth item
item4
,
T
fifth item
item5
,
T
sixth item
item6
,
T
seventh item
item7
,
T
eighth item
item8
,
T
ninth item
item9
,
T
tenth item
item10
)

Converts ten items into an Observable that emits those items.

public final @NonNull Single<T>

Returns:

the new Single instance
last
(T
the default item to emit if the current Observable is empty
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.

public final @NonNull Maybe<T>

Returns:

the new Maybe instance
lastElement
()

Returns a Maybe that emits the last item emitted by the current Observable or completes if the current Observable is empty.

public final @NonNull Single<T>

Returns:

the new Single instance
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.

public final @NonNull CompletionStage<T>

Returns:

the new CompletionStage instance
lastOrErrorStage
()

Signals the last upstream item or a NoSuchElementException if the upstream is empty via a CompletionStage.

public final @NonNull CompletionStage<T>

Returns:

the new CompletionStage instance
lastStage
(T
the item to signal if the upstream is empty
defaultItem
)

Signals the last upstream item (or the default item if the upstream is empty) via a CompletionStage.

public final <
the output value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
lift
(@NonNull ObservableOperator<? extends R, ? super T>
the ObservableOperator that receives the downstream's Observer and should return an Observer with custom behavior to be used as the consumer for the current Observable.
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.

public final <
the output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
map
(@NonNull Function<? super T, ? extends R>
a function to apply to each item emitted by the current Observable
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.

public final <
the non-null output type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
mapOptional
(@NonNull Function<? super T, @NonNull Optional<? extends R>>
the function that receives the upstream item and should return a non-empty Optional to emit as the output or an empty Optional to skip to the next upstream value
mapper
)

Maps each upstream value into an Optional and emits the contained item if not empty.

public final @NonNull Observable<Notification<T>>

Returns:

the new Observable instance
materialize
()

Returns an Observable that represents all of the emissions and notifications from the current Observable into emissions marked with their original types within Notification objects.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
merge
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the Iterable of ObservableSources
sources
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
maxConcurrency
,
int
the number of items expected from each inner ObservableSource to be buffered
bufferSize
)

Flattens an Iterable of ObservableSources into one Observable, without any transformation, while limiting the number of concurrent subscriptions to these ObservableSources.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
merge
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the Iterable of ObservableSources
sources
)

Flattens an Iterable of ObservableSources into one Observable, without any transformation.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
merge
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the Iterable of ObservableSources
sources
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
maxConcurrency
)

Flattens an Iterable of ObservableSources into one Observable, without any transformation, while limiting the number of concurrent subscriptions to these ObservableSources.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
merge
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
an ObservableSource that emits ObservableSources
sources
)

Flattens an ObservableSource that emits ObservableSources into a single Observable that emits the items emitted by those ObservableSources, without any transformation.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
merge
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
an ObservableSource that emits ObservableSources
sources
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
maxConcurrency
)

Flattens an ObservableSource that emits ObservableSources into a single Observable that emits the items emitted by those ObservableSources, without any transformation, while limiting the maximum number of concurrent subscriptions to these ObservableSources.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
merge
(@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source1
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source2
)

Flattens two ObservableSources into a single Observable, without any transformation.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
merge
(@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source1
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source2
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source3
)

Flattens three ObservableSources into a single Observable, without any transformation.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
merge
(@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source1
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source2
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source3
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source4
)

Flattens four ObservableSources into a single Observable, without any transformation.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeArray
(int
the maximum number of ObservableSources that may be subscribed to concurrently
maxConcurrency
,
int
the number of items expected from each inner ObservableSource to be buffered
bufferSize
,
@NonNull ObservableSource<? extends T>...
the array of ObservableSources
sources
)

Flattens an array of ObservableSources into one Observable, without any transformation, while limiting the number of concurrent subscriptions to these ObservableSources.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeArray
(@NonNull ObservableSource<? extends T>...
the array of ObservableSources
sources
)

Flattens an array of ObservableSources into one Observable, without any transformation.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeArrayDelayError
(int
the maximum number of ObservableSources that may be subscribed to concurrently
maxConcurrency
,
int
the number of items expected from each inner ObservableSource to be buffered
bufferSize
,
@NonNull ObservableSource<? extends T>...
the array of ObservableSources
sources
)

Flattens an array of ObservableSources into one Observable, in a way that allows an Observer to receive all successfully emitted items from each of the ObservableSources without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to these ObservableSources.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeArrayDelayError
(@NonNull ObservableSource<? extends T>...
the array of ObservableSources
sources
)

Flattens an array of ObservableSources into one Observable, in a way that allows an Observer to receive all successfully emitted items from each of the ObservableSources without being interrupted by an error notification from one of them.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeDelayError
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the Iterable of ObservableSources
sources
)

Flattens an Iterable of ObservableSources into one Observable, in a way that allows an Observer to receive all successfully emitted items from each of the returned ObservableSources without being interrupted by an error notification from one of them.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeDelayError
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the Iterable of ObservableSources
sources
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
maxConcurrency
,
int
the number of items expected from each inner ObservableSource to be buffered
bufferSize
)

Flattens an Iterable of ObservableSources into one Observable, in a way that allows an Observer to receive all successfully emitted items from each of the returned ObservableSources without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to these ObservableSources.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeDelayError
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
the Iterable of ObservableSources
sources
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
maxConcurrency
)

Flattens an Iterable of ObservableSources into one Observable, in a way that allows an Observer to receive all successfully emitted items from each of the returned ObservableSources without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to these ObservableSources.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeDelayError
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
an ObservableSource that emits ObservableSources
sources
)

Flattens an ObservableSource that emits ObservableSources into one Observable, in a way that allows an Observer to receive all successfully emitted items from all of the emitted ObservableSources without being interrupted by an error notification from one of them.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeDelayError
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
an ObservableSource that emits ObservableSources
sources
,
int
the maximum number of ObservableSources that may be subscribed to concurrently
maxConcurrency
)

Flattens an ObservableSource that emits ObservableSources into one Observable, in a way that allows an Observer to receive all successfully emitted items from all of the emitted ObservableSources without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to these ObservableSources.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeDelayError
(@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source1
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source2
)

Flattens two ObservableSources into one Observable, in a way that allows an Observer to receive all successfully emitted items from each of the ObservableSources without being interrupted by an error notification from one of them.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeDelayError
(@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source1
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source2
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source3
)

Flattens three ObservableSources into one Observable, in a way that allows an Observer to receive all successfully emitted items from all of the ObservableSources without being interrupted by an error notification from one of them.

public static <
the common element base type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
mergeDelayError
(@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source1
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source2
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source3
,
@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
source4
)

Flattens four ObservableSources into one Observable, in a way that allows an Observer to receive all successfully emitted items from all of the ObservableSources without being interrupted by an error notification from one of them.

public final @NonNull Observable<T>

Returns:

the new Observable instance
mergeWith
(@NonNull ObservableSource<? extends T>
an ObservableSource to be merged
other
)

Flattens the current Observable and another ObservableSource into a single Observable sequence, without any transformation.

public final @NonNull Observable<T>

Returns:

the new Observable instance
mergeWith
(@NonNull SingleSource<? extends T>
the SingleSource whose success value to merge with
other
)

Merges the sequence of items of the current Observable with the success value of the other SingleSource.

public final @NonNull Observable<T>

Returns:

the new Observable instance
mergeWith
(@NonNull MaybeSource<? extends T>
the MaybeSource which provides a success value to merge with or completes
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
mergeWith
(@NonNull CompletableSource
the CompletableSource to await for completion
other
)

Relays the items of the current Observable and completes only when the other CompletableSource completes as well.

public static <
the type of items (not) emitted by the Observable
T
>
@NonNull Observable<T>

Returns:

the shared Observable instance
never
()

Returns an Observable that never sends any items or notifications to an Observer.

public final @NonNull Observable<T>

Returns:

the new Observable instance
observeOn
(@NonNull Scheduler
the Scheduler to notify Observers on
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".

public final @NonNull Observable<T>

Returns:

the new Observable instance
observeOn
(@NonNull Scheduler
the Scheduler to notify Observers on
scheduler
,
boolean
indicates if the onError notification may not cut ahead of onNext notification on the other side of the scheduling boundary. If true, a sequence ending in onError will be replayed in the same order as was received from the current Observable
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
observeOn
(@NonNull Scheduler
the Scheduler to notify Observers on
scheduler
,
boolean
indicates if the onError notification may not cut ahead of onNext notification on the other side of the scheduling boundary. If true a sequence ending in onError will be replayed in the same order as was received from upstream
delayError
,
int
the size of the buffer.
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.

public final <
the output type
U
>
@NonNull Observable<U>

Returns:

the new Observable instance
ofType
(@NonNull Class<U>
the class type to filter the items emitted by the current Observable
clazz
)

Filters the items emitted by the current Observable, only emitting those of the specified type.

public final @NonNull Observable<T>

Returns:

the new Observable instance
onErrorComplete
()

Returns an Observable instance that if the current Observable emits an error, it will emit an onComplete and swallow the throwable.

public final @NonNull Observable<T>

Returns:

the new Observable instance
onErrorComplete
(@NonNull Predicate<? super Throwable>
the predicate to call when an Throwable is emitted which should return true if the Throwable should be swallowed and replaced with an onComplete.
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
onErrorResumeNext
(@NonNull Function<? super Throwable, ? extends ObservableSource<? extends T>>
a function that returns an ObservableSource that will take over if the current Observable encounters an error
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
onErrorResumeWith
(@NonNull ObservableSource<? extends T>
the next ObservableSource source that will take over if the current Observable encounters an error
fallback
)

Resumes the flow with the given ObservableSource when the current Observable fails instead of signaling the error via onError.

public final @NonNull Observable<T>

Returns:

the new Observable instance
onErrorReturn
(@NonNull Function<? super Throwable, ? extends T>
a function that returns a single value that will be emitted along with a regular onComplete in case the current Observable signals an onError event
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
onErrorReturnItem
(T
the value that is emitted along with a regular onComplete in case the current Observable signals an exception
item
)

Ends the flow with the given last item when the current Observable fails instead of signaling the error via onError.

public final @NonNull Observable<T>

Returns:

the new Observable instance the sequence is terminated or downstream calls dispose()
onTerminateDetach
()

Nulls out references to the upstream producer and downstream Observer if the sequence is terminated or downstream calls dispose().

public final @NonNull ConnectableObservable<T>

Returns:

the new ConnectableObservable instance
publish
()

Returns a ConnectableObservable, which is a variety of ObservableSource that waits until its connect method is called before it begins emitting items to those Observers that have subscribed to it.

public final <
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
publish
(@NonNull Function<? super Observable<T>, ? extends ObservableSource<R>>
a function that can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Observers to the given source will receive all notifications of the source from the time of the subscription forward.
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.

public static @NonNull Observable<Integer>

Returns:

the new Observable instance
range
(int
the value of the first Integer in the sequence
start
,
int
the number of sequential Integers to generate
count
)

Returns an Observable that emits a sequence of Integers within a specified range.

public static @NonNull Observable<Long>

Returns:

the new Observable instance
rangeLong
(long
the value of the first Long in the sequence
start
,
long
the number of sequential Longs to generate
count
)

Returns an Observable that emits a sequence of Longs within a specified range.

public final @NonNull Maybe<T>

Returns:

the new Maybe instance
reduce
(@NonNull BiFunction<T, T, T>
an accumulator function to be invoked on each item emitted by the current Observable, whose result will be used in the next accumulator call
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.

public final <
the accumulator and output value type
R
>
@NonNull Single<R>

Returns:

the new Single instance
reduce
(R
the initial (seed) accumulator value
seed
,
@NonNull BiFunction<R, ? super T, R>
an accumulator function to be invoked on each item emitted by the current Observable, the result of which will be used in the next accumulator call
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.

public final <
the accumulator and output value type
R
>
@NonNull Single<R>

Returns:

the new Single instance
reduceWith
(@NonNull Supplier<R>
the Supplier that provides the initial (seed) accumulator value for each individual Observer
seedSupplier
,
@NonNull BiFunction<R, ? super T, R>
an accumulator function to be invoked on each item emitted by the current Observable, the result of which will be used in the next accumulator call
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
repeat
()

Returns an Observable that repeats the sequence of items emitted by the current Observable indefinitely.

public final @NonNull Observable<T>

Returns:

the new Observable instance
repeat
(long
the number of times the current Observable items are repeated, a count of 0 will yield an empty sequence
times
)

Returns an Observable that repeats the sequence of items emitted by the current Observable at most count times.

public final @NonNull Observable<T>

Returns:

the new Observable instance
repeatUntil
(@NonNull BooleanSupplier
a boolean supplier that is called when the current Observable completes; if it returns true, the returned Observable completes; if it returns false, the current Observable is resubscribed.
stop
)

Returns an Observable that repeats the sequence of items emitted by the current Observable until the provided stop function returns true.

public final @NonNull Observable<T>

Returns:

the new Observable instance
repeatWhen
(@NonNull Function<? super Observable<Object>, ? extends ObservableSource<?>>
receives an ObservableSource of notifications with which a user can complete or error, aborting the repeat.
handler
)

Returns an Observable that emits the same values as the current Observable with the exception of an onComplete.

public final @NonNull ConnectableObservable<T>

Returns:

the new ConnectableObservable instance
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.

public final <
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
replay
(@NonNull Function<? super Observable<T>, ? extends ObservableSource<R>>
the selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the current Observable
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.

public final <
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
replay
(@NonNull Function<? super Observable<T>, ? extends ObservableSource<R>>
the selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the current Observable
selector
,
int
the buffer size that limits the number of items the connectable Observable can replay
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.

public final <
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
replay
(@NonNull Function<? super Observable<T>, ? extends ObservableSource<R>>
the selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the current Observable
selector
,
int
the buffer size that limits the number of items the connectable Observable can replay
bufferSize
,
boolean
if true, whenever the internal buffer is truncated to the given bufferSize, the oldest item will be guaranteed dereferenced, thus avoiding unexpected retention
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.

public final <
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
replay
(@NonNull Function<? super Observable<T>, ? extends ObservableSource<R>>
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the current Observable
selector
,
int
the buffer size that limits the number of items the connectable Observable can replay
bufferSize
,
long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
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.

public final <
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
replay
(@NonNull Function<? super Observable<T>, ? extends ObservableSource<R>>
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the current Observable
selector
,
int
the buffer size that limits the number of items the connectable Observable can replay
bufferSize
,
long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the Scheduler that is the time source for the window
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.

public final <
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
replay
(@NonNull Function<? super Observable<T>, ? extends ObservableSource<R>>
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the current Observable
selector
,
int
the buffer size that limits the number of items the connectable Observable can replay
bufferSize
,
long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the Scheduler that is the time source for the window
scheduler
,
boolean
if true, whenever the internal buffer is truncated to the given bufferSize/age, the oldest item will be guaranteed dereferenced, thus avoiding unexpected retention
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.

public final <
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
replay
(@NonNull Function<? super Observable<T>, ? extends ObservableSource<R>>
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the current Observable
selector
,
long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
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.

public final <
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
replay
(@NonNull Function<? super Observable<T>, ? extends ObservableSource<R>>
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the current Observable
selector
,
long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the scheduler that is the time source for the window
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.

public final <
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
replay
(@NonNull Function<? super Observable<T>, ? extends ObservableSource<R>>
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the current Observable
selector
,
long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the scheduler that is the time source for the window
scheduler
,
boolean
if true, whenever the internal buffer is truncated to the given age, the oldest item will be guaranteed dereferenced, thus avoiding unexpected retention
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.

public final @NonNull ConnectableObservable<T>

Returns:

the new ConnectableObservable instance
replay
(int
the buffer size that limits the number of items that can be replayed
bufferSize
)

Returns a ConnectableObservable that shares a single subscription to the current Observable that replays at most bufferSize items emitted by the current Observable.

public final @NonNull ConnectableObservable<T>

Returns:

the new ConnectableObservable instance
replay
(int
the buffer size that limits the number of items that can be replayed
bufferSize
,
boolean
if true, whenever the internal buffer is truncated to the given bufferSize/age, the oldest item will be guaranteed dereferenced, thus avoiding unexpected retention
eagerTruncate
)

Returns a ConnectableObservable that shares a single subscription to the current Observable that replays at most bufferSize items emitted by the current Observable.

public final @NonNull ConnectableObservable<T>

Returns:

the new ConnectableObservable instance
replay
(int
the buffer size that limits the number of items that can be replayed
bufferSize
,
long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
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.

public final @NonNull ConnectableObservable<T>

Returns:

the new ConnectableObservable instance
replay
(int
the buffer size that limits the number of items that can be replayed
bufferSize
,
long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the scheduler that is used as a time source for the window
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.

public final @NonNull ConnectableObservable<T>

Returns:

the new ConnectableObservable instance
replay
(int
the buffer size that limits the number of items that can be replayed
bufferSize
,
long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the scheduler that is used as a time source for the window
scheduler
,
boolean
if true, whenever the internal buffer is truncated to the given bufferSize/age, the oldest item will be guaranteed dereferenced, thus avoiding unexpected retention
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.

public final @NonNull ConnectableObservable<T>

Returns:

the new ConnectableObservable instance
replay
(long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
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.

public final @NonNull ConnectableObservable<T>

Returns:

the new ConnectableObservable instance
replay
(long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the Scheduler that is the time source for the window
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.

public final @NonNull ConnectableObservable<T>

Returns:

the new ConnectableObservable instance
replay
(long
the duration of the window in which the replayed items must have been emitted
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the Scheduler that is the time source for the window
scheduler
,
boolean
if true, whenever the internal buffer is truncated to the given bufferSize/age, the oldest item will be guaranteed dereferenced, thus avoiding unexpected retention
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
retry
()

Returns an Observable that mirrors the current Observable, resubscribing to it if it calls onError (infinite retry count).

public final @NonNull Observable<T>

Returns:

the new Observable instance
retry
(@NonNull BiPredicate<? super Integer, ? super Throwable>
the predicate that determines if a resubscription may happen in case of a specific exception and retry count
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
retry
(long
the number of times to resubscribe if the current Observable fails
times
)

Returns an Observable that mirrors the current Observable, resubscribing to it if it calls onError up to a specified number of retries.

public final @NonNull Observable<T>

Returns:

the new Observable instance
retry
(long
the number of times to resubscribe if the current Observable fails
times
,
@NonNull Predicate<? super Throwable>
the predicate called with the failure Throwable and should return true to trigger a retry.
predicate
)

Retries at most times or until the predicate returns false, whichever happens first.

public final @NonNull Observable<T>

Returns:

the new Observable instance
retry
(@NonNull Predicate<? super Throwable>
the predicate that receives the failure Throwable and should return true to trigger a retry.
predicate
)

Retries the current Observable if the predicate returns true.

public final @NonNull Observable<T>

Returns:

the new Observable instance
retryUntil
(@NonNull BooleanSupplier
the function that should return true to stop retrying
stop
)

Retries until the given stop function returns true.

public final @NonNull Observable<T>

Returns:

the new Observable instance
retryWhen
(@NonNull Function<? super Observable<Throwable>, ? extends ObservableSource<?>>
receives an Observable of notifications with which a user can complete or error, aborting the retry
handler
)

Returns an Observable that emits the same values as the current Observable with the exception of an onError.

public final void
safeSubscribe(@NonNull Observer<? super T>
the incoming Observer instance
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 Streams specification).

public final @NonNull Observable<T>

Returns:

the new Observable instance
sample
(long
the sampling rate
period
,
@NonNull TimeUnit
the TimeUnit in which period is defined
unit
)

Returns an Observable that emits the most recently emitted item (if any) emitted by the current Observable within periodic time intervals.

public final @NonNull Observable<T>

Returns:

the new Observable instance
sample
(long
the sampling rate
period
,
@NonNull TimeUnit
the TimeUnit in which period is defined
unit
,
boolean
if true and the upstream completes while there is still an unsampled item available, that item is emitted to downstream before completion if false, an unsampled last item is ignored.
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
sample
(long
the sampling rate
period
,
@NonNull TimeUnit
the TimeUnit in which period is defined
unit
,
@NonNull Scheduler
the Scheduler to use when sampling
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
sample
(long
the sampling rate
period
,
@NonNull TimeUnit
the TimeUnit in which period is defined
unit
,
@NonNull Scheduler
the Scheduler to use when sampling
scheduler
,
boolean
if true and the upstream completes while there is still an unsampled item available, that item is emitted to downstream before completion if false, an unsampled last item is ignored.
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
sample
(long
the sampling rate
period
,
@NonNull TimeUnit
the TimeUnit in which period is defined
unit
,
@NonNull Scheduler
the Scheduler to use when sampling
scheduler
,
boolean
if true and the upstream completes while there is still an unsampled item available, that item is emitted to downstream before completion if false, an unsampled last item is ignored.
emitLast
,
@NonNull Consumer<? super T>
called with the current entry when it has been replaced by a new one
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.

public final <
the element type of the sampler ObservableSource
U
>
@NonNull Observable<T>

Returns:

the new Observable instance
sample
(@NonNull ObservableSource<U>
the ObservableSource to use for sampling the current Observable
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.

public final <
the element type of the sampler ObservableSource
U
>
@NonNull Observable<T>

Returns:

the new Observable instance
sample
(@NonNull ObservableSource<U>
the ObservableSource to use for sampling the current Observable
sampler
,
boolean
if true and the upstream completes while there is still an unsampled item available, that item is emitted to downstream before completion if false, an unsampled last item is ignored.
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
scan
(@NonNull BiFunction<T, T, T>
an accumulator function to be invoked on each item emitted by the current Observable, whose result will be emitted to Observers via onNext and used in the next accumulator call
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.

public final <
the initial, accumulator and result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
scan
(R
the initial (seed) accumulator item
initialValue
,
@NonNull BiFunction<R, ? super T, R>
an accumulator function to be invoked on each item emitted by the current Observable, whose result will be emitted to Observers via onNext and used in the next accumulator call
accumulator
)

Returns an Observable that emits the provided initial (seed) value, then emits one value for each value emitted by the current Observable.

public final <
the initial, accumulator and result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
scanWith
(@NonNull Supplier<R>
a Supplier that returns the initial (seed) accumulator item for each individual Observer
seedSupplier
,
@NonNull BiFunction<R, ? super T, R>
an accumulator function to be invoked on each item emitted by the current Observable, whose result will be emitted to Observers via onNext and used in the next accumulator call
accumulator
)

Returns an Observable that emits the provided initial (seed) value, then emits one value for each value emitted by the current Observable.

public static <
the type of items emitted by each ObservableSource
T
>
@NonNull Single<Boolean>

Returns:

the new Single instance
sequenceEqual
(@NonNull ObservableSource<? extends T>
the first ObservableSource to compare
source1
,
@NonNull ObservableSource<? extends T>
the second ObservableSource to compare
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.

public static <
the type of items emitted by each ObservableSource
T
>
@NonNull Single<Boolean>

Returns:

the new Single instance
sequenceEqual
(@NonNull ObservableSource<? extends T>
the first ObservableSource to compare
source1
,
@NonNull ObservableSource<? extends T>
the second ObservableSource to compare
source2
,
@NonNull BiPredicate<? super T, ? super T>
a function used to compare items emitted by each ObservableSource
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.

public static <
the type of items emitted by each ObservableSource
T
>
@NonNull Single<Boolean>

Returns:

the new Single instance
sequenceEqual
(@NonNull ObservableSource<? extends T>
the first ObservableSource to compare
source1
,
@NonNull ObservableSource<? extends T>
the second ObservableSource to compare
source2
,
@NonNull BiPredicate<? super T, ? super T>
a function used to compare items emitted by each ObservableSource
isEqual
,
int
the number of items expected from the first and second source ObservableSource to be buffered
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.

public static <
the type of items emitted by each ObservableSource
T
>
@NonNull Single<Boolean>

Returns:

the new Single instance
sequenceEqual
(@NonNull ObservableSource<? extends T>
the first ObservableSource to compare
source1
,
@NonNull ObservableSource<? extends T>
the second ObservableSource to compare
source2
,
int
the number of items expected from the first and second source ObservableSource to be buffered
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
serialize
()

Forces the current Observable's emissions and notifications to be serialized and for it to obey the ObservableSource contract in other ways.

public final @NonNull Observable<T>

Returns:

the new Observable instance
share
()

Returns a new Observable that multicasts (and shares a single subscription to) the current Observable.

public final @NonNull Single<T>

Returns:

the new Single instance
single
(T
a default value to emit if the current Observable emits no item
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.

public final @NonNull Maybe<T>

Returns:

the new Maybe instance
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.

public final @NonNull Single<T>

Returns:

the new Single instance
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.

public final @NonNull CompletionStage<T>

Returns:

the new CompletionStage instance
singleOrErrorStage
()

Signals the only expected upstream item, a NoSuchElementException if the upstream is empty or signals IllegalArgumentException if the upstream has more than one item via a CompletionStage.

public final @NonNull CompletionStage<T>

Returns:

the new CompletionStage instance
singleStage
(T
the item to signal if the upstream is empty
defaultItem
)

Signals the only expected upstream item (or the default item if the upstream is empty) or signals IllegalArgumentException if the upstream has more than one item via a CompletionStage.

public final @NonNull Observable<T>

Returns:

the new Observable instance
skip
(long
the number of items to skip
count
)

Returns an Observable that skips the first count items emitted by the current Observable and emits the remainder.

public final @NonNull Observable<T>

Returns:

the new Observable instance
skip
(long
the length of the time window to skip
time
,
@NonNull TimeUnit
the time unit of time
unit
)

Returns an Observable that skips values emitted by the current Observable before a specified time window elapses.

public final @NonNull Observable<T>

Returns:

the new Observable instance
skip
(long
the length of the time window to skip
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the Scheduler on which the timed wait happens
scheduler
)

Returns an Observable that skips values emitted by the current Observable before a specified time window on a specified Scheduler elapses.

public final @NonNull Observable<T>

Returns:

the new Observable instance
skipLast
(int
number of items to drop from the end of the source sequence
count
)

Returns an Observable that drops a specified number of items from the end of the sequence emitted by the current Observable.

public final @NonNull Observable<T>

Returns:

the new Observable instance
skipLast
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
)

Returns an Observable that drops items emitted by the current Observable during a specified time window before the source completes.

public final @NonNull Observable<T>

Returns:

the new Observable instance
skipLast
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
,
boolean
if true, an exception signaled by the current Observable is delayed until the regular elements are consumed by the downstream; if false, an exception is immediately signaled and all regular elements dropped
delayError
)

Returns an Observable that drops items emitted by the current Observable during a specified time window before the source completes.

public final @NonNull Observable<T>

Returns:

the new Observable instance
skipLast
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the scheduler used as the time source
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
skipLast
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the scheduler used as the time source
scheduler
,
boolean
if true, an exception signaled by the current Observable is delayed until the regular elements are consumed by the downstream; if false, an exception is immediately signaled and all regular elements dropped
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
skipLast
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the scheduler used as the time source
scheduler
,
boolean
if true, an exception signaled by the current Observable is delayed until the regular elements are consumed by the downstream; if false, an exception is immediately signaled and all regular elements dropped
delayError
,
int
the hint about how many elements to expect to be skipped
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.

public final <
the element type of the other ObservableSource
U
>
@NonNull Observable<T>

Returns:

the new Observable instance
skipUntil
(@NonNull ObservableSource<U>
the second ObservableSource that has to emit an item before the current Observable's elements begin to be mirrored by the resulting Observable
other
)

Returns an Observable that skips items emitted by the current Observable until a second ObservableSource emits an item.

public final @NonNull Observable<T>

Returns:

the new Observable instance
skipWhile
(@NonNull Predicate<? super T>
a function to test each item emitted from the current Observable
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
sorted
()

Returns an Observable that emits the events emitted by the current Observable, in a sorted order.

public final @NonNull Observable<T>

Returns:

the new Observable instance
sorted
(@NonNull Comparator<? super T>
a function that compares two items emitted by the current Observable and returns an int that indicates their sort order
comparator
)

Returns an Observable that emits the events emitted by the current Observable, in a sorted order based on a specified comparison function.

public final @NonNull Observable<T>

Returns:

the new Observable instance
startWith
(@NonNull CompletableSource
the other CompletableSource to run first
other
)

Returns an Observable which first runs the other CompletableSource then the current Observable if the other completed normally.

public final @NonNull Observable<T>

Returns:

the new Observable instance
startWith
(@NonNull SingleSource<T>
the other SingleSource to run first
other
)

Returns an Observable which first runs the other SingleSource then the current Observable if the other succeeded normally.

public final @NonNull Observable<T>

Returns:

the new Observable instance
startWith
(@NonNull MaybeSource<T>
the other MaybeSource to run first
other
)

Returns an Observable which first runs the other MaybeSource then the current Observable if the other succeeded or completed normally.

public final @NonNull Observable<T>

Returns:

the new Observable instance
startWith
(@NonNull ObservableSource<? extends T>
an ObservableSource that contains the items you want the modified ObservableSource to emit first
other
)

Returns an Observable that emits the items in a specified ObservableSource before it begins to emit items emitted by the current Observable.

public final @NonNull Observable<T>

Returns:

the new Observable instance
startWithArray
(T...
the array of values to emit first
items
)

Returns an Observable that emits the specified items before it begins to emit items emitted by the current Observable.

public final @NonNull Observable<T>

Returns:

the new Observable instance
startWithItem
(T
the item to emit first
item
)

Returns an Observable that emits a specified item before it begins to emit items emitted by the current Observable.

public final @NonNull Observable<T>

Returns:

the new Observable instance
startWithIterable
(@NonNull Iterable<? extends T>
an Iterable that contains the items you want the resulting Observable to emit first
items
)

Returns an Observable that emits the items in a specified Iterable before it begins to emit items emitted by the current Observable.

public final @NonNull Disposable

Returns:

the new Disposable instance that can be used to dispose the subscription at any time
subscribe
()

Subscribes to the current Observable and ignores onNext and onComplete emissions.

public final @NonNull Disposable

Returns:

the new Disposable instance that can be used to dispose the subscription at any time
subscribe
(@NonNull Consumer<? super T>
the Consumer<T> you have designed to accept emissions from the current Observable
onNext
)

Subscribes to the current Observable and provides a callback to handle the items it emits.

public final @NonNull Disposable

Returns:

the new Disposable instance that can be used to dispose the subscription at any time
subscribe
(@NonNull Consumer<? super T>
the Consumer<T> you have designed to accept emissions from the current Observable
onNext
,
@NonNull Consumer<? super Throwable>
the Consumer<Throwable> you have designed to accept any error notification from the current Observable
onError
)

Subscribes to the current Observable and provides callbacks to handle the items it emits and any error notification it signals.

public final @NonNull Disposable

Returns:

the new Disposable instance that can be used to dispose the subscription at any time
subscribe
(@NonNull Consumer<? super T>
the Consumer<T> you have designed to accept emissions from the current Observable
onNext
,
@NonNull Consumer<? super Throwable>
the Consumer<Throwable> you have designed to accept any error notification from the current Observable
onError
,
@NonNull Action
the Action you have designed to accept a completion notification from the current Observable
onComplete
)

Subscribes to the current Observable and provides callbacks to handle the items it emits and any error or completion notification it signals.

public final @NonNull Disposable

Returns:

the Disposable that allows disposing the particular subscription.
subscribe
(@NonNull Consumer<? super T>
the callback for upstream items
onNext
,
@NonNull Consumer<? super Throwable>
the callback for an upstream error if any
onError
,
@NonNull Action
the callback for the upstream completion if any
onComplete
,
@NonNull DisposableContainer
the DisposableContainer (such as CompositeDisposable) to add and remove the created Disposable Observer
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.

public final void
subscribe(@NonNull Observer<? super T> observer)

protected abstract void
subscribeActual(@NonNull Observer<? super T>
the incoming Observer, never null
observer
)

Operator implementations (both source and intermediate) should implement this method that performs the necessary business logic and handles the incoming Observers.

public final @NonNull Observable<T>

Returns:

the new Observable instance
subscribeOn
(@NonNull Scheduler
the Scheduler to perform subscription actions on
scheduler
)

Asynchronously subscribes Observers to the current Observable on the specified Scheduler.

public final <
the type of the Observer to use and return
E extends Observer<? super T>
>
E

Returns:

the input observer
subscribeWith
(E
the Observer (subclass) to use and return, not null
observer
)

Subscribes a given Observer (subclass) to the current Observable and returns the given Observer instance as is.

public final @NonNull Observable<T>

Returns:

the new Observable instance
switchIfEmpty
(@NonNull ObservableSource<? extends T>
the alternate ObservableSource to subscribe to if the source does not emit any items
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.

public final <
the element type of the inner ObservableSources and the output
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
switchMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
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 ObservableSources.

public final <
the element type of the inner ObservableSources and the output
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
switchMap
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
mapper
,
int
the number of elements expected from the current active inner ObservableSource to be buffered
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 ObservableSources.

public final @NonNull Completable

Returns:

the new Completable instance
switchMapCompletable
(@NonNull Function<? super T, ? extends CompletableSource>
the function called with each upstream item and should return a CompletableSource to be subscribed to and awaited for (non blockingly) for its terminal event
mapper
)

Maps the items of the current Observable into CompletableSources, subscribes to the newer one while disposing the subscription to the previous CompletableSource, thus keeping at most one active CompletableSource running.

public final @NonNull Completable

Returns:

the new Completable instance
switchMapCompletableDelayError
(@NonNull Function<? super T, ? extends CompletableSource>
the function called with each upstream item and should return a CompletableSource to be subscribed to and awaited for (non blockingly) for its terminal event
mapper
)

Maps the upstream values into CompletableSources, 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.

public final <
the element type of the inner ObservableSources and the output
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
switchMapDelayError
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
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 ObservableSources and delays any error until all ObservableSources terminate.

public final <
the element type of the inner ObservableSources and the output
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
switchMapDelayError
(@NonNull Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns an ObservableSource
mapper
,
int
the number of elements expected from the current active inner ObservableSource to be buffered
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 ObservableSources and delays any error until all ObservableSources terminate.

public final <
the output value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
switchMapMaybe
(@NonNull Function<? super T, ? extends MaybeSource<? extends R>>
the function called with the current upstream event and should return a MaybeSource to replace the current active inner source and get subscribed to.
mapper
)

Maps the items of the current Observable into MaybeSources 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 MaybeSources fail.

public final <
the output value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
switchMapMaybeDelayError
(@NonNull Function<? super T, ? extends MaybeSource<? extends R>>
the function called with the current upstream event and should return a MaybeSource to replace the current active inner source and get subscribed to.
mapper
)

Maps the upstream items into MaybeSources 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 MaybeSources until all terminate.

public final <
the element type of the inner SingleSources and the output
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
switchMapSingle
(@NonNull Function<? super T, ? extends SingleSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns a SingleSource
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 SingleSources.

public final <
the element type of the inner SingleSources and the output
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
switchMapSingleDelayError
(@NonNull Function<? super T, ? extends SingleSource<? extends R>>
a function that, when applied to an item emitted by the current Observable, returns a SingleSource
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 SingleSources and delays any error until all SingleSources terminate.

public static <
the item type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
switchOnNext
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
the ObservableSource that emits ObservableSources
sources
,
int
the expected number of items to cache from the inner ObservableSources
bufferSize
)

Converts an ObservableSource that emits ObservableSources into an Observable that emits the items emitted by the most recently emitted of those ObservableSources.

public static <
the item type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
switchOnNext
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
the ObservableSource that emits ObservableSources
sources
)

Converts an ObservableSource that emits ObservableSources into an Observable that emits the items emitted by the most recently emitted of those ObservableSources.

public static <
the item type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
switchOnNextDelayError
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
the ObservableSource that emits ObservableSources
sources
)

Converts an ObservableSource that emits ObservableSources into an Observable that emits the items emitted by the most recently emitted of those ObservableSources and delays any exception until all ObservableSources terminate.

public static <
the item type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
switchOnNextDelayError
(@NonNull ObservableSource<? extends ObservableSource<? extends T>>
the ObservableSource that emits ObservableSources
sources
,
int
the expected number of items to cache from the inner ObservableSources
bufferSize
)

Converts an ObservableSource that emits ObservableSources into an Observable that emits the items emitted by the most recently emitted of those ObservableSources and delays any exception until all ObservableSources terminate.

public final @NonNull Observable<T>

Returns:

the new Observable instance
take
(long
the maximum number of items to emit
count
)

Returns an Observable that emits only the first count items emitted by the current Observable.

public final @NonNull Observable<T>

Returns:

the new Observable instance
take
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
)

Returns an Observable that emits those items emitted by the current Observable before a specified time runs out.

public final @NonNull Observable<T>

Returns:

the new Observable instance
take
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the Scheduler used for time source
scheduler
)

Returns an Observable that emits those items emitted by the current Observable before a specified time (on a specified Scheduler) runs out.

public final @NonNull Observable<T>

Returns:

the new Observable instance
takeLast
(int
the maximum number of items to emit from the end of the sequence of items emitted by the current Observable
count
)

Returns an Observable that emits at most the last count items emitted by the current Observable.

public final @NonNull Observable<T>

Returns:

the new Observable instance
takeLast
(long
the maximum number of items to emit
count
,
long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
takeLast
(long
the maximum number of items to emit
count
,
long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the Scheduler that provides the timestamps for the observed items
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
takeLast
(long
the maximum number of items to emit
count
,
long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the Scheduler that provides the timestamps for the observed items
scheduler
,
boolean
if true, an exception signaled by the current Observable is delayed until the regular elements are consumed by the downstream; if false, an exception is immediately signaled and all regular elements dropped
delayError
,
int
the hint about how many elements to expect to be last
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
takeLast
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
takeLast
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
,
boolean
if true, an exception signaled by the current Observable is delayed until the regular elements are consumed by the downstream; if false, an exception is immediately signaled and all regular elements dropped
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
takeLast
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the Scheduler that provides the timestamps for the observed items
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
takeLast
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the Scheduler that provides the timestamps for the observed items
scheduler
,
boolean
if true, an exception signaled by the current Observable is delayed until the regular elements are consumed by the downstream; if false, an exception is immediately signaled and all regular elements dropped
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
takeLast
(long
the length of the time window
time
,
@NonNull TimeUnit
the time unit of time
unit
,
@NonNull Scheduler
the Scheduler that provides the timestamps for the observed items
scheduler
,
boolean
if true, an exception signaled by the current Observable is delayed until the regular elements are consumed by the downstream; if false, an exception is immediately signaled and all regular elements dropped
delayError
,
int
the hint about how many elements to expect to be last
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.

public final <
the type of items emitted by other
U
>
@NonNull Observable<T>

Returns:

the new Observable instance
takeUntil
(@NonNull ObservableSource<U>
the ObservableSource whose first emitted item or completion will cause takeUntil to stop emitting items from the current Observable
other
)

Returns an Observable that emits the items emitted by the current Observable until a second ObservableSource emits an item or completes.

public final @NonNull Observable<T>

Returns:

the new Observable instance
takeUntil
(@NonNull Predicate<? super T>
a function that evaluates an item emitted by the current Observable and returns a Boolean
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
takeWhile
(@NonNull Predicate<? super T>
a function that evaluates an item emitted by the current Observable and returns a Boolean
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.

public final @NonNull TestObserver<T>

Returns:

the new TestObserver instance
test
()

Creates a TestObserver and subscribes it to the current Observable.

public final @NonNull TestObserver<T>

Returns:

the new TestObserver instance
test
(boolean
indicates if the TestObserver should be disposed before it is subscribed to the current Observable
dispose
)

Creates a TestObserver, optionally disposes it and then subscribes it to the current Observable.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleFirst
(long
time to wait before emitting another item after emitting the last item
windowDuration
,
@NonNull TimeUnit
the unit of time of windowDuration
unit
)

Returns an Observable that emits only the first item emitted by the current Observable during sequential time windows of a specified duration.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleFirst
(long
time to wait before emitting another item after emitting the last item
skipDuration
,
@NonNull TimeUnit
the unit of time of skipDuration
unit
,
@NonNull Scheduler
the Scheduler to use internally to manage the timers that handle timeout for each event
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleFirst
(long
time to wait before emitting another item after emitting the last item
skipDuration
,
@NonNull TimeUnit
the unit of time of skipDuration
unit
,
@NonNull Scheduler
the Scheduler to use internally to manage the timers that handle timeout for each event
scheduler
,
@NonNull Consumer<? super T>
called when an item doesn't get delivered to the downstream
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleLast
(long
duration of windows within which the last item emitted by the current Observable will be emitted
intervalDuration
,
@NonNull TimeUnit
the unit of time of intervalDuration
unit
)

Returns an Observable that emits only the last item emitted by the current Observable during sequential time windows of a specified duration.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleLast
(long
duration of windows within which the last item emitted by the current Observable will be emitted
intervalDuration
,
@NonNull TimeUnit
the unit of time of intervalDuration
unit
,
@NonNull Scheduler
the Scheduler to use internally to manage the timers that handle timeout for each event
scheduler
,
@NonNull Consumer<? super T>
called with the current entry when it has been replaced by a new one
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleLast
(long
duration of windows within which the last item emitted by the current Observable will be emitted
intervalDuration
,
@NonNull TimeUnit
the unit of time of intervalDuration
unit
,
@NonNull Scheduler
the Scheduler to use internally to manage the timers that handle timeout for each event
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleLatest
(long
the time to wait after an item emission towards the downstream before trying to emit the latest item from upstream again
timeout
,
@NonNull TimeUnit
the time unit
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleLatest
(long
the time to wait after an item emission towards the downstream before trying to emit the latest item from upstream again
timeout
,
@NonNull TimeUnit
the time unit
unit
,
boolean
If true, the very last item from the upstream will be emitted immediately when the upstream completes, regardless if there is a timeout window active or not. If false, the very last upstream item is ignored and the flow terminates.
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleLatest
(long
the time to wait after an item emission towards the downstream before trying to emit the latest item from upstream again
timeout
,
@NonNull TimeUnit
the time unit
unit
,
@NonNull Scheduler
the Scheduler where the timed wait and latest item emission will be performed
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleLatest
(long
the time to wait after an item emission towards the downstream before trying to emit the latest item from upstream again
timeout
,
@NonNull TimeUnit
the time unit
unit
,
@NonNull Scheduler
the Scheduler where the timed wait and latest item emission will be performed
scheduler
,
boolean
If true, the very last item from the upstream will be emitted immediately when the upstream completes, regardless if there is a timeout window active or not. If false, the very last upstream item is ignored and the flow terminates.
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleLatest
(long
the time to wait after an item emission towards the downstream before trying to emit the latest item from upstream again
timeout
,
@NonNull TimeUnit
the time unit
unit
,
@NonNull Scheduler
the Scheduler where the timed wait and latest item emission will be performed
scheduler
,
boolean
If true, the very last item from the upstream will be emitted immediately when the upstream completes, regardless if there is a timeout window active or not. If false, the very last upstream item is ignored and the flow terminates.
emitLast
,
@NonNull Consumer<? super T>
called when an item is replaced by a newer item that doesn't get delivered to the downstream, including the very last item if emitLast is false and the current undelivered item when the sequence gets disposed.
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleWithTimeout
(long
the length of the window of time that must pass after the emission of an item from the current Observable, in which the current Observable emits no items, in order for the item to be emitted by the resulting Observable
timeout
,
@NonNull TimeUnit
the unit of time for the specified timeout
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleWithTimeout
(long
the length of the window of time that must pass after the emission of an item from the current Observable, in which the current Observable emits no items, in order for the item to be emitted by the resulting Observable
timeout
,
@NonNull TimeUnit
the unit of time for the specified timeout
unit
,
@NonNull Scheduler
the Scheduler to use internally to manage the timers that handle the timeout for each item
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
throttleWithTimeout
(long
the length of the window of time that must pass after the emission of an item from the current Observable, in which the current Observable emits no items, in order for the item to be emitted by the resulting Observable
timeout
,
@NonNull TimeUnit
the unit of time for the specified timeout
unit
,
@NonNull Scheduler
the Scheduler to use internally to manage the timers that handle the timeout for each item
scheduler
,
@NonNull Consumer<? super T>
called with the current entry when it has been replaced by a new one
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.

public final @NonNull Observable<Timed<T>>

Returns:

the new Observable instance
timeInterval
()

Returns an Observable that emits records of the time interval between consecutive items emitted by the current Observable.

public final @NonNull Observable<Timed<T>>

Returns:

the new Observable instance
timeInterval
(@NonNull Scheduler
the Scheduler used to compute time intervals
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.

public final @NonNull Observable<Timed<T>>

Returns:

the new Observable instance
timeInterval
(@NonNull TimeUnit
the time unit for the current time
unit
)

Returns an Observable that emits records of the time interval between consecutive items emitted by the current Observable.

public final @NonNull Observable<Timed<T>>

Returns:

the new Observable instance
timeInterval
(@NonNull TimeUnit
the time unit for the current time
unit
,
@NonNull Scheduler
the Scheduler used to compute time intervals
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.

public final <
the timeout value type (ignored)
V
>
@NonNull Observable<T>

Returns:

the new Observable instance
timeout
(@NonNull Function<? super T, ? extends ObservableSource<V>>
a function that returns an ObservableSource for each item emitted by the current Observable and that determines the timeout window for the subsequent item
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.

public final <
the timeout value type (ignored)
V
>
@NonNull Observable<T>

Returns:

the new Observable instance
timeout
(@NonNull Function<? super T, ? extends ObservableSource<V>>
a function that returns an ObservableSource, for each item emitted by the current Observable, that determines the timeout window for the subsequent item
itemTimeoutIndicator
,
@NonNull ObservableSource<? extends T>
the fallback ObservableSource to switch to if the current Observable times out
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
timeout
(long
maximum duration between emitted items before a timeout occurs
timeout
,
@NonNull TimeUnit
the unit of time that applies to the timeout argument.
unit
)

Returns an Observable that mirrors the current Observable but applies a timeout policy for each emitted item.

public final @NonNull Observable<T>

Returns:

the new Observable instance
timeout
(long
maximum duration between items before a timeout occurs
timeout
,
@NonNull TimeUnit
the unit of time that applies to the timeout argument
unit
,
@NonNull ObservableSource<? extends T>
the fallback ObservableSource to use in case of a timeout
fallback
)

Returns an Observable that mirrors the current Observable but applies a timeout policy for each emitted item.

public final @NonNull Observable<T>

Returns:

the new Observable instance
timeout
(long
maximum duration between items before a timeout occurs
timeout
,
@NonNull TimeUnit
the unit of time that applies to the timeout argument
unit
,
@NonNull Scheduler
the Scheduler to run the timeout timers on
scheduler
,
@NonNull ObservableSource<? extends T>
the ObservableSource to use as the fallback in case of a timeout
fallback
)

Returns an Observable that mirrors the current Observable but applies a timeout policy for each emitted item using a specified Scheduler.

public final @NonNull Observable<T>

Returns:

the new Observable instance
timeout
(long
maximum duration between items before a timeout occurs
timeout
,
@NonNull TimeUnit
the unit of time that applies to the timeout argument
unit
,
@NonNull Scheduler
the Scheduler to run the timeout timers on
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.

public final <
the first timeout value type (ignored)
U
,
the subsequent timeout value type (ignored)
V
>
@NonNull Observable<T>

Returns:

the new Observable instance
timeout
(@NonNull ObservableSource<U>
a function that returns an ObservableSource that determines the timeout window for the first source item
firstTimeoutIndicator
,
@NonNull Function<? super T, ? extends ObservableSource<V>>
a function that returns an ObservableSource for each item emitted by the current Observable and that determines the timeout window in which the subsequent source item must arrive in order to continue the sequence
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 ObservableSources.

public final <
the first timeout value type (ignored)
U
,
the subsequent timeout value type (ignored)
V
>
@NonNull Observable<T>

Returns:

the new Observable instance
timeout
(@NonNull ObservableSource<U>
a function that returns an ObservableSource which determines the timeout window for the first source item
firstTimeoutIndicator
,
@NonNull Function<? super T, ? extends ObservableSource<V>>
a function that returns an ObservableSource for each item emitted by the current Observable and that determines the timeout window in which the subsequent source item must arrive in order to continue the sequence
itemTimeoutIndicator
,
@NonNull ObservableSource<? extends T>
the fallback ObservableSource to switch to if the current Observable times out
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 ObservableSources.

private @NonNull Observable<T>
timeout0(long timeout, @NonNull TimeUnit unit, @Nullable ObservableSource<? extends T> fallback, @NonNull Scheduler scheduler)

private <U, V> @NonNull Observable<T>
timeout0(@NonNull ObservableSource<U> firstTimeoutIndicator, @NonNull Function<? super T, ? extends ObservableSource<V>> itemTimeoutIndicator, @Nullable ObservableSource<? extends T> fallback)

public static @NonNull Observable<Long>

Returns:

the new Observable instance
timer
(long
the initial delay before emitting a single 0L
delay
,
@NonNull TimeUnit
time units to use for delay
unit
)

Returns an Observable that emits 0L after a specified delay, and then completes.

public static @NonNull Observable<Long>

Returns:

the new Observable instance
timer
(long
the initial delay before emitting a single 0L
delay
,
@NonNull TimeUnit
time units to use for delay
unit
,
@NonNull Scheduler
the Scheduler to use for scheduling the item
scheduler
)

Returns an Observable that emits 0L after a specified delay, on a specified Scheduler, and then completes.

public final @NonNull Observable<Timed<T>>

Returns:

the new Observable instance
timestamp
()

Returns an Observable that emits each item emitted by the current Observable, wrapped in a Timed object.

public final @NonNull Observable<Timed<T>>

Returns:

the new Observable instance
timestamp
(@NonNull Scheduler
the Scheduler to use as a time source
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.

public final @NonNull Observable<Timed<T>>

Returns:

the new Observable instance
timestamp
(@NonNull TimeUnit
the time unit for the current time
unit
)

Returns an Observable that emits each item emitted by the current Observable, wrapped in a Timed object.

public final @NonNull Observable<Timed<T>>

Returns:

the new Observable instance
timestamp
(@NonNull TimeUnit
the time unit for the current time
unit
,
@NonNull Scheduler
the Scheduler to use as a time source
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.

public final <
the resulting object type
R
>
R

Returns:

the converted value
to
(@NonNull ObservableConverter<T, ? extends R>
the function that receives the current Observable instance and returns a value
converter
)

Calls the specified converter function during assembly time and returns its resulting value.

public final @NonNull Flowable<T>

Returns:

the new Flowable instance
toFlowable
(@NonNull BackpressureStrategy
the backpressure strategy to apply
strategy
)

Converts the current Observable into a Flowable by applying the specified backpressure strategy.

public final @NonNull Future<T>

Returns:

the new Future instance
toFuture
()

Returns a Future representing the only value emitted by the current Observable.

public final @NonNull Single<@NonNull List<T>>

Returns:

the new Single instance
toList
()

Returns a Single that emits a single item, a List composed of all the items emitted by the current and finite Observable.

public final @NonNull Single<@NonNull List<T>>

Returns:

the new Single instance
toList
(int
the number of elements expected from the current Observable
capacityHint
)

Returns a Single that emits a single item, a List composed of all the items emitted by the current and finite Observable.

public final <
the subclass of a collection of Ts
U extends Collection<? super T>
>
@NonNull Single<U>

Returns:

the new Single instance
toList
(@NonNull Supplier<U>
the Supplier returning the collection (for each individual Observer) to be filled in
collectionSupplier
)

Returns a Single that emits a single item, a Collection (subclass) composed of all the items emitted by the finite upstream Observable.

public final <
the key type of the Map
K
>
@NonNull Single<@NonNull Map<K, T>>

Returns:

the new Single instance
toMap
(@NonNull Function<? super T, ? extends K>
the function that extracts the key from a source item to be used in the HashMap
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.

public final <
the key type of the HashMap
K
,
the value type of the HashMap
V
>
@NonNull Single<Map<K, V>>

Returns:

the new Single instance
toMap
(@NonNull Function<? super T, ? extends K>
the function that extracts the key from a source item to be used in the HashMap
keySelector
,
@NonNull Function<? super T, ? extends V>
the function that extracts the value from a source item to be used in the HashMap
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.

public final <
the key type of the Map
K
,
the value type of the Map
V
>
@NonNull Single<Map<K, V>>

Returns:

the new Single instance
toMap
(@NonNull Function<? super T, ? extends K>
the function that extracts the key from a source item to be used in the Map
keySelector
,
@NonNull Function<? super T, ? extends V>
the function that extracts the value from the source items to be used as value in the Map
valueSelector
,
@NonNull Supplier<? extends Map<K, V>>
the function that returns a Map instance to be used
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.

public final <
the key type of the HashMap
K
>
@NonNull Single<@NonNull Map<K, Collection<T>>>

Returns:

the new Single instance
toMultimap
(@NonNull Function<? super T, ? extends K>
the function that extracts the key from the source items to be used as key in the HashMap
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.

public final <
the key type of the HashMap
K
,
the value type of the HashMap
V
>
@NonNull Single<@NonNull Map<K, Collection<V>>>

Returns:

the new Single instance
toMultimap
(@NonNull Function<? super T, ? extends K>
the function that extracts a key from the source items to be used as key in the HashMap
keySelector
,
Function<? super T, ? extends V>
the function that extracts a value from the source items to be used as value in the HashMap
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.

public final <
the key type of the Map
K
,
the value type of the Map
V
>
@NonNull Single<@NonNull Map<K, Collection<V>>>

Returns:

the new Single instance
toMultimap
(@NonNull Function<? super T, ? extends K>
the function that extracts a key from the source items to be used as the key in the Map
keySelector
,
@NonNull Function<? super T, ? extends V>
the function that extracts a value from the source items to be used as the value in the Map
valueSelector
,
@NonNull Supplier<? extends Map<K, Collection<V>>>
the function that returns a Map instance to be used
mapSupplier
,
@NonNull Function<? super K, ? extends Collection<? super V>>
the function that returns a Collection instance for a particular key to be used in the Map
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.

public final <
the key type of the Map
K
,
the value type of the Map
V
>
@NonNull Single<@NonNull Map<K, Collection<V>>>

Returns:

the new Single instance
toMultimap
(@NonNull Function<? super T, ? extends K>
the function that extracts a key from the source items to be used as the key in the Map
keySelector
,
@NonNull Function<? super T, ? extends V>
the function that extracts a value from the source items to be used as the value in the Map
valueSelector
,
@NonNull Supplier<Map<K, Collection<V>>>
the function that returns a Map instance to be used
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.

public final @NonNull Single<@NonNull List<T>>

Returns:

the new Single instance
toSortedList
()

Returns a Single that emits a List that contains the items emitted by the current and finite Observable, in a sorted order.

public final @NonNull Single<@NonNull List<T>>

Returns:

the new Single instance
toSortedList
(@NonNull Comparator<? super T>
a function that compares two items emitted by the current Observable and returns an int that indicates their sort order
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.

public final @NonNull Single<@NonNull List<T>>

Returns:

the new Single instance
toSortedList
(@NonNull Comparator<? super T>
a function that compares two items emitted by the current Observable and returns an int that indicates their sort order
comparator
,
int
the initial capacity of the List used to accumulate items before sorting
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.

public final @NonNull Single<@NonNull List<T>>

Returns:

the new Single instance
toSortedList
(int
the initial capacity of the List used to accumulate items before sorting
capacityHint
)

Returns a Single that emits a List that contains the items emitted by the current and finite Observable, in a sorted order.

public static <
the value type emitted
T
>
@NonNull Observable<T>

Returns:

the new Observable instance
unsafeCreate
(@NonNull ObservableSource<T>
the ObservableSource instance to wrap
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.

public final @NonNull Observable<T>

Returns:

the new Observable instance
unsubscribeOn
(@NonNull Scheduler
the Scheduler to perform the call to dispose() of the upstream Disposable
scheduler
)

Return an Observable that schedules the downstream Observers' dispose calls aimed at the current Observable on the given Scheduler.

public static <
the element type of the generated Observable
T
,
the type of the resource associated with the output sequence
D
>
@NonNull Observable<T>

Returns:

the new Observable instance
using
(@NonNull Supplier<? extends D>
the factory function to create a resource object that depends on the ObservableSource
resourceSupplier
,
@NonNull Function<? super D, ? extends ObservableSource<? extends T>>
the factory function to create an ObservableSource
sourceSupplier
,
@NonNull Consumer<? super D>
the function that will dispose of the resource
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.

public static <
the element type of the generated ObservableSource
T
,
the type of the resource associated with the output sequence
D
>
@NonNull Observable<T>

Returns:

the new Observable instance
using
(@NonNull Supplier<? extends D>
the factory function to create a resource object that depends on the ObservableSource
resourceSupplier
,
@NonNull Function<? super D, ? extends ObservableSource<? extends T>>
the factory function to create an ObservableSource
sourceSupplier
,
@NonNull Consumer<? super D>
the function that will dispose of the resource
resourceCleanup
,
boolean
If true, the resource disposal will happen either on a dispose() call before the upstream is disposed or just before the emission of a terminal event (onComplete or onError). If false, the resource disposal will happen either on a dispose() call after the upstream is disposed or just after the emission of a terminal event (onComplete or onError).
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.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the maximum size of each window before it should be emitted
count
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the maximum size of each window before it should be emitted
count
,
long
how many items need to be skipped before starting a new window. Note that if skip and count are equal this is the same operation as window(long).
skip
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the maximum size of each window before it should be emitted
count
,
long
how many items need to be skipped before starting a new window. Note that if skip and count are equal this is the same operation as window(long).
skip
,
int
the capacity hint for the buffer in the inner windows
bufferSize
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the period of time each window collects items before it should be emitted
timespan
,
long
the period of time after which a new window will be created
timeskip
,
@NonNull TimeUnit
the unit of time that applies to the timespan and timeskip arguments
unit
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the period of time each window collects items before it should be emitted
timespan
,
long
the period of time after which a new window will be created
timeskip
,
@NonNull TimeUnit
the unit of time that applies to the timespan and timeskip arguments
unit
,
@NonNull Scheduler
the Scheduler to use when determining the end and start of a window
scheduler
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the period of time each window collects items before it should be emitted
timespan
,
long
the period of time after which a new window will be created
timeskip
,
@NonNull TimeUnit
the unit of time that applies to the timespan and timeskip arguments
unit
,
@NonNull Scheduler
the Scheduler to use when determining the end and start of a window
scheduler
,
int
the capacity hint for the buffer in the inner windows
bufferSize
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the period of time each window collects items before it should be emitted and replaced with a new window
timespan
,
@NonNull TimeUnit
the unit of time that applies to the timespan argument
unit
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the period of time each window collects items before it should be emitted and replaced with a new window
timespan
,
@NonNull TimeUnit
the unit of time that applies to the timespan argument
unit
,
long
the maximum size of each window before it should be emitted
count
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the period of time each window collects items before it should be emitted and replaced with a new window
timespan
,
@NonNull TimeUnit
the unit of time that applies to the timespan argument
unit
,
long
the maximum size of each window before it should be emitted
count
,
boolean
if true, when a window reaches the capacity limit, the timer is restarted as well
restart
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the period of time each window collects items before it should be emitted and replaced with a new window
timespan
,
@NonNull TimeUnit
the unit of time which applies to the timespan argument
unit
,
@NonNull Scheduler
the Scheduler to use when determining the end and start of a window
scheduler
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the period of time each window collects items before it should be emitted and replaced with a new window
timespan
,
@NonNull TimeUnit
the unit of time which applies to the timespan argument
unit
,
@NonNull Scheduler
the Scheduler to use when determining the end and start of a window
scheduler
,
long
the maximum size of each window before it should be emitted
count
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the period of time each window collects items before it should be emitted and replaced with a new window
timespan
,
@NonNull TimeUnit
the unit of time which applies to the timespan argument
unit
,
@NonNull Scheduler
the Scheduler to use when determining the end and start of a window
scheduler
,
long
the maximum size of each window before it should be emitted
count
,
boolean
if true, when a window reaches the capacity limit, the timer is restarted as well
restart
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final @NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(long
the period of time each window collects items before it should be emitted and replaced with a new window
timespan
,
@NonNull TimeUnit
the unit of time which applies to the timespan argument
unit
,
@NonNull Scheduler
the Scheduler to use when determining the end and start of a window
scheduler
,
long
the maximum size of each window before it should be emitted
count
,
boolean
if true, when a window reaches the capacity limit, the timer is restarted as well
restart
,
int
the capacity hint for the buffer in the inner windows
bufferSize
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final <
the window element type (ignored)
B
>
@NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(@NonNull ObservableSource<B>
an ObservableSource whose emitted items close and open windows
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.

public final <
the window element type (ignored)
B
>
@NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(@NonNull ObservableSource<B>
an ObservableSource whose emitted items close and open windows
boundaryIndicator
,
int
the capacity hint for the buffer in the inner windows
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.

public final <
the element type of the window-opening ObservableSource
U
,
the element type of the window-closing ObservableSources
V
>
@NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(@NonNull ObservableSource<U>
an ObservableSource that, when it emits an item, causes another window to be created
openingIndicator
,
@NonNull Function<? super U, ? extends ObservableSource<V>>
a Function that produces an ObservableSource for every window created. When this indicator ObservableSource emits an item, the associated window is completed
closingIndicator
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final <
the element type of the window-opening ObservableSource
U
,
the element type of the window-closing ObservableSources
V
>
@NonNull Observable<Observable<T>>

Returns:

the new Observable instance
window
(@NonNull ObservableSource<U>
an ObservableSource that, when it emits an item, causes another window to be created
openingIndicator
,
@NonNull Function<? super U, ? extends ObservableSource<V>>
a Function that produces an ObservableSource for every window created. When this indicator ObservableSource emits an item, the associated window is completed
closingIndicator
,
int
the capacity hint for the buffer in the inner windows
bufferSize
)

Returns an Observable that emits windows of items it collects from the current Observable.

public final <
the element type of the other ObservableSource
U
,
the result type of the combination
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
withLatestFrom
(@NonNull ObservableSource<? extends U>
the other ObservableSource
other
,
@NonNull BiFunction<? super T, ? super U, ? extends R>
the function to call when the current Observable emits an item and the other ObservableSource has already emitted an item, to generate the item to be emitted by the resulting Observable
combiner
)

Merges the specified ObservableSource into the current Observable sequence by using the resultSelector function only when the current Observable emits an item.

public final <
the first other source's value type
T1
,
the second other source's value type
T2
,
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
withLatestFrom
(@NonNull ObservableSource<T1>
the first other ObservableSource
source1
,
@NonNull ObservableSource<T2>
the second other ObservableSource
source2
,
@NonNull Function3<? super T, ? super T1, ? super T2, R>
the function called with an array of values from each participating ObservableSource
combiner
)

Combines the value emission from the current Observable with the latest emissions from the other ObservableSources via a function to produce the output item.

public final <
the first other source's value type
T1
,
the second other source's value type
T2
,
the third other source's value type
T3
,
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
withLatestFrom
(@NonNull ObservableSource<T1>
the first other ObservableSource
source1
,
@NonNull ObservableSource<T2>
the second other ObservableSource
source2
,
@NonNull ObservableSource<T3>
the third other ObservableSource
source3
,
@NonNull Function4<? super T, ? super T1, ? super T2, ? super T3, R>
the function called with an array of values from each participating ObservableSource
combiner
)

Combines the value emission from the current Observable with the latest emissions from the other ObservableSources via a function to produce the output item.

public final <
the first other source's value type
T1
,
the second other source's value type
T2
,
the third other source's value type
T3
,
the fourth other source's value type
T4
,
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
withLatestFrom
(@NonNull ObservableSource<T1>
the first other ObservableSource
source1
,
@NonNull ObservableSource<T2>
the second other ObservableSource
source2
,
@NonNull ObservableSource<T3>
the third other ObservableSource
source3
,
@NonNull ObservableSource<T4>
the fourth other ObservableSource
source4
,
@NonNull Function5<? super T, ? super T1, ? super T2, ? super T3, ? super T4, R>
the function called with an array of values from each participating ObservableSource
combiner
)

Combines the value emission from the current Observable with the latest emissions from the other ObservableSources via a function to produce the output item.

public final <
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
withLatestFrom
(@NonNull ObservableSource<?>[]
the array of other sources
others
,
@NonNull Function<? super Object[], R>
the function called with an array of values from each participating ObservableSource
combiner
)

Combines the value emission from the current Observable with the latest emissions from the other ObservableSources via a function to produce the output item.

public final <
the result value type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
withLatestFrom
(@NonNull Iterable<@NonNull ? extends ObservableSource<?>>
the iterable of other sources
others
,
@NonNull Function<? super Object[], R>
the function called with an array of values from each participating ObservableSource
combiner
)

Combines the value emission from the current Observable with the latest emissions from the other ObservableSources via a function to produce the output item.

public static <
the value type
T
>
@NonNull Observable<T>

Returns:

the new Observable instance or the same as the source
wrap
(@NonNull ObservableSource<T>
the ObservableSource instance to wrap or cast to Observable
source
)

Wraps an ObservableSource into an Observable if not already an Observable.

public static <
the common value type
T
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
an Iterable of source ObservableSources
sources
,
@NonNull Function<? super Object[], ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
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 ObservableSources.

public static <
the common source value type
T
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>>
an Iterable of source ObservableSources
sources
,
@NonNull Function<? super Object[], ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
zipper
,
boolean
delay errors signaled by any of the ObservableSource until all ObservableSources terminate
delayError
,
int
the number of elements expected from each source ObservableSource to be buffered
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 ObservableSources.

public static <
the value type of the first source
T1
,
the value type of the second source
T2
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
a second source ObservableSource
source2
,
@NonNull BiFunction<? super T1, ? super T2, ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
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 ObservableSources.

public static <
the value type of the first source
T1
,
the value type of the second source
T2
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
a second source ObservableSource
source2
,
@NonNull BiFunction<? super T1, ? super T2, ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
zipper
,
boolean
delay errors from any of the ObservableSources till the other terminates
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 ObservableSources.

public static <
the value type of the first source
T1
,
the value type of the second source
T2
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
a second source ObservableSource
source2
,
@NonNull BiFunction<? super T1, ? super T2, ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
zipper
,
boolean
delay errors from any of the ObservableSources till the other terminates
delayError
,
int
the number of elements expected from each source ObservableSource to be buffered
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 ObservableSources.

public static <
the value type of the first source
T1
,
the value type of the second source
T2
,
the value type of the third source
T3
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
a second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
a third source ObservableSource
source3
,
@NonNull Function3<? super T1, ? super T2, ? super T3, ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
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 ObservableSources.

public static <
the value type of the first source
T1
,
the value type of the second source
T2
,
the value type of the third source
T3
,
the value type of the fourth source
T4
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
a second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
a third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
a fourth source ObservableSource
source4
,
@NonNull Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
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 ObservableSources.

public static <
the value type of the first source
T1
,
the value type of the second source
T2
,
the value type of the third source
T3
,
the value type of the fourth source
T4
,
the value type of the fifth source
T5
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
a second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
a third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
a fourth source ObservableSource
source4
,
@NonNull ObservableSource<? extends T5>
a fifth source ObservableSource
source5
,
@NonNull Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
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 ObservableSources.

public static <
the value type of the first source
T1
,
the value type of the second source
T2
,
the value type of the third source
T3
,
the value type of the fourth source
T4
,
the value type of the fifth source
T5
,
the value type of the sixth source
T6
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
a second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
a third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
a fourth source ObservableSource
source4
,
@NonNull ObservableSource<? extends T5>
a fifth source ObservableSource
source5
,
@NonNull ObservableSource<? extends T6>
a sixth source ObservableSource
source6
,
@NonNull Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
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 ObservableSources.

public static <
the value type of the first source
T1
,
the value type of the second source
T2
,
the value type of the third source
T3
,
the value type of the fourth source
T4
,
the value type of the fifth source
T5
,
the value type of the sixth source
T6
,
the value type of the seventh source
T7
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
a second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
a third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
a fourth source ObservableSource
source4
,
@NonNull ObservableSource<? extends T5>
a fifth source ObservableSource
source5
,
@NonNull ObservableSource<? extends T6>
a sixth source ObservableSource
source6
,
@NonNull ObservableSource<? extends T7>
a seventh source ObservableSource
source7
,
@NonNull Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
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 ObservableSources.

public static <
the value type of the first source
T1
,
the value type of the second source
T2
,
the value type of the third source
T3
,
the value type of the fourth source
T4
,
the value type of the fifth source
T5
,
the value type of the sixth source
T6
,
the value type of the seventh source
T7
,
the value type of the eighth source
T8
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
a second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
a third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
a fourth source ObservableSource
source4
,
@NonNull ObservableSource<? extends T5>
a fifth source ObservableSource
source5
,
@NonNull ObservableSource<? extends T6>
a sixth source ObservableSource
source6
,
@NonNull ObservableSource<? extends T7>
a seventh source ObservableSource
source7
,
@NonNull ObservableSource<? extends T8>
an eighth source ObservableSource
source8
,
@NonNull Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
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 ObservableSources.

public static <
the value type of the first source
T1
,
the value type of the second source
T2
,
the value type of the third source
T3
,
the value type of the fourth source
T4
,
the value type of the fifth source
T5
,
the value type of the sixth source
T6
,
the value type of the seventh source
T7
,
the value type of the eighth source
T8
,
the value type of the ninth source
T9
,
the zipped result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zip
(@NonNull ObservableSource<? extends T1>
the first source ObservableSource
source1
,
@NonNull ObservableSource<? extends T2>
a second source ObservableSource
source2
,
@NonNull ObservableSource<? extends T3>
a third source ObservableSource
source3
,
@NonNull ObservableSource<? extends T4>
a fourth source ObservableSource
source4
,
@NonNull ObservableSource<? extends T5>
a fifth source ObservableSource
source5
,
@NonNull ObservableSource<? extends T6>
a sixth source ObservableSource
source6
,
@NonNull ObservableSource<? extends T7>
a seventh source ObservableSource
source7
,
@NonNull ObservableSource<? extends T8>
an eighth source ObservableSource
source8
,
@NonNull ObservableSource<? extends T9>
a ninth source ObservableSource
source9
,
@NonNull Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
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 ObservableSources.

public static <
the common element type
T
,
the result type
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zipArray
(@NonNull Function<? super Object[], ? extends R>
a function that, when applied to an item emitted by each of the ObservableSources, results in an item that will be emitted by the resulting Observable
zipper
,
boolean
delay errors signaled by any of the ObservableSource until all ObservableSources terminate
delayError
,
int
the number of elements expected from each source ObservableSource to be buffered
bufferSize
,
@NonNull ObservableSource<? extends T>...
an array of source ObservableSources
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 ObservableSources.

public final <
the type of items in the other Iterable
U
,
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zipWith
(@NonNull Iterable<U>
the Iterable sequence
other
,
@NonNull BiFunction<? super T, ? super U, ? extends R>
a function that combines the pairs of items from the current Observable and the Iterable to generate the items to be emitted by the resulting Observable
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.

public final <
the type of items emitted by the other ObservableSource
U
,
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zipWith
(@NonNull ObservableSource<? extends U>
the other ObservableSource
other
,
@NonNull BiFunction<? super T, ? super U, ? extends R>
a function that combines the pairs of items from the current Observable and the other ObservableSource to generate the items to be emitted by the resulting Observable
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.

public final <
the type of items emitted by the other ObservableSource
U
,
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zipWith
(@NonNull ObservableSource<? extends U>
the other ObservableSource
other
,
@NonNull BiFunction<? super T, ? super U, ? extends R>
a function that combines the pairs of items from the current Observable and the other ObservableSource to generate the items to be emitted by the resulting Observable
zipper
,
boolean
if true, errors from the current Observable or the other ObservableSource is delayed until both terminate
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.

public final <
the type of items emitted by the other ObservableSource
U
,
the type of items emitted by the resulting Observable
R
>
@NonNull Observable<R>

Returns:

the new Observable instance
zipWith
(@NonNull ObservableSource<? extends U>
the other ObservableSource
other
,
@NonNull BiFunction<? super T, ? super U, ? extends R>
a function that combines the pairs of items from the current Observable and the other ObservableSource to generate the items to be emitted by the resulting Observable
zipper
,
boolean
if true, errors from the current Observable or the other ObservableSource is delayed until both terminate
delayError
,
int
the capacity hint for the buffer in the inner windows
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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait