Class UnicastSubject<T>
- Type Parameters:
T- the value type received and emitted by this Subject subclass
- All Implemented Interfaces:
ObservableSource<T>, Observer<T>
Observer subscribes to it, replays
those events to it until the Observer catches up and then switches to relaying events live to
this single Observer until this UnicastSubject terminates or the Observer disposes.
Note that UnicastSubject holds an unbounded internal buffer.
This subject does not have a public constructor by design; a new empty instance of this
UnicastSubject can be created via the following create methods that
allow specifying the retention policy for items:
create()- creates an empty, unboundedUnicastSubjectthat caches all items and the terminal event it receives.create(int)- creates an empty, unboundedUnicastSubjectwith a hint about how many total items one expects to retain.create(boolean)- creates an empty, unboundedUnicastSubjectthat optionally delays an error it receives and replays it after the regular items have been emitted.create(int, Runnable)- creates an empty, unboundedUnicastSubjectwith a hint about how many total items one expects to retain and a callback that will be called exactly once when theUnicastSubjectgets terminated or the singleObserverdisposes.create(int, Runnable, boolean)- creates an empty, unboundedUnicastSubjectwith a hint about how many total items one expects to retain and a callback that will be called exactly once when theUnicastSubjectgets terminated or the singleObserverdisposes and optionally delays an error it receives and replays it after the regular items have been emitted.
If more than one Observer attempts to subscribe to this UnicastSubject, they
will receive an IllegalStateException indicating the single-use-only nature of this UnicastSubject,
even if the UnicastSubject already terminated with an error.
Since a Subject is conceptionally derived from the Processor type in the Reactive Streams specification,
nulls are not allowed (Rule 2.13) as
parameters to onNext(Object) and onError(Throwable). Such calls will result in a
NullPointerException being thrown and the subject's state is not changed.
Since a UnicastSubject is an Observable, it does not support backpressure.
When this UnicastSubject is terminated via onError(Throwable) the current or late single Observer
may receive the Throwable before any available items could be emitted. To make sure an onError event is delivered
to the Observer after the normal items, create a UnicastSubject with the create(boolean) or
create(int, Runnable, boolean) factory methods.
Even though UnicastSubject implements the Observer interface, calling
onSubscribe is not required (Rule 2.12)
if the subject is used as a standalone source. However, calling onSubscribe
after the UnicastSubject reached its terminal state will result in the
given Disposable being disposed immediately.
Calling onNext(Object), onError(Throwable) and onComplete()
is required to be serialized (called from the same thread or called non-overlappingly from different threads
through external means of serialization). The Subject.toSerialized() method available to all Subjects
provides such serialization and also protects against reentrance (i.e., when a downstream Observer
consuming this subject also wants to call onNext(Object) on this subject recursively).
This UnicastSubject supports the standard state-peeking methods hasComplete(), hasThrowable(),
getThrowable() and hasObservers().
- Scheduler:
UnicastSubjectdoes not operate by default on a particularSchedulerand the singleObservergets notified on the thread the respectiveonXXXmethods were invoked.- Error handling:
- When the
onError(Throwable)is called, theUnicastSubjectenters into a terminal state and emits the sameThrowableinstance to the current singleObserver. During this emission, if the singleObservers disposes its respectiveDisposable, theThrowableis delivered to the global error handler viaRxJavaPlugins.onError(Throwable). If there were noObservers subscribed to thisUnicastSubjectwhen theonError()was called, the global error handler is not invoked.
Example usage:
UnicastSubject<Integer> subject = UnicastSubject.create();
TestObserver<Integer> to1 = subject.test();
// fresh UnicastSubjects are empty
to1.assertEmpty();
TestObserver<Integer> to2 = subject.test();
// A UnicastSubject only allows one Observer during its lifetime
to2.assertFailure(IllegalStateException.class);
subject.onNext(1);
to1.assertValue(1);
subject.onNext(2);
to1.assertValues(1, 2);
subject.onComplete();
to1.assertResult(1, 2);
// ----------------------------------------------------
UnicastSubject<Integer> subject2 = UnicastSubject.create();
// a UnicastSubject caches events until its single Observer subscribes
subject2.onNext(1);
subject2.onNext(2);
subject2.onComplete();
TestObserver<Integer> to3 = subject2.test();
// the cached events are emitted in order
to3.assertResult(1, 2);
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @NonNull UnicastSubject<T> create()Creates an UnicastSubject with an internal buffer capacity hint 16.static <T> @NonNull UnicastSubject<T> create(boolean delayError) Creates an UnicastSubject with an internal buffer capacity hint 16 and given delay error flag.static <T> @NonNull UnicastSubject<T> create(int capacityHint) Creates an UnicastSubject with the given internal buffer capacity hint.static <T> @NonNull UnicastSubject<T> Creates an UnicastSubject with the given internal buffer capacity hint and a callback for the case when the single Subscriber cancels its subscription or the subject is terminated.static <T> @NonNull UnicastSubject<T> Creates an UnicastSubject with the given internal buffer capacity hint, delay error flag and a callback for the case when the single Observer disposes itsDisposableor the subject is terminated.Returns the error that caused the Subject to terminate or null if the Subject hasn't terminated yet.booleanReturns true if the subject has reached a terminal state through a complete event.booleanReturns true if the subject has any Observers.booleanReturns true if the subject has reached a terminal state through an error event.voidNotifies theObserverthat theObservablehas finished sending push-based notifications.voidNotifies theObserverthat theObservablehas experienced an error condition.voidProvides theObserverwith a new item to observe.voidProvides theObserverwith the means of cancelling (disposing) the connection (channel) with theObservablein both synchronous (from withinObserver.onNext(Object)) and asynchronous manner.protected voidsubscribeActual(Observer<? super T> observer) Operator implementations (both source and intermediate) should implement this method that performs the necessary business logic and handles the incomingObservers.Methods inherited from class Subject
toSerializedModifier and TypeMethodDescriptionWraps this Subject and serializes the calls to the onSubscribe, onNext, onError and onComplete methods, making them thread-safe.Methods inherited from class Observable
all, amb, ambArray, ambWith, any, blockingFirst, blockingFirst, blockingForEach, blockingForEach, blockingIterable, blockingIterable, blockingLast, blockingLast, blockingLatest, blockingMostRecent, blockingNext, blockingSingle, blockingSingle, blockingStream, blockingStream, blockingSubscribe, blockingSubscribe, blockingSubscribe, blockingSubscribe, blockingSubscribe, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, bufferSize, cache, cacheWithInitialCapacity, cast, collect, collect, collectInto, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatestArray, combineLatestArray, combineLatestArrayDelayError, combineLatestArrayDelayError, combineLatestDelayError, combineLatestDelayError, compose, concat, concat, concat, concat, concat, concat, concatArray, concatArrayDelayError, concatArrayEager, concatArrayEager, concatArrayEagerDelayError, concatArrayEagerDelayError, concatDelayError, concatDelayError, concatDelayError, concatEager, concatEager, concatEager, concatEager, concatEagerDelayError, concatEagerDelayError, concatEagerDelayError, concatEagerDelayError, concatMap, concatMap, concatMap, concatMapCompletable, concatMapCompletable, concatMapCompletableDelayError, concatMapCompletableDelayError, concatMapCompletableDelayError, concatMapDelayError, concatMapDelayError, concatMapDelayError, concatMapEager, concatMapEager, concatMapEagerDelayError, concatMapEagerDelayError, concatMapIterable, concatMapMaybe, concatMapMaybe, concatMapMaybeDelayError, concatMapMaybeDelayError, concatMapMaybeDelayError, concatMapSingle, concatMapSingle, concatMapSingleDelayError, concatMapSingleDelayError, concatMapSingleDelayError, concatMapStream, concatWith, concatWith, concatWith, concatWith, contains, count, create, debounce, debounce, debounce, debounce, defaultIfEmpty, defer, delay, delay, delay, delay, delay, delay, delaySubscription, delaySubscription, delaySubscription, dematerialize, distinct, distinct, distinct, distinctUntilChanged, distinctUntilChanged, distinctUntilChanged, doAfterNext, doAfterTerminate, doFinally, doOnComplete, doOnDispose, doOnEach, doOnEach, doOnError, doOnLifecycle, doOnNext, doOnSubscribe, doOnTerminate, elementAt, elementAt, elementAtOrError, empty, error, error, filter, first, firstElement, firstOrError, firstOrErrorStage, firstStage, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMap, flatMapCompletable, flatMapCompletable, flatMapIterable, flatMapIterable, flatMapMaybe, flatMapMaybe, flatMapSingle, flatMapSingle, flatMapStream, forEach, forEachWhile, forEachWhile, forEachWhile, fromAction, fromArray, fromCallable, fromCompletable, fromCompletionStage, fromFuture, fromFuture, fromIterable, fromMaybe, fromOptional, fromPublisher, fromRunnable, fromSingle, fromStream, fromSupplier, generate, generate, generate, generate, generate, groupBy, groupBy, groupBy, groupBy, groupBy, groupJoin, hide, ignoreElements, interval, interval, interval, interval, intervalRange, intervalRange, isEmpty, join, just, just, just, just, just, just, just, just, just, just, last, lastElement, lastOrError, lastOrErrorStage, lastStage, lift, map, mapOptional, materialize, merge, merge, merge, merge, merge, merge, merge, merge, mergeArray, mergeArray, mergeArrayDelayError, mergeArrayDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeWith, mergeWith, mergeWith, mergeWith, never, observeOn, observeOn, observeOn, ofType, onErrorComplete, onErrorComplete, onErrorResumeNext, onErrorResumeWith, onErrorReturn, onErrorReturnItem, onTerminateDetach, publish, publish, range, rangeLong, reduce, reduce, reduceWith, repeat, repeat, repeatUntil, repeatWhen, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, replay, retry, retry, retry, retry, retry, retryUntil, retryWhen, safeSubscribe, sample, sample, sample, sample, sample, sample, sample, scan, scan, scanWith, sequenceEqual, sequenceEqual, sequenceEqual, sequenceEqual, serialize, share, single, singleElement, singleOrError, singleOrErrorStage, singleStage, skip, skip, skip, skipLast, skipLast, skipLast, skipLast, skipLast, skipLast, skipUntil, skipWhile, sorted, sorted, startWith, startWith, startWith, startWith, startWithArray, startWithItem, startWithIterable, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeWith, switchIfEmpty, switchMap, switchMap, switchMapCompletable, switchMapCompletableDelayError, switchMapDelayError, switchMapDelayError, switchMapMaybe, switchMapMaybeDelayError, switchMapSingle, switchMapSingleDelayError, switchOnNext, switchOnNext, switchOnNextDelayError, switchOnNextDelayError, take, take, take, takeLast, takeLast, takeLast, takeLast, takeLast, takeLast, takeLast, takeLast, takeLast, takeUntil, takeUntil, takeWhile, test, test, throttleFirst, throttleFirst, throttleFirst, throttleLast, throttleLast, throttleLast, throttleLatest, throttleLatest, throttleLatest, throttleLatest, throttleLatest, throttleWithTimeout, throttleWithTimeout, throttleWithTimeout, timeInterval, timeInterval, timeInterval, timeInterval, timeout, timeout, timeout, timeout, timeout, timeout, timeout, timeout, timer, timer, timestamp, timestamp, timestamp, timestamp, to, toFlowable, toFuture, toList, toList, toList, toMap, toMap, toMap, toMultimap, toMultimap, toMultimap, toMultimap, toSortedList, toSortedList, toSortedList, toSortedList, unsafeCreate, unsubscribeOn, using, using, window, window, window, window, window, window, window, window, window, window, window, window, window, window, window, window, window, withLatestFrom, withLatestFrom, withLatestFrom, withLatestFrom, withLatestFrom, withLatestFrom, wrap, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipArray, zipWith, zipWith, zipWith, zipWithModifier and TypeMethodDescriptionstatic <@NonNull T>
@NonNull Observable<T> Mirrors the oneObservableSourcein anIterableof severalObservableSources that first either emits an item or sends a termination notification.static <@NonNull T>
@NonNull Observable<T> ambArray(@NonNull ObservableSource<? extends @NonNull T>... sources) Mirrors the oneObservableSourcein an array of severalObservableSources that first either emits an item or sends a termination notification.final @NonNull Observable<T> ambWith(@NonNull ObservableSource<? extends T> other) Mirrors the currentObservableor the otherObservableSourceprovided of which the first either emits an item or sends a termination notification.Returns aSinglethat emitstrueif any item emitted by the currentObservablesatisfies a specified condition, otherwisefalse.final TReturns the first item emitted by the currentObservable, or throwsNoSuchElementExceptionif it emits no items.final TblockingFirst(T defaultItem) Returns the first item emitted by the currentObservable, or a default value if it emits no items.final voidblockingForEach(@NonNull Consumer<? super T> onNext) Consumes the currentObservablein a blocking fashion and invokes the givenConsumerwith each upstream item on the current thread until the upstream terminates.final voidblockingForEach(@NonNull Consumer<? super T> onNext, int capacityHint) Consumes the currentObservablein a blocking fashion and invokes the givenConsumerwith each upstream item on the current thread until the upstream terminates.Exposes the currentObservableas anIterablewhich, when iterated, subscribes to the currentObservableand blocks until the currentObservableemits items or terminates.blockingIterable(int capacityHint) Exposes the currentObservableas anIterablewhich, when iterated, subscribes to the currentObservableand blocks until the currentObservableemits items or terminates.final TReturns the last item emitted by the currentObservable, or throwsNoSuchElementExceptionif the currentObservableemits no items.final TblockingLast(T defaultItem) Returns the last item emitted by the currentObservable, or a default value if it emits no items.Returns anIterablethat returns the latest item emitted by the currentObservable, waiting if necessary for one to become available.blockingMostRecent(T initialItem) Returns anIterablethat always returns the item most recently emitted by the currentObservable.Returns anIterablethat blocks until the currentObservableemits another item, then returns that item.final TIf the currentObservablecompletes after emitting a single item, return that item, otherwise throw aNoSuchElementException.final TblockingSingle(T defaultItem) If the currentObservablecompletes after emitting a single item, return that item; if it emits more than one item, throw anIllegalArgumentException; if it emits no items, return a default value.Creates a sequentialStreamto consume or process the currentObservablein a blocking manner via the JavaStreamAPI.blockingStream(int capacityHint) Creates a sequentialStreamto consume or process the currentObservablein a blocking manner via the JavaStreamAPI.final voidRuns the currentObservableto a terminal event, ignoring any values and rethrowing any exception.final voidblockingSubscribe(@NonNull Observer<? super T> observer) Subscribes to the source and calls theObservermethods on the current thread.final voidblockingSubscribe(@NonNull Consumer<? super T> onNext) Subscribes to the source and calls the given callbacks on the current thread.final voidblockingSubscribe(@NonNull Consumer<? super T> onNext, @NonNull Consumer<? super Throwable> onError) Subscribes to the source and calls the given callbacks on the current thread.final voidblockingSubscribe(@NonNull Consumer<? super T> onNext, @NonNull Consumer<? super Throwable> onError, @NonNull Action onComplete) Subscribes to the source and calls the given callbacks on the current thread.final @NonNull Observable<@NonNull List<T>> buffer(int count) Returns anObservablethat emits buffers of items it collects from the currentObservable.final @NonNull Observable<@NonNull List<T>> buffer(int count, int skip) Returns anObservablethat emits buffers of items it collects from the currentObservable.final <@NonNull U extends Collection<? super @NonNull T>>
@NonNull Observable<U> Returns anObservablethat emits buffers of items it collects from the currentObservable.final <@NonNull U extends Collection<? super @NonNull T>>
@NonNull Observable<U> Returns anObservablethat emits buffers of items it collects from the currentObservable.final @NonNull Observable<@NonNull List<T>> Returns anObservablethat emits buffers of items it collects from the currentObservable.final @NonNull Observable<@NonNull List<T>> Returns anObservablethat emits buffers of items it collects from the currentObservable.final <@NonNull U extends Collection<? super @NonNull T>>
@NonNull Observable<U> buffer(long timespan, long timeskip, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Supplier<@NonNull U> bufferSupplier) Returns anObservablethat emits buffers of items it collects from the currentObservable.final @NonNull Observable<@NonNull List<T>> Returns anObservablethat emits buffers of items it collects from the currentObservable.final @NonNull Observable<@NonNull List<T>> Returns anObservablethat emits buffers of items it collects from the currentObservable.final @NonNull Observable<@NonNull List<T>> Returns anObservablethat emits buffers of items it collects from the currentObservable.final @NonNull Observable<@NonNull List<T>> Returns anObservablethat emits buffers of items it collects from the currentObservable.final <@NonNull U extends Collection<? super @NonNull T>>
@NonNull Observable<U> buffer(long timespan, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, int count, @NonNull Supplier<@NonNull U> bufferSupplier, boolean restartTimerOnMaxSize) Returns anObservablethat emits buffers of items it collects from the currentObservable.buffer(@NonNull ObservableSource<? extends @NonNull TOpening> openingIndicator, @NonNull Function<? super @NonNull TOpening, ? extends ObservableSource<? extends @NonNull TClosing>> closingIndicator) Returns anObservablethat emits buffers of items it collects from the currentObservable.final <@NonNull TOpening, @NonNull TClosing, @NonNull U extends Collection<? super @NonNull T>>
@NonNull Observable<U> buffer(@NonNull ObservableSource<? extends @NonNull TOpening> openingIndicator, @NonNull Function<? super @NonNull TOpening, ? extends ObservableSource<? extends @NonNull TClosing>> closingIndicator, @NonNull Supplier<@NonNull U> bufferSupplier) Returns anObservablethat emits buffers of items it collects from the currentObservable.buffer(@NonNull ObservableSource<@NonNull B> boundaryIndicator) Returns anObservablethat emits non-overlapping buffered items from the currentObservableeach time the specified boundaryObservableSourceemits an item.buffer(@NonNull ObservableSource<@NonNull B> boundaryIndicator, int initialCapacity) Returns anObservablethat emits non-overlapping buffered items from the currentObservableeach time the specified boundaryObservableSourceemits an item.final <@NonNull B, @NonNull U extends Collection<? super @NonNull T>>
@NonNull Observable<U> buffer(@NonNull ObservableSource<@NonNull B> boundaryIndicator, @NonNull Supplier<@NonNull U> bufferSupplier) Returns anObservablethat emits non-overlapping buffered items from the currentObservableeach time the specified boundaryObservableSourceemits an item.static intReturns the default 'island' size or capacity-increment hint for unbounded buffers.final @NonNull Observable<T> cache()Returns anObservablethat subscribes to the currentObservablelazily, caches all of its events and replays them, in the same order as received, to all the downstream observers.final @NonNull Observable<T> cacheWithInitialCapacity(int initialCapacity) Returns anObservablethat subscribes to the currentObservablelazily, caches all of its events and replays them, in the same order as received, to all the downstream observers.final <@NonNull U>
@NonNull Observable<U> Returns anObservablethat emits the upstream items while they can be cast viaClass.cast(Object)until the upstream terminates, or until the upstream signals an item which can't be cast, resulting in aClassCastExceptionto be signaled to the downstream.collect(@NonNull Supplier<? extends @NonNull U> initialItemSupplier, @NonNull BiConsumer<? super @NonNull U, ? super T> collector) Collects items emitted by the finite sourceObservableinto a single mutable data structure and returns aSinglethat emits this structure.collectInto(@NonNull U initialItem, @NonNull BiConsumer<? super @NonNull U, ? super T> collector) Collects items emitted by the finite sourceObservableinto a single mutable data structure and returns aSinglethat emits this structure.static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull T9, @NonNull R>
@NonNull Observable<R> combineLatest(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull ObservableSource<? extends @NonNull T5> source5, @NonNull ObservableSource<? extends @NonNull T6> source6, @NonNull ObservableSource<? extends @NonNull T7> source7, @NonNull ObservableSource<? extends @NonNull T8> source8, @NonNull ObservableSource<? extends @NonNull T9> source9, @NonNull Function9<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? super @NonNull T5, ? super @NonNull T6, ? super @NonNull T7, ? super @NonNull T8, ? super @NonNull T9, ? extends @NonNull R> combiner) Combines nine sourceObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function.static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull R>
@NonNull Observable<R> combineLatest(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull ObservableSource<? extends @NonNull T5> source5, @NonNull ObservableSource<? extends @NonNull T6> source6, @NonNull ObservableSource<? extends @NonNull T7> source7, @NonNull ObservableSource<? extends @NonNull T8> source8, @NonNull Function8<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? super @NonNull T5, ? super @NonNull T6, ? super @NonNull T7, ? super @NonNull T8, ? extends @NonNull R> combiner) Combines eight sourceObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function.static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull R>
@NonNull Observable<R> combineLatest(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull ObservableSource<? extends @NonNull T5> source5, @NonNull ObservableSource<? extends @NonNull T6> source6, @NonNull ObservableSource<? extends @NonNull T7> source7, @NonNull Function7<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? super @NonNull T5, ? super @NonNull T6, ? super @NonNull T7, ? extends @NonNull R> combiner) Combines seven sourceObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function.static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull R>
@NonNull Observable<R> combineLatest(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull ObservableSource<? extends @NonNull T5> source5, @NonNull ObservableSource<? extends @NonNull T6> source6, @NonNull Function6<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? super @NonNull T5, ? super @NonNull T6, ? extends @NonNull R> combiner) Combines six sourceObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function.static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull R>
@NonNull Observable<R> combineLatest(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull ObservableSource<? extends @NonNull T5> source5, @NonNull Function5<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? super @NonNull T5, ? extends @NonNull R> combiner) Combines five sourceObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function.combineLatest(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull Function4<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? extends @NonNull R> combiner) Combines four sourceObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function.combineLatest(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull Function3<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? extends @NonNull R> combiner) Combines three sourceObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function.static <@NonNull T1, @NonNull T2, @NonNull R>
@NonNull Observable<R> combineLatest(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull BiFunction<? super @NonNull T1, ? super @NonNull T2, ? extends @NonNull R> combiner) Combines two sourceObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from either of theObservableSources, where this aggregation is defined by a specified function.static <@NonNull T, @NonNull R>
@NonNull Observable<R> combineLatest(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, @NonNull Function<? super Object[], ? extends @NonNull R> combiner) Combines a collection of sourceObservableSources by emitting an item that aggregates the latest values of each of the returnedObservableSources each time an item is received from any of the returnedObservableSources, where this aggregation is defined by a specified function.static <@NonNull T, @NonNull R>
@NonNull Observable<R> combineLatest(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, @NonNull Function<? super Object[], ? extends @NonNull R> combiner, int bufferSize) Combines anIterableof sourceObservableSources by emitting an item that aggregates the latest values of each of the returnedObservableSources each time an item is received from any of the returnedObservableSources, where this aggregation is defined by a specified function.static <@NonNull T, @NonNull R>
@NonNull Observable<R> combineLatestArray(@NonNull ObservableSource<? extends @NonNull T>[] sources, @NonNull Function<? super Object[], ? extends @NonNull R> combiner) Combines an array of sourceObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of the returnedObservableSources, where this aggregation is defined by a specified function.static <@NonNull T, @NonNull R>
@NonNull Observable<R> combineLatestArray(@NonNull ObservableSource<? extends @NonNull T>[] sources, @NonNull Function<? super Object[], ? extends @NonNull R> combiner, int bufferSize) Combines an array of sourceObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function.static <@NonNull T, @NonNull R>
@NonNull Observable<R> combineLatestArrayDelayError(@NonNull ObservableSource<? extends @NonNull T>[] sources, @NonNull Function<? super Object[], ? extends @NonNull R> combiner) Combines an array ofObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function.static <@NonNull T, @NonNull R>
@NonNull Observable<R> combineLatestArrayDelayError(@NonNull ObservableSource<? extends @NonNull T>[] sources, @NonNull Function<? super Object[], ? extends @NonNull R> combiner, int bufferSize) Combines an array ofObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function and delays any error from the sources until all sourceObservableSources terminate.static <@NonNull T, @NonNull R>
@NonNull Observable<R> combineLatestDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, @NonNull Function<? super Object[], ? extends @NonNull R> combiner) Combines anIterableofObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function and delays any error from the sources until all sourceObservableSources terminate.static <@NonNull T, @NonNull R>
@NonNull Observable<R> combineLatestDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, @NonNull Function<? super Object[], ? extends @NonNull R> combiner, int bufferSize) Combines anIterableofObservableSources by emitting an item that aggregates the latest values of each of theObservableSources each time an item is received from any of theObservableSources, where this aggregation is defined by a specified function and delays any error from the sources until all sourceObservableSources terminate.final <@NonNull R>
@NonNull Observable<R> compose(@NonNull ObservableTransformer<? super T, ? extends @NonNull R> composer) Transform the currentObservableby applying a particularObservableTransformerfunction to it.static <@NonNull T>
@NonNull Observable<T> concat(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources) Returns anObservablethat emits the items emitted by each of theObservableSources emitted by theObservableSource, one after the other, without interleaving them.static <@NonNull T>
@NonNull Observable<T> concat(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources, int bufferSize) Returns anObservablethat emits the items emitted by each of theObservableSources emitted by the outerObservableSource, one after the other, without interleaving them.static <@NonNull T>
@NonNull Observable<T> concat(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2, @NonNull ObservableSource<? extends @NonNull T> source3) Returns anObservablethat emits the items emitted by threeObservableSources, one after the other, without interleaving them.static <@NonNull T>
@NonNull Observable<T> concat(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2, @NonNull ObservableSource<? extends @NonNull T> source3, @NonNull ObservableSource<? extends @NonNull T> source4) Returns anObservablethat emits the items emitted by fourObservableSources, one after the other, without interleaving them.static <@NonNull T>
@NonNull Observable<T> concat(@NonNull ObservableSource<? extends @NonNull T> source1, ObservableSource<? extends @NonNull T> source2) Returns anObservablethat emits the items emitted by twoObservableSources, one after the other, without interleaving them.static <@NonNull T>
@NonNull Observable<T> Concatenates elements of eachObservableSourceprovided via anIterablesequence into a single sequence of elements without interleaving them.static <@NonNull T>
@NonNull Observable<T> concatArray(@NonNull ObservableSource<? extends @NonNull T>... sources) Concatenates a variable number ofObservableSourcesources.static <@NonNull T>
@NonNull Observable<T> concatArrayDelayError(@NonNull ObservableSource<? extends @NonNull T>... sources) Concatenates a variable number ofObservableSourcesources and delays errors from any of them till all terminate.static <@NonNull T>
@NonNull Observable<T> concatArrayEager(int maxConcurrency, int bufferSize, @NonNull ObservableSource<? extends @NonNull T>... sources) Concatenates an array ofObservableSources eagerly into a single stream of values.static <@NonNull T>
@NonNull Observable<T> concatArrayEager(@NonNull ObservableSource<? extends @NonNull T>... sources) Concatenates an array ofObservableSources eagerly into a single stream of values.static <@NonNull T>
@NonNull Observable<T> concatArrayEagerDelayError(int maxConcurrency, int bufferSize, @NonNull ObservableSource<? extends @NonNull T>... sources) Concatenates an array ofObservableSources eagerly into a single stream of values and delaying any errors until all sources terminate.static <@NonNull T>
@NonNull Observable<T> concatArrayEagerDelayError(@NonNull ObservableSource<? extends @NonNull T>... sources) Concatenates an array ofObservableSources eagerly into a single stream of values and delaying any errors until all sources terminate.static <@NonNull T>
@NonNull Observable<T> concatDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources) Concatenates theObservableSourcesequence ofObservableSources into a singleObservablesequence by subscribing to each innerObservableSource, one after the other, one at a time and delays any errors till the all inner and the outerObservableSources terminate.static <@NonNull T>
@NonNull Observable<T> concatDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources, int bufferSize, boolean tillTheEnd) Concatenates theObservableSourcesequence ofObservableSources into a single sequence by subscribing to each innerObservableSource, one after the other, one at a time and delays any errors till the all inner and the outerObservableSources terminate.static <@NonNull T>
@NonNull Observable<T> concatDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources) Concatenates theIterablesequence ofObservableSources into a singleObservablesequence by subscribing to eachObservableSource, one after the other, one at a time and delays any errors till the all innerObservableSources terminate.static <@NonNull T>
@NonNull Observable<T> concatEager(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources) Concatenates anObservableSourcesequence ofObservableSources eagerly into a single stream of values.static <@NonNull T>
@NonNull Observable<T> concatEager(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources, int maxConcurrency, int bufferSize) Concatenates anObservableSourcesequence ofObservableSources eagerly into a single stream of values and runs a limited number of inner sequences at once.static <@NonNull T>
@NonNull Observable<T> concatEager(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources) Concatenates a sequence ofObservableSources eagerly into a single stream of values.static <@NonNull T>
@NonNull Observable<T> concatEager(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, int maxConcurrency, int bufferSize) Concatenates a sequence ofObservableSources eagerly into a single stream of values and runs a limited number of inner sequences at once.static <@NonNull T>
@NonNull Observable<T> concatEagerDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources) Concatenates anObservableSourcesequence ofObservableSources eagerly into a single stream of values, delaying errors until all the inner and the outer sequence terminate.static <@NonNull T>
@NonNull Observable<T> concatEagerDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources, int maxConcurrency, int bufferSize) Concatenates anObservableSourcesequence ofObservableSources 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.static <@NonNull T>
@NonNull Observable<T> concatEagerDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources) Concatenates a sequence ofObservableSources eagerly into a single stream of values, delaying errors until all the inner sequences terminate.static <@NonNull T>
@NonNull Observable<T> concatEagerDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, int maxConcurrency, int bufferSize) Concatenates a sequence ofObservableSources 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.final <@NonNull R>
@NonNull Observable<R> Returns a newObservablethat emits items resulting from applying a function that you supply to each item emitted by the currentObservable, where that function returns anObservableSource, and then emitting the items that result from concatenating those returnedObservableSources.final <@NonNull R>
@NonNull Observable<R> concatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, int bufferSize) Returns a newObservablethat emits items resulting from applying a function that you supply to each item emitted by the currentObservable, where that function returns anObservableSource, and then emitting the items that result from concatenating those returnedObservableSources.final <@NonNull R>
@NonNull Observable<R> concatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, int bufferSize, @NonNull Scheduler scheduler) Returns a newObservablethat emits items resulting from applying a function that you supply to each item emitted by the currentObservable, where that function returns anObservableSource, and then emitting the items that result from concatenating those returnedObservableSources.final @NonNull CompletableconcatMapCompletable(@NonNull Function<? super T, ? extends CompletableSource> mapper) Maps each element of the currentObservableintoCompletableSources, subscribes to them one at a time in order and waits until the upstream and allCompletableSources complete.final @NonNull CompletableconcatMapCompletable(@NonNull Function<? super T, ? extends CompletableSource> mapper, int capacityHint) Maps each element of the currentObservableintoCompletableSources, subscribes to them one at a time in order and waits until the upstream and allCompletableSources complete.final @NonNull CompletableconcatMapCompletableDelayError(@NonNull Function<? super T, ? extends CompletableSource> mapper) Maps the upstream items intoCompletableSources and subscribes to them one after the other terminates, delaying all errors till both the currentObservableand all innerCompletableSources terminate.final @NonNull CompletableconcatMapCompletableDelayError(@NonNull Function<? super T, ? extends CompletableSource> mapper, boolean tillTheEnd) Maps the upstream items intoCompletableSources and subscribes to them one after the other terminates, optionally delaying all errors till both the currentObservableand all innerCompletableSources terminate.final @NonNull CompletableconcatMapCompletableDelayError(@NonNull Function<? super T, ? extends CompletableSource> mapper, boolean tillTheEnd, int bufferSize) Maps the upstream items intoCompletableSources and subscribes to them one after the other terminates, optionally delaying all errors till both the currentObservableand all innerCompletableSources terminate.final <@NonNull R>
@NonNull Observable<R> concatMapDelayError(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper) Maps each of the items into anObservableSource, 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 innerObservableSources till all of them terminate.final <@NonNull R>
@NonNull Observable<R> concatMapDelayError(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, boolean tillTheEnd, int bufferSize) Maps each of the items into anObservableSource, 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 innerObservableSources till all of them terminate.final <@NonNull R>
@NonNull Observable<R> concatMapDelayError(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, boolean tillTheEnd, int bufferSize, @NonNull Scheduler scheduler) Maps each of the items into anObservableSource, 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 innerObservableSources till all of them terminate.final <@NonNull R>
@NonNull Observable<R> concatMapEager(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper) Maps a sequence of values intoObservableSources and concatenates theseObservableSources eagerly into a singleObservablesequence.final <@NonNull R>
@NonNull Observable<R> concatMapEager(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, int maxConcurrency, int bufferSize) Maps a sequence of values intoObservableSources and concatenates theseObservableSources eagerly into a singleObservablesequence.final <@NonNull R>
@NonNull Observable<R> concatMapEagerDelayError(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, boolean tillTheEnd) Maps a sequence of values intoObservableSources and concatenates theseObservableSources eagerly into a singleObservablesequence.final <@NonNull R>
@NonNull Observable<R> concatMapEagerDelayError(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, boolean tillTheEnd, int maxConcurrency, int bufferSize) Maps a sequence of values intoObservableSources and concatenates theseObservableSources eagerly into a singleObservablesequence.final <@NonNull U>
@NonNull Observable<U> concatMapIterable(@NonNull Function<? super T, @NonNull ? extends Iterable<? extends @NonNull U>> mapper) Returns anObservablethat concatenate each item emitted by the currentObservablewith the values in anIterablecorresponding to that item that is generated by a selector.final <@NonNull R>
@NonNull Observable<R> concatMapMaybe(@NonNull Function<? super T, ? extends MaybeSource<? extends @NonNull R>> mapper) Maps the upstream items intoMaybeSources and subscribes to them one after the other succeeds or completes, emits their success value if available or terminates immediately if either the currentObservableor the current innerMaybeSourcefail.final <@NonNull R>
@NonNull Observable<R> concatMapMaybe(@NonNull Function<? super T, ? extends MaybeSource<? extends @NonNull R>> mapper, int bufferSize) Maps the upstream items intoMaybeSources and subscribes to them one after the other succeeds or completes, emits their success value if available or terminates immediately if either the currentObservableor the current innerMaybeSourcefail.final <@NonNull R>
@NonNull Observable<R> concatMapMaybeDelayError(@NonNull Function<? super T, ? extends MaybeSource<? extends @NonNull R>> mapper) Maps the upstream items intoMaybeSources and subscribes to them one after the other terminates, emits their success value if available and delaying all errors till both the currentObservableand all innerMaybeSources terminate.final <@NonNull R>
@NonNull Observable<R> concatMapMaybeDelayError(@NonNull Function<? super T, ? extends MaybeSource<? extends @NonNull R>> mapper, boolean tillTheEnd) Maps the upstream items intoMaybeSources and subscribes to them one after the other terminates, emits their success value if available and optionally delaying all errors till both the currentObservableand all innerMaybeSources terminate.final <@NonNull R>
@NonNull Observable<R> concatMapMaybeDelayError(@NonNull Function<? super T, ? extends MaybeSource<? extends @NonNull R>> mapper, boolean tillTheEnd, int bufferSize) Maps the upstream items intoMaybeSources and subscribes to them one after the other terminates, emits their success value if available and optionally delaying all errors till both the currentObservableand all innerMaybeSources terminate.final <@NonNull R>
@NonNull Observable<R> concatMapSingle(@NonNull Function<? super T, ? extends SingleSource<? extends @NonNull R>> mapper) Maps the upstream items intoSingleSources and subscribes to them one after the other succeeds, emits their success values or terminates immediately if either the currentObservableor the current innerSingleSourcefail.final <@NonNull R>
@NonNull Observable<R> concatMapSingle(@NonNull Function<? super T, ? extends SingleSource<? extends @NonNull R>> mapper, int bufferSize) Maps the upstream items intoSingleSources and subscribes to them one after the other succeeds, emits their success values or terminates immediately if either the currentObservableor the current innerSingleSourcefail.final <@NonNull R>
@NonNull Observable<R> concatMapSingleDelayError(@NonNull Function<? super T, ? extends SingleSource<? extends @NonNull R>> mapper) Maps the upstream items intoSingleSources and subscribes to them one after the other succeeds or fails, emits their success values and delays all errors till both the currentObservableand all innerSingleSources terminate.final <@NonNull R>
@NonNull Observable<R> concatMapSingleDelayError(@NonNull Function<? super T, ? extends SingleSource<? extends @NonNull R>> mapper, boolean tillTheEnd) Maps the upstream items intoSingleSources and subscribes to them one after the other succeeds or fails, emits their success values and optionally delays all errors till both the currentObservableand all innerSingleSources terminate.final <@NonNull R>
@NonNull Observable<R> concatMapSingleDelayError(@NonNull Function<? super T, ? extends SingleSource<? extends @NonNull R>> mapper, boolean tillTheEnd, int bufferSize) Maps the upstream items intoSingleSources and subscribes to them one after the other succeeds or fails, emits their success values and optionally delays errors till both the currentObservableand all innerSingleSources terminate.final <@NonNull R>
@NonNull Observable<R> concatMapStream(@NonNull Function<? super T, @NonNull ? extends Stream<? extends @NonNull R>> mapper) Maps each upstream item into aStreamand emits theStream's items to the downstream in a sequential fashion.final @NonNull Observable<T> concatWith(@NonNull CompletableSource other) Returns anObservablethat emits items from the currentObservableand when it completes normally, the otherCompletableSourceis subscribed to and the returnedObservableemits its terminal events.final @NonNull Observable<T> concatWith(@NonNull MaybeSource<? extends T> other) Returns anObservablethat emits the items from the currentObservablefollowed by the success item or terminal events of the otherMaybeSource.final @NonNull Observable<T> concatWith(@NonNull ObservableSource<? extends T> other) Returns anObservablethat first emits the items emitted from the currentObservable, then items from theotherObservableSourcewithout interleaving them.final @NonNull Observable<T> concatWith(@NonNull SingleSource<? extends T> other) Returns anObservablethat emits the items from the currentObservablefollowed by the success item or error event of theotherSingleSource.count()static <@NonNull T>
@NonNull Observable<T> create(@NonNull ObservableOnSubscribe<@NonNull T> source) Provides an API (via a coldObservable) that bridges the reactive world with the callback-style world.final @NonNull Observable<T> Returns anObservablethat mirrors the currentObservable, except that it drops items emitted by the currentObservablethat are followed by newer items before a timeout value expires.final @NonNull Observable<T> Returns anObservablethat mirrors the currentObservable, except that it drops items emitted by the currentObservablethat are followed by newer items before a timeout value expires on a specifiedScheduler.final @NonNull Observable<T> debounce(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Consumer<? super T> onDropped) Returns anObservablethat mirrors the currentObservable, except that it drops items emitted by the currentObservablethat are followed by newer items before a timeout value expires on a specifiedScheduler.final <@NonNull U>
@NonNull Observable<T> Returns anObservablethat mirrors the currentObservable, except that it drops items emitted by the currentObservablethat are followed by another item within a computed debounce duration denoted by an item emission or completion from a generated innerObservableSourcefor that original item.final @NonNull Observable<T> defaultIfEmpty(T defaultItem) Returns anObservablethat emits the items emitted by the currentObservableor a specified default item if the currentObservableis empty.static <@NonNull T>
@NonNull Observable<T> Returns anObservablethat calls anObservableSourcefactory to create anObservableSourcefor each newObserverthat subscribes.final @NonNull Observable<T> Returns anObservablethat emits the items emitted by the currentObservableshifted forward in time by a specified delay.final @NonNull Observable<T> Returns anObservablethat emits the items emitted by the currentObservableshifted forward in time by a specified delay.final @NonNull Observable<T> Returns anObservablethat emits the items emitted by the currentObservableshifted forward in time by a specified delay.final @NonNull Observable<T> Returns anObservablethat emits the items emitted by the currentObservableshifted forward in time by a specified delay.final <@NonNull U, @NonNull V>
@NonNull Observable<T> delay(@NonNull ObservableSource<@NonNull U> subscriptionIndicator, @NonNull Function<? super T, ? extends ObservableSource<@NonNull V>> itemDelayIndicator) Returns anObservablethat delays the subscription to and emissions from the currentObservableviaObservableSources for the subscription itself and on a per-item basis.final <@NonNull U>
@NonNull Observable<T> Returns anObservablethat delays the emissions of the currentObservablevia a per-item derivedObservableSource's item emission or termination, on a per source item basis.final @NonNull Observable<T> delaySubscription(long time, @NonNull TimeUnit unit) Returns anObservablethat delays the subscription to the currentObservableby a given amount of time.final @NonNull Observable<T> delaySubscription(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) Returns anObservablethat delays the subscription to the currentObservableby a given amount of time, both waiting and subscribing on a givenScheduler.final <@NonNull U>
@NonNull Observable<T> delaySubscription(@NonNull ObservableSource<@NonNull U> subscriptionIndicator) Returns anObservablethat delays the subscription to the currentObservableuntil the otherObservableSourceemits an element or completes normally.final <@NonNull R>
@NonNull Observable<R> dematerialize(@NonNull Function<? super T, Notification<@NonNull R>> selector) Returns anObservablethat reverses the effect ofmaterializeby transforming theNotificationobjects extracted from the source items via a selector function into their respectiveObserversignal types.final @NonNull Observable<T> distinct()Returns anObservablethat emits all items emitted by the currentObservablethat are distinct based onObject.equals(Object)comparison.final <@NonNull K>
@NonNull Observable<T> Returns anObservablethat emits all items emitted by the currentObservablethat are distinct according to a key selector function and based onObject.equals(Object)comparison of the objects returned by the key selector function.final <@NonNull K>
@NonNull Observable<T> distinct(@NonNull Function<? super T, @NonNull K> keySelector, @NonNull Supplier<? extends Collection<? super @NonNull K>> collectionSupplier) Returns anObservablethat emits all items emitted by the currentObservablethat are distinct according to a key selector function and based onObject.equals(Object)comparison of the objects returned by the key selector function.final @NonNull Observable<T> Returns anObservablethat emits all items emitted by the currentObservablethat are distinct from their immediate predecessors based onObject.equals(Object)comparison.final @NonNull Observable<T> distinctUntilChanged(@NonNull BiPredicate<? super T, ? super T> comparer) Returns anObservablethat emits all items emitted by the currentObservablethat are distinct from their immediate predecessors when compared with each other via the provided comparator function.final <@NonNull K>
@NonNull Observable<T> distinctUntilChanged(@NonNull Function<? super T, @NonNull K> keySelector) Returns anObservablethat emits all items emitted by the currentObservablethat are distinct from their immediate predecessors, according to a key selector function and based onObject.equals(Object)comparison of those objects returned by the key selector function.final @NonNull Observable<T> doAfterNext(@NonNull Consumer<? super T> onAfterNext) Calls the specifiedConsumerwith the current item after this item has been emitted to the downstream.final @NonNull Observable<T> doAfterTerminate(@NonNull Action onAfterTerminate) final @NonNull Observable<T> Calls the specified action after the currentObservablesignalsonErrororonCompletedor gets disposed by the downstream.final @NonNull Observable<T> doOnComplete(@NonNull Action onComplete) final @NonNull Observable<T> doOnDispose(@NonNull Action onDispose) Calls the given sharedActionif the downstream disposes the sequence.final @NonNull Observable<T> Returns anObservablethat forwards the items and terminal events of the currentObservableto itsObservers and to the given sharedObserverinstance.final @NonNull Observable<T> doOnEach(@NonNull Consumer<? super Notification<T>> onNotification) Returns anObservablethat invokes aConsumerwith the appropriateNotificationobject when the currentObservablesignals an item or terminates.final @NonNull Observable<T> final @NonNull Observable<T> doOnLifecycle(@NonNull Consumer<? super Disposable> onSubscribe, @NonNull Action onDispose) Calls the appropriateonXXXmethod (shared between allObservers) for the lifecycle events of the sequence (subscription, disposal).final @NonNull Observable<T> Calls the givenConsumerwith the value emitted by the currentObservablebefore forwarding it to the downstream.final @NonNull Observable<T> doOnSubscribe(@NonNull Consumer<? super Disposable> onSubscribe) final @NonNull Observable<T> doOnTerminate(@NonNull Action onTerminate) Returns anObservableso that it invokes an action when the currentObservablecallsonCompleteoronError.elementAt(long index) Returns aMaybethat emits the single item at a specified index in a sequence of emissions from the currentObservableor completes if the currentObservablesignals fewer elements than index.Returns aSinglethat emits the item found at a specified index in a sequence of emissions from the currentObservable, or a default item if that index is out of range.elementAtOrError(long index) Returns aSinglethat emits the item found at a specified index in a sequence of emissions from the currentObservableor signals aNoSuchElementExceptionif the currentObservablesignals fewer elements than index.static <@NonNull T>
@NonNull Observable<T> empty()Returns anObservablethat emits no items to theObserverand immediately invokes itsonCompletemethod.static <@NonNull T>
@NonNull Observable<T> static <@NonNull T>
@NonNull Observable<T> final @NonNull Observable<T> Filters items emitted by the currentObservableby only emitting those that satisfy a specifiedPredicate.Returns aSinglethat emits only the very first item emitted by the currentObservable, or a default item if the currentObservablecompletes without emitting any items.Returns aMaybethat emits only the very first item emitted by the currentObservable, or completes if the currentObservableis empty.Returns aSinglethat emits only the very first item emitted by the currentObservableor signals aNoSuchElementExceptionif the currentObservableis empty.final @NonNull CompletionStage<T> Signals the first upstream item or aNoSuchElementExceptionif the upstream is empty via aCompletionStage.final @NonNull CompletionStage<T> firstStage(T defaultItem) Signals the first upstream item (or the default item if the upstream is empty) via aCompletionStage.final <@NonNull R>
@NonNull Observable<R> Returns anObservablethat emits items based on applying a function that you supply to each item emitted by the currentObservable, where that function returns anObservableSource, and then merging those returnedObservableSources and emitting the results of this merger.final <@NonNull R>
@NonNull Observable<R> flatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, boolean delayErrors) Returns anObservablethat emits items based on applying a function that you supply to each item emitted by the currentObservable, where that function returns anObservableSource, and then merging those returnedObservableSources and emitting the results of this merger.final <@NonNull R>
@NonNull Observable<R> flatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, boolean delayErrors, int maxConcurrency) Returns anObservablethat emits items based on applying a function that you supply to each item emitted by the currentObservable, where that function returns anObservableSource, and then merging those returnedObservableSources and emitting the results of this merger, while limiting the maximum number of concurrent subscriptions to theseObservableSources.final <@NonNull R>
@NonNull Observable<R> flatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, boolean delayErrors, int maxConcurrency, int bufferSize) Returns anObservablethat emits items based on applying a function that you supply to each item emitted by the currentObservable, where that function returns anObservableSource, and then merging those returnedObservableSources and emitting the results of this merger, while limiting the maximum number of concurrent subscriptions to theseObservableSources.final <@NonNull R>
@NonNull Observable<R> flatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, int maxConcurrency) Returns anObservablethat emits items based on applying a function that you supply to each item emitted by the currentObservable, where that function returns anObservableSource, and then merging those returnedObservableSources and emitting the results of this merger, while limiting the maximum number of concurrent subscriptions to theseObservableSources.final <@NonNull R>
@NonNull Observable<R> flatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> onNextMapper, @NonNull Function<? super Throwable, ? extends ObservableSource<? extends @NonNull R>> onErrorMapper, @NonNull Supplier<? extends ObservableSource<? extends @NonNull R>> onCompleteSupplier) Returns anObservablethat applies a function to each item emitted or notification raised by the currentObservableand then flattens theObservableSources returned from these functions and emits the resulting items.final <@NonNull R>
@NonNull Observable<R> flatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> onNextMapper, @NonNull Function<Throwable, ? extends ObservableSource<? extends @NonNull R>> onErrorMapper, @NonNull Supplier<? extends ObservableSource<? extends @NonNull R>> onCompleteSupplier, int maxConcurrency) Returns anObservablethat applies a function to each item emitted or notification raised by the currentObservableand then flattens theObservableSources returned from these functions and emits the resulting items, while limiting the maximum number of concurrent subscriptions to theseObservableSources.final <@NonNull U, @NonNull R>
@NonNull Observable<R> flatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull U>> mapper, @NonNull BiFunction<? super T, ? super @NonNull U, ? extends @NonNull R> combiner) Returns anObservablethat emits the results of a specified function to the pair of values emitted by the currentObservableand the mapped innerObservableSource.final <@NonNull U, @NonNull R>
@NonNull Observable<R> flatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull U>> mapper, @NonNull BiFunction<? super T, ? super @NonNull U, ? extends @NonNull R> combiner, boolean delayErrors) Returns anObservablethat emits the results of a specified function to the pair of values emitted by the currentObservableand the mapped innerObservableSource.final <@NonNull U, @NonNull R>
@NonNull Observable<R> flatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull U>> mapper, @NonNull BiFunction<? super T, ? super @NonNull U, ? extends @NonNull R> combiner, boolean delayErrors, int maxConcurrency) Returns anObservablethat emits the results of a specified function to the pair of values emitted by the currentObservableand the mapped innerObservableSource, while limiting the maximum number of concurrent subscriptions to theseObservableSources.final <@NonNull U, @NonNull R>
@NonNull Observable<R> flatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull U>> mapper, @NonNull BiFunction<? super T, ? super @NonNull U, ? extends @NonNull R> combiner, boolean delayErrors, int maxConcurrency, int bufferSize) Returns anObservablethat emits the results of a specified function to the pair of values emitted by the currentObservableand the mapped innerObservableSource, while limiting the maximum number of concurrent subscriptions to theseObservableSources.final <@NonNull U, @NonNull R>
@NonNull Observable<R> flatMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull U>> mapper, @NonNull BiFunction<? super T, ? super @NonNull U, ? extends @NonNull R> combiner, int maxConcurrency) Returns anObservablethat emits the results of a specified function to the pair of values emitted by the currentObservableand the mapped innerObservableSource, while limiting the maximum number of concurrent subscriptions to theseObservableSources.final @NonNull CompletableflatMapCompletable(@NonNull Function<? super T, ? extends CompletableSource> mapper) Maps each element of the currentObservableintoCompletableSources, subscribes to them and waits until the upstream and allCompletableSources complete.final @NonNull CompletableflatMapCompletable(@NonNull Function<? super T, ? extends CompletableSource> mapper, boolean delayErrors) Maps each element of the currentObservableintoCompletableSources, subscribes to them and waits until the upstream and allCompletableSources complete, optionally delaying all errors.final <@NonNull U>
@NonNull Observable<U> flatMapIterable(@NonNull Function<? super T, @NonNull ? extends Iterable<? extends @NonNull U>> mapper) final <@NonNull U, @NonNull V>
@NonNull Observable<V> flatMapIterable(@NonNull Function<? super T, @NonNull ? extends Iterable<? extends @NonNull U>> mapper, @NonNull BiFunction<? super T, ? super @NonNull U, ? extends @NonNull V> combiner) MergesIterables generated by a mapperFunctionfor each individual item emitted by the currentObservableinto a singleObservablesequence where the resulting items will be the combination of the original item and each inner item of the respectiveIterableas returned by theresultSelectorBiFunction.final <@NonNull R>
@NonNull Observable<R> flatMapMaybe(@NonNull Function<? super T, ? extends MaybeSource<? extends @NonNull R>> mapper) Maps each element of the currentObservableintoMaybeSources, subscribes to all of them and merges theironSuccessvalues, in no particular order, into a singleObservablesequence.final <@NonNull R>
@NonNull Observable<R> flatMapMaybe(@NonNull Function<? super T, ? extends MaybeSource<? extends @NonNull R>> mapper, boolean delayErrors) Maps each element of the currentObservableintoMaybeSources, subscribes to them and merges theironSuccessvalues, in no particular order, into a singleObservablesequence, optionally delaying all errors.final <@NonNull R>
@NonNull Observable<R> flatMapSingle(@NonNull Function<? super T, ? extends SingleSource<? extends @NonNull R>> mapper) Maps each element of the currentObservableintoSingleSources, subscribes to all of them and merges theironSuccessvalues, in no particular order, into a singleObservablesequence.final <@NonNull R>
@NonNull Observable<R> flatMapSingle(@NonNull Function<? super T, ? extends SingleSource<? extends @NonNull R>> mapper, boolean delayErrors) Maps each element of the currentObservableintoSingleSources, subscribes to them and merges theironSuccessvalues, in no particular order, into a singleObservablesequence, optionally delaying all errors.final <@NonNull R>
@NonNull Observable<R> Maps each upstream item into aStreamand emits theStream's items to the downstream in a sequential fashion.final @NonNull DisposableSubscribes to theObservableSourceand calls aConsumerfor each item of the currentObservableon its emission thread.final @NonNull DisposableforEachWhile(@NonNull Predicate<? super T> onNext) Subscribes to theObservableSourceand calls aPredicatefor each item of the currentObservable, on its emission thread, until the predicate returnsfalse.final @NonNull DisposableSubscribes to theObservableSourceand calls aPredicatefor each item or aConsumerwith the error of the currentObservable, on their original emission threads, until the predicate returnsfalse.final @NonNull DisposableforEachWhile(@NonNull Predicate<? super T> onNext, @NonNull Consumer<? super Throwable> onError, @NonNull Action onComplete) Subscribes to theObservableSourceand calls aPredicatefor each item, aConsumerwith the error or anActionupon completion of the currentObservable, on their original emission threads, until the predicate returnsfalse.static <@NonNull T>
@NonNull Observable<T> fromAction(@NonNull Action action) static <@NonNull T>
@NonNull Observable<T> Converts an array into anObservableSourcethat emits the items in the array.static <@NonNull T>
@NonNull Observable<T> fromCallable(@NonNull Callable<? extends @NonNull T> callable) Returns anObservablethat, when an observer subscribes to it, invokes a function you specify and then emits the value returned from that function.static <@NonNull T>
@NonNull Observable<T> fromCompletable(@NonNull CompletableSource completableSource) Wraps aCompletableSourceinto anObservable.static <@NonNull T>
@NonNull Observable<@NonNull T> fromCompletionStage(@NonNull CompletionStage<@NonNull T> stage) Signals the completion value or error of the given (hot)CompletionStage-based asynchronous calculation.static <@NonNull T>
@NonNull Observable<T> fromFuture(@NonNull Future<? extends @NonNull T> future) Converts aFutureinto anObservable.static <@NonNull T>
@NonNull Observable<T> static <@NonNull T>
@NonNull Observable<T> fromIterable(@NonNull Iterable<? extends @NonNull T> source) Converts anIterablesequence into anObservablethat emits the items in the sequence.static <@NonNull T>
@NonNull Observable<T> fromMaybe(@NonNull MaybeSource<@NonNull T> maybe) Returns anObservableinstance that when subscribed to, subscribes to theMaybeSourceinstance and emitsonSuccessas a single item or forwards anyonCompleteoronErrorsignal.static <@NonNull T>
@NonNull Observable<@NonNull T> fromOptional(@NonNull Optional<@NonNull T> optional) Converts the existing value of the provided optional into aObservable.just(Object)or an empty optional into anObservable.empty()Observableinstance.static <@NonNull T>
@NonNull Observable<T> fromPublisher(@NonNull Flow.Publisher<? extends @NonNull T> publisher) Converts an arbitrary Reactive StreamsFlow.Publisherinto anObservable.static <@NonNull T>
@NonNull Observable<T> fromRunnable(@NonNull Runnable run) static <@NonNull T>
@NonNull Observable<T> fromSingle(@NonNull SingleSource<@NonNull T> source) Returns anObservableinstance that when subscribed to, subscribes to theSingleSourceinstance and emitsonSuccessas a single item or forwards theonErrorsignal.static <@NonNull T>
@NonNull Observable<@NonNull T> fromStream(@NonNull Stream<@NonNull T> stream) Converts aStreaminto a finiteObservableand emits its items in the sequence.static <@NonNull T>
@NonNull Observable<T> fromSupplier(@NonNull Supplier<? extends @NonNull T> supplier) Returns anObservablethat, when an observer subscribes to it, invokes a supplier function you specify and then emits the value returned from that function.static <@NonNull T>
@NonNull Observable<T> Returns a cold, synchronous and stateless generator of values.static <@NonNull T, @NonNull S>
@NonNull Observable<T> generate(@NonNull Supplier<@NonNull S> initialState, @NonNull BiConsumer<@NonNull S, Emitter<@NonNull T>> generator) Returns a cold, synchronous and stateful generator of values.static <@NonNull T, @NonNull S>
@NonNull Observable<T> generate(@NonNull Supplier<@NonNull S> initialState, @NonNull BiConsumer<@NonNull S, Emitter<@NonNull T>> generator, @NonNull Consumer<? super @NonNull S> disposeState) Returns a cold, synchronous and stateful generator of values.static <@NonNull T, @NonNull S>
@NonNull Observable<T> generate(@NonNull Supplier<@NonNull S> initialState, @NonNull BiFunction<@NonNull S, Emitter<@NonNull T>, @NonNull S> generator) Returns a cold, synchronous and stateful generator of values.static <@NonNull T, @NonNull S>
@NonNull Observable<T> generate(@NonNull Supplier<@NonNull S> initialState, @NonNull BiFunction<@NonNull S, Emitter<@NonNull T>, @NonNull S> generator, @NonNull Consumer<? super @NonNull S> disposeState) Returns a cold, synchronous and stateful generator of values.final <@NonNull K>
@NonNull Observable<GroupedObservable<K, T>> Groups the items emitted by the currentObservableaccording to a specified criterion, and emits these grouped items asGroupedObservables.final <@NonNull K>
@NonNull Observable<GroupedObservable<K, T>> Groups the items emitted by the currentObservableaccording to a specified criterion, and emits these grouped items asGroupedObservables.final <@NonNull K, @NonNull V>
@NonNull Observable<GroupedObservable<K, V>> groupBy(@NonNull Function<? super T, ? extends @NonNull K> keySelector, @NonNull Function<? super T, ? extends @NonNull V> valueSelector, boolean delayError) Groups the items emitted by the currentObservableaccording to a specified criterion, and emits these grouped items asGroupedObservables.final <@NonNull K, @NonNull V>
@NonNull Observable<GroupedObservable<K, V>> groupBy(@NonNull Function<? super T, ? extends @NonNull K> keySelector, @NonNull Function<? super T, ? extends @NonNull V> valueSelector, boolean delayError, int bufferSize) Groups the items emitted by the currentObservableaccording to a specified criterion, and emits these grouped items asGroupedObservables.final <@NonNull K, @NonNull V>
@NonNull Observable<GroupedObservable<K, V>> groupBy(@NonNull Function<? super T, ? extends @NonNull K> keySelector, Function<? super T, ? extends @NonNull V> valueSelector) Groups the items emitted by the currentObservableaccording to a specified criterion, and emits these grouped items asGroupedObservables.groupJoin(@NonNull ObservableSource<? extends @NonNull TRight> other, @NonNull Function<? super T, ? extends ObservableSource<@NonNull TLeftEnd>> leftEnd, @NonNull Function<? super @NonNull TRight, ? extends ObservableSource<@NonNull TRightEnd>> rightEnd, @NonNull BiFunction<? super T, ? super Observable<@NonNull TRight>, ? extends @NonNull R> resultSelector) Returns anObservablethat correlates twoObservableSources when they overlap in time and groups the results.final @NonNull Observable<T> hide()Hides the identity of the currentObservableand itsDisposable.final @NonNull CompletableIgnores all items emitted by the currentObservableand only callsonCompleteoronError.static @NonNull Observable<Long> Returns anObservablethat emits a0Lafter theinitialDelayand ever increasing numbers after eachperiodof time thereafter.static @NonNull Observable<Long> Returns anObservablethat emits a0Lafter theinitialDelayand ever increasing numbers after eachperiodof time thereafter, on a specifiedScheduler.static @NonNull Observable<Long> Returns anObservablethat emits a sequential number every specified interval of time.static @NonNull Observable<Long> Returns anObservablethat emits a sequential number every specified interval of time, on a specifiedScheduler.static @NonNull Observable<Long> intervalRange(long start, long count, long initialDelay, long period, @NonNull TimeUnit unit) Signals a range of long values, the first after some initial delay and the rest periodically after.static @NonNull Observable<Long> intervalRange(long start, long count, long initialDelay, long period, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) Signals a range of long values, the first after some initial delay and the rest periodically after.isEmpty()join(@NonNull ObservableSource<? extends @NonNull TRight> other, @NonNull Function<? super T, ? extends ObservableSource<@NonNull TLeftEnd>> leftEnd, @NonNull Function<? super @NonNull TRight, ? extends ObservableSource<@NonNull TRightEnd>> rightEnd, @NonNull BiFunction<? super T, ? super @NonNull TRight, ? extends @NonNull R> resultSelector) Correlates the items emitted by twoObservableSources based on overlapping durations.static <@NonNull T>
@NonNull Observable<T> Returns anObservablethat signals the given (constant reference) item and then completes.static <@NonNull T>
@NonNull Observable<T> Converts two items into anObservablethat emits those items.static <@NonNull T>
@NonNull Observable<T> Converts three items into anObservablethat emits those items.static <@NonNull T>
@NonNull Observable<T> Converts four items into anObservablethat emits those items.static <@NonNull T>
@NonNull Observable<T> Converts five items into anObservablethat emits those items.static <@NonNull T>
@NonNull Observable<T> just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6) Converts six items into anObservablethat emits those items.static <@NonNull T>
@NonNull Observable<T> just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7) Converts seven items into anObservablethat emits those items.static <@NonNull T>
@NonNull Observable<T> just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7, @NonNull T item8) Converts eight items into anObservablethat emits those items.static <@NonNull T>
@NonNull Observable<T> just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7, @NonNull T item8, @NonNull T item9) Converts nine items into anObservablethat emits those items.static <@NonNull T>
@NonNull Observable<T> just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7, @NonNull T item8, @NonNull T item9, @NonNull T item10) Converts ten items into anObservablethat emits those items.Returns aSinglethat emits only the last item emitted by the currentObservable, or a default item if the currentObservablecompletes without emitting any items.Returns aMaybethat emits the last item emitted by the currentObservableor completes if the currentObservableis empty.Returns aSinglethat emits only the last item emitted by the currentObservableor signals aNoSuchElementExceptionif the currentObservableis empty.final @NonNull CompletionStage<T> Signals the last upstream item or aNoSuchElementExceptionif the upstream is empty via aCompletionStage.final @NonNull CompletionStage<T> Signals the last upstream item (or the default item if the upstream is empty) via aCompletionStage.final <@NonNull R>
@NonNull Observable<R> lift(@NonNull ObservableOperator<? extends @NonNull R, ? super T> lifter) This method requires advanced knowledge about building operators, please consider other standard composition methods first; Returns anObservablewhich, when subscribed to, invokes theapply(Observer)method of the providedObservableOperatorfor each individual downstreamObserverand allows the insertion of a custom operator by accessing the downstream'sObserverduring this subscription phase and providing a newObserver, containing the custom operator's intended business logic, that will be used in the subscription process going further upstream.final <@NonNull R>
@NonNull Observable<R> Returns anObservablethat applies a specified function to each item emitted by the currentObservableand emits the results of these function applications.final <@NonNull R>
@NonNull Observable<R> Maps each upstream value into anOptionaland emits the contained item if not empty.final @NonNull Observable<Notification<T>> Returns anObservablethat represents all of the emissions and notifications from the currentObservableinto emissions marked with their original types withinNotificationobjects.static <@NonNull T>
@NonNull Observable<T> merge(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources) Flattens anObservableSourcethat emitsObservableSources into a singleObservablethat emits the items emitted by thoseObservableSources, without any transformation.static <@NonNull T>
@NonNull Observable<T> merge(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources, int maxConcurrency) Flattens anObservableSourcethat emitsObservableSources into a singleObservablethat emits the items emitted by thoseObservableSources, without any transformation, while limiting the maximum number of concurrent subscriptions to theseObservableSources.static <@NonNull T>
@NonNull Observable<T> merge(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2) Flattens twoObservableSources into a singleObservable, without any transformation.static <@NonNull T>
@NonNull Observable<T> merge(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2, @NonNull ObservableSource<? extends @NonNull T> source3) Flattens threeObservableSources into a singleObservable, without any transformation.static <@NonNull T>
@NonNull Observable<T> merge(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2, @NonNull ObservableSource<? extends @NonNull T> source3, @NonNull ObservableSource<? extends @NonNull T> source4) Flattens fourObservableSources into a singleObservable, without any transformation.static <@NonNull T>
@NonNull Observable<T> static <@NonNull T>
@NonNull Observable<T> merge(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, int maxConcurrency) Flattens anIterableofObservableSources into oneObservable, without any transformation, while limiting the number of concurrent subscriptions to theseObservableSources.static <@NonNull T>
@NonNull Observable<T> merge(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, int maxConcurrency, int bufferSize) Flattens anIterableofObservableSources into oneObservable, without any transformation, while limiting the number of concurrent subscriptions to theseObservableSources.static <@NonNull T>
@NonNull Observable<T> mergeArray(int maxConcurrency, int bufferSize, @NonNull ObservableSource<? extends @NonNull T>... sources) Flattens an array ofObservableSources into oneObservable, without any transformation, while limiting the number of concurrent subscriptions to theseObservableSources.static <@NonNull T>
@NonNull Observable<T> mergeArray(@NonNull ObservableSource<? extends @NonNull T>... sources) Flattens an array ofObservableSources into oneObservable, without any transformation.static <@NonNull T>
@NonNull Observable<T> mergeArrayDelayError(int maxConcurrency, int bufferSize, @NonNull ObservableSource<? extends @NonNull T>... sources) Flattens an array ofObservableSources into oneObservable, in a way that allows anObserverto receive all successfully emitted items from each of theObservableSources without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to theseObservableSources.static <@NonNull T>
@NonNull Observable<T> mergeArrayDelayError(@NonNull ObservableSource<? extends @NonNull T>... sources) Flattens an array ofObservableSources into oneObservable, in a way that allows anObserverto receive all successfully emitted items from each of theObservableSources without being interrupted by an error notification from one of them.static <@NonNull T>
@NonNull Observable<T> mergeDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources) Flattens anObservableSourcethat emitsObservableSources into oneObservable, in a way that allows anObserverto receive all successfully emitted items from all of the emittedObservableSources without being interrupted by an error notification from one of them.static <@NonNull T>
@NonNull Observable<T> mergeDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources, int maxConcurrency) Flattens anObservableSourcethat emitsObservableSources into oneObservable, in a way that allows anObserverto receive all successfully emitted items from all of the emittedObservableSources without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to theseObservableSources.static <@NonNull T>
@NonNull Observable<T> mergeDelayError(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2) Flattens twoObservableSources into oneObservable, in a way that allows anObserverto receive all successfully emitted items from each of theObservableSources without being interrupted by an error notification from one of them.static <@NonNull T>
@NonNull Observable<T> mergeDelayError(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2, @NonNull ObservableSource<? extends @NonNull T> source3) Flattens threeObservableSources into oneObservable, in a way that allows anObserverto receive all successfully emitted items from all of theObservableSources without being interrupted by an error notification from one of them.static <@NonNull T>
@NonNull Observable<T> mergeDelayError(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2, @NonNull ObservableSource<? extends @NonNull T> source3, @NonNull ObservableSource<? extends @NonNull T> source4) Flattens fourObservableSources into oneObservable, in a way that allows anObserverto receive all successfully emitted items from all of theObservableSources without being interrupted by an error notification from one of them.static <@NonNull T>
@NonNull Observable<T> mergeDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources) Flattens anIterableofObservableSources into oneObservable, in a way that allows anObserverto receive all successfully emitted items from each of the returnedObservableSources without being interrupted by an error notification from one of them.static <@NonNull T>
@NonNull Observable<T> mergeDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, int maxConcurrency) Flattens anIterableofObservableSources into oneObservable, in a way that allows anObserverto receive all successfully emitted items from each of the returnedObservableSources without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to theseObservableSources.static <@NonNull T>
@NonNull Observable<T> mergeDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, int maxConcurrency, int bufferSize) Flattens anIterableofObservableSources into oneObservable, in a way that allows anObserverto receive all successfully emitted items from each of the returnedObservableSources without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to theseObservableSources.final @NonNull Observable<T> mergeWith(@NonNull CompletableSource other) Relays the items of the currentObservableand completes only when the otherCompletableSourcecompletes as well.final @NonNull Observable<T> mergeWith(@NonNull MaybeSource<? extends T> other) Merges the sequence of items of the currentObservablewith the success value of the otherMaybeSourceor waits both to complete normally if theMaybeSourceis empty.final @NonNull Observable<T> mergeWith(@NonNull ObservableSource<? extends T> other) Flattens the currentObservableand anotherObservableSourceinto a singleObservablesequence, without any transformation.final @NonNull Observable<T> mergeWith(@NonNull SingleSource<? extends T> other) Merges the sequence of items of the currentObservablewith the success value of the otherSingleSource.static <@NonNull T>
@NonNull Observable<T> never()Returns anObservablethat never sends any items or notifications to anObserver.final @NonNull Observable<T> Returns anObservableto perform the currentObservable's emissions and notifications on a specifiedScheduler, asynchronously with an unbounded buffer withFlowable.bufferSize()"island size".final @NonNull Observable<T> Returns anObservableto perform the currentObservable's emissions and notifications on a specifiedScheduler, asynchronously with an unbounded buffer withFlowable.bufferSize()"island size" and optionally delaysonErrornotifications.final @NonNull Observable<T> Returns anObservableto perform the currentObservable's emissions and notifications on a specifiedScheduler, asynchronously with an unbounded buffer of configurable "island size" and optionally delaysonErrornotifications.final <@NonNull U>
@NonNull Observable<U> Filters the items emitted by the currentObservable, only emitting those of the specified type.final @NonNull Observable<T> Returns anObservableinstance that if the currentObservableemits an error, it will emit anonCompleteand swallow the throwable.final @NonNull Observable<T> onErrorComplete(@NonNull Predicate<? super Throwable> predicate) Returns anObservableinstance that if the currentObservableemits an error and the predicate returnstrue, it will emit anonCompleteand swallow the throwable.final @NonNull Observable<T> onErrorResumeNext(@NonNull Function<? super Throwable, ? extends ObservableSource<? extends T>> fallbackSupplier) Resumes the flow with anObservableSourcereturned for the failureThrowableof the currentObservableby a function instead of signaling the error viaonError.final @NonNull Observable<T> onErrorResumeWith(@NonNull ObservableSource<? extends T> fallback) Resumes the flow with the givenObservableSourcewhen the currentObservablefails instead of signaling the error viaonError.final @NonNull Observable<T> onErrorReturn(@NonNull Function<? super Throwable, ? extends T> itemSupplier) Ends the flow with a last item returned by a function for theThrowableerror signaled by the currentObservableinstead of signaling the error viaonError.final @NonNull Observable<T> onErrorReturnItem(T item) Ends the flow with the given last item when the currentObservablefails instead of signaling the error viaonError.final @NonNull Observable<T> Nulls out references to the upstream producer and downstreamObserverif the sequence is terminated or downstream callsdispose().final @NonNull ConnectableObservable<T> publish()Returns aConnectableObservable, which is a variety ofObservableSourcethat waits until itsconnectmethod is called before it begins emitting items to thoseObservers that have subscribed to it.final <@NonNull R>
@NonNull Observable<R> publish(@NonNull Function<? super Observable<T>, ? extends ObservableSource<@NonNull R>> selector) Returns anObservablethat emits the results of invoking a specified selector on items emitted by aConnectableObservablethat shares a single subscription to the currentObservablesequence.static @NonNull Observable<Integer> range(int start, int count) Returns anObservablethat emits a sequence ofIntegers within a specified range.static @NonNull Observable<Long> rangeLong(long start, long count) Returns anObservablethat emits a sequence ofLongs within a specified range.Returns aMaybethat applies a specified accumulator function to the first item emitted by the currentObservable, then feeds the result of that function along with the second item emitted by the currentObservableinto the same function, and so on until all items have been emitted by the current and finiteObservable, and emits the final result from the final call to your function as its sole item.Returns aSinglethat applies a specified accumulator function to the first item emitted by the currentObservableand a specified seed value, then feeds the result of that function along with the second item emitted by the currentObservableinto the same function, and so on until all items have been emitted by the current and finiteObservable, emitting the final result from the final call to your function as its sole item.reduceWith(@NonNull Supplier<@NonNull R> seedSupplier, @NonNull BiFunction<@NonNull R, ? super T, @NonNull R> reducer) Returns aSinglethat applies a specified accumulator function to the first item emitted by the currentObservableand a seed value derived from calling a specifiedseedSupplier, then feeds the result of that function along with the second item emitted by the currentObservableinto the same function, and so on until all items have been emitted by the current and finiteObservable, emitting the final result from the final call to your function as its sole item.final @NonNull Observable<T> repeat()Returns anObservablethat repeats the sequence of items emitted by the currentObservableindefinitely.final @NonNull Observable<T> repeat(long times) Returns anObservablethat repeats the sequence of items emitted by the currentObservableat mostcounttimes.final @NonNull Observable<T> Returns anObservablethat repeats the sequence of items emitted by the currentObservableuntil the provided stop function returnstrue.final @NonNull Observable<T> repeatWhen(@NonNull Function<? super Observable<Object>, ? extends ObservableSource<?>> handler) Returns anObservablethat emits the same values as the currentObservablewith the exception of anonComplete.final @NonNull ConnectableObservable<T> replay()Returns aConnectableObservablethat shares a single subscription to the currentObservablethat will replay all of its items and notifications to any futureObserver.final @NonNull ConnectableObservable<T> replay(int bufferSize) Returns aConnectableObservablethat shares a single subscription to the currentObservablethat replays at mostbufferSizeitems emitted by the currentObservable.final @NonNull ConnectableObservable<T> replay(int bufferSize, boolean eagerTruncate) Returns aConnectableObservablethat shares a single subscription to the currentObservablethat replays at mostbufferSizeitems emitted by the currentObservable.final @NonNull ConnectableObservable<T> Returns aConnectableObservablethat shares a single subscription to the currentObservableand replays at mostbufferSizeitems that were emitted during a specified time window.final @NonNull ConnectableObservable<T> Returns aConnectableObservablethat shares a single subscription to the currentObservableand that replays a maximum ofbufferSizeitems that are emitted within a specified time window.final @NonNull ConnectableObservable<T> replay(int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate) Returns aConnectableObservablethat shares a single subscription to the currentObservableand that replays a maximum ofbufferSizeitems that are emitted within a specified time window.final @NonNull ConnectableObservable<T> Returns aConnectableObservablethat shares a single subscription to the currentObservableand replays all items emitted by the currentObservablewithin a specified time window.final @NonNull ConnectableObservable<T> Returns aConnectableObservablethat shares a single subscription to the currentObservableand replays all items emitted by the currentObservablewithin a specified time window.final @NonNull ConnectableObservable<T> Returns aConnectableObservablethat shares a single subscription to the currentObservableand replays all items emitted by the currentObservablewithin a specified time window.final <@NonNull R>
@NonNull Observable<R> replay(@NonNull Function<? super Observable<T>, ? extends ObservableSource<@NonNull R>> selector) Returns anObservablethat emits items that are the results of invoking a specified selector on the items emitted by aConnectableObservablethat shares a single subscription to the currentObservable.final <@NonNull R>
@NonNull Observable<R> replay(@NonNull Function<? super Observable<T>, ? extends ObservableSource<@NonNull R>> selector, int bufferSize) Returns anObservablethat emits items that are the results of invoking a specified selector on items emitted by aConnectableObservablethat shares a single subscription to the currentObservable, replayingbufferSizenotifications.final <@NonNull R>
@NonNull Observable<R> replay(@NonNull Function<? super Observable<T>, ? extends ObservableSource<@NonNull R>> selector, int bufferSize, boolean eagerTruncate) Returns anObservablethat emits items that are the results of invoking a specified selector on items emitted by aConnectableObservablethat shares a single subscription to the currentObservable, replayingbufferSizenotifications.final <@NonNull R>
@NonNull Observable<R> replay(@NonNull Function<? super Observable<T>, ? extends ObservableSource<@NonNull R>> selector, int bufferSize, long time, @NonNull TimeUnit unit) Returns anObservablethat emits items that are the results of invoking a specified selector on items emitted by aConnectableObservablethat shares a single subscription to the currentObservable, replaying no more thanbufferSizeitems that were emitted within a specified time window.final <@NonNull R>
@NonNull Observable<R> replay(@NonNull Function<? super Observable<T>, ? extends ObservableSource<@NonNull R>> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) Returns anObservablethat emits items that are the results of invoking a specified selector on items emitted by aConnectableObservablethat shares a single subscription to the currentObservable, replaying no more thanbufferSizeitems that were emitted within a specified time window.final <@NonNull R>
@NonNull Observable<R> replay(@NonNull Function<? super Observable<T>, ? extends ObservableSource<@NonNull R>> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate) Returns anObservablethat emits items that are the results of invoking a specified selector on items emitted by aConnectableObservablethat shares a single subscription to the currentObservable, replaying no more thanbufferSizeitems that were emitted within a specified time window.final <@NonNull R>
@NonNull Observable<R> replay(@NonNull Function<? super Observable<T>, ? extends ObservableSource<@NonNull R>> selector, long time, @NonNull TimeUnit unit) Returns anObservablethat emits items that are the results of invoking a specified selector on items emitted by aConnectableObservablethat shares a single subscription to the currentObservable, replaying all items that were emitted within a specified time window.final <@NonNull R>
@NonNull Observable<R> replay(@NonNull Function<? super Observable<T>, ? extends ObservableSource<@NonNull R>> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) Returns anObservablethat emits items that are the results of invoking a specified selector on items emitted by aConnectableObservablethat shares a single subscription to the currentObservable, replaying all items that were emitted within a specified time window.final <@NonNull R>
@NonNull Observable<R> replay(@NonNull Function<? super Observable<T>, ? extends ObservableSource<@NonNull R>> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate) Returns anObservablethat emits items that are the results of invoking a specified selector on items emitted by aConnectableObservablethat shares a single subscription to the currentObservable, replaying all items that were emitted within a specified time window.final @NonNull Observable<T> retry()Returns anObservablethat mirrors the currentObservable, resubscribing to it if it callsonError(infinite retry count).final @NonNull Observable<T> retry(long times) Returns anObservablethat mirrors the currentObservable, resubscribing to it if it callsonErrorup to a specified number of retries.final @NonNull Observable<T> Retries at most times or until the predicate returnsfalse, whichever happens first.final @NonNull Observable<T> retry(@NonNull BiPredicate<? super Integer, ? super Throwable> predicate) Returns anObservablethat mirrors the currentObservable, resubscribing to it if it callsonErrorand the predicate returnstruefor that specific exception and retry count.final @NonNull Observable<T> Retries the currentObservableif the predicate returnstrue.final @NonNull Observable<T> Retries until the given stop function returnstrue.final @NonNull Observable<T> retryWhen(@NonNull Function<? super Observable<Throwable>, ? extends ObservableSource<?>> handler) Returns anObservablethat emits the same values as the currentObservablewith the exception of anonError.final voidsafeSubscribe(@NonNull Observer<? super T> observer) Subscribes to the currentObservableand wraps the givenObserverinto aSafeObserver(if not already aSafeObserver) that deals with exceptions thrown by a misbehavingObserver(that doesn't follow the Reactive Streams specification).final @NonNull Observable<T> Returns anObservablethat emits the most recently emitted item (if any) emitted by the currentObservablewithin periodic time intervals.final @NonNull Observable<T> Returns anObservablethat emits the most recently emitted item (if any) emitted by the currentObservablewithin periodic time intervals and optionally emit the very last upstream item when the upstream completes.final @NonNull Observable<T> Returns anObservablethat emits the most recently emitted item (if any) emitted by the currentObservablewithin periodic time intervals, where the intervals are defined on a particularScheduler.final @NonNull Observable<T> Returns anObservablethat emits the most recently emitted item (if any) emitted by the currentObservablewithin periodic time intervals, where the intervals are defined on a particularSchedulerand optionally emit the very last upstream item when the upstream completes.final @NonNull Observable<T> sample(long period, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean emitLast, @NonNull Consumer<? super T> onDropped) Returns anObservablethat emits the most recently emitted item (if any) emitted by the currentObservablewithin periodic time intervals, where the intervals are defined on a particularScheduler.final <@NonNull U>
@NonNull Observable<T> sample(@NonNull ObservableSource<@NonNull U> sampler) Returns anObservablethat, when the specifiedsamplerObservableSourceemits an item or completes, emits the most recently emitted item (if any) emitted by the currentObservablesince the previous emission from thesamplerObservableSource.final <@NonNull U>
@NonNull Observable<T> sample(@NonNull ObservableSource<@NonNull U> sampler, boolean emitLast) Returns anObservablethat, when the specifiedsamplerObservableSourceemits an item or completes, emits the most recently emitted item (if any) emitted by the currentObservablesince the previous emission from thesamplerObservableSourceand optionally emit the very last upstream item when the upstream or otherObservableSourcecomplete.final @NonNull Observable<T> Returns anObservablethat emits the first value emitted by the currentObservable, then emits one value for each subsequent value emitted by the currentObservable.final <@NonNull R>
@NonNull Observable<R> Returns anObservablethat emits the provided initial (seed) value, then emits one value for each value emitted by the currentObservable.final <@NonNull R>
@NonNull Observable<R> scanWith(@NonNull Supplier<@NonNull R> seedSupplier, @NonNull BiFunction<@NonNull R, ? super T, @NonNull R> accumulator) Returns anObservablethat emits the provided initial (seed) value, then emits one value for each value emitted by the currentObservable.sequenceEqual(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2) Returns aSinglethat emits aBooleanvalue that indicates whether twoObservableSourcesequences are the same by comparing the items emitted by eachObservableSourcepairwise.sequenceEqual(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2, int bufferSize) Returns aSinglethat emits aBooleanvalue that indicates whether twoObservableSourcesequences are the same by comparing the items emitted by eachObservableSourcepairwise.sequenceEqual(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2, @NonNull BiPredicate<? super @NonNull T, ? super @NonNull T> isEqual) Returns aSinglethat emits aBooleanvalue that indicates whether twoObservableSourcesequences are the same by comparing the items emitted by eachObservableSourcepairwise based on the results of a specified equality function.sequenceEqual(@NonNull ObservableSource<? extends @NonNull T> source1, @NonNull ObservableSource<? extends @NonNull T> source2, @NonNull BiPredicate<? super @NonNull T, ? super @NonNull T> isEqual, int bufferSize) Returns aSinglethat emits aBooleanvalue that indicates whether twoObservableSourcesequences are the same by comparing the items emitted by eachObservableSourcepairwise based on the results of a specified equality function.final @NonNull Observable<T> Forces the currentObservable's emissions and notifications to be serialized and for it to obey theObservableSourcecontract in other ways.final @NonNull Observable<T> share()Returns a newObservablethat multicasts (and shares a single subscription to) the currentObservable.Returns aSinglethat emits the single item emitted by the currentObservable, if the currentObservableemits only a single item, or a default item if the currentObservableemits no items.Returns aMaybethat completes if the currentObservableis empty or emits the single item emitted by the currentObservable, or signals anIllegalArgumentExceptionif the currentObservableemits more than one item.Returns aSinglethat emits the single item emitted by the currentObservableif it emits only a single item, otherwise if the currentObservablecompletes without emitting any items or emits more than one item aNoSuchElementExceptionorIllegalArgumentExceptionwill be signaled respectively.final @NonNull CompletionStage<T> Signals the only expected upstream item, aNoSuchElementExceptionif the upstream is empty or signalsIllegalArgumentExceptionif the upstream has more than one item via aCompletionStage.final @NonNull CompletionStage<T> singleStage(T defaultItem) Signals the only expected upstream item (or the default item if the upstream is empty) or signalsIllegalArgumentExceptionif the upstream has more than one item via aCompletionStage.final @NonNull Observable<T> skip(long count) Returns anObservablethat skips the firstcountitems emitted by the currentObservableand emits the remainder.final @NonNull Observable<T> Returns anObservablethat skips values emitted by the currentObservablebefore a specified time window elapses.final @NonNull Observable<T> Returns anObservablethat skips values emitted by the currentObservablebefore a specified time window on a specifiedSchedulerelapses.final @NonNull Observable<T> skipLast(int count) Returns anObservablethat drops a specified number of items from the end of the sequence emitted by the currentObservable.final @NonNull Observable<T> Returns anObservablethat drops items emitted by the currentObservableduring a specified time window before the source completes.final @NonNull Observable<T> Returns anObservablethat drops items emitted by the currentObservableduring a specified time window before the source completes.final @NonNull Observable<T> Returns anObservablethat drops items emitted by the currentObservableduring a specified time window (defined on a specified scheduler) before the source completes.final @NonNull Observable<T> Returns anObservablethat drops items emitted by the currentObservableduring a specified time window (defined on a specified scheduler) before the source completes.final @NonNull Observable<T> skipLast(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError, int bufferSize) Returns anObservablethat drops items emitted by the currentObservableduring a specified time window (defined on a specified scheduler) before the source completes.final <@NonNull U>
@NonNull Observable<T> skipUntil(@NonNull ObservableSource<@NonNull U> other) Returns anObservablethat skips items emitted by the currentObservableuntil a secondObservableSourceemits an item.final @NonNull Observable<T> Returns anObservablethat skips all items emitted by the currentObservableas long as a specified condition holdstrue, but emits all further source items as soon as the condition becomesfalse.final @NonNull Observable<T> sorted()Returns anObservablethat emits the events emitted by the currentObservable, in a sorted order.final @NonNull Observable<T> sorted(@NonNull Comparator<? super T> comparator) Returns anObservablethat emits the events emitted by the currentObservable, in a sorted order based on a specified comparison function.final @NonNull Observable<T> startWith(@NonNull CompletableSource other) Returns anObservablewhich first runs the otherCompletableSourcethen the currentObservableif the other completed normally.final @NonNull Observable<T> startWith(@NonNull MaybeSource<T> other) Returns anObservablewhich first runs the otherMaybeSourcethen the currentObservableif the other succeeded or completed normally.final @NonNull Observable<T> startWith(@NonNull ObservableSource<? extends T> other) Returns anObservablethat emits the items in a specifiedObservableSourcebefore it begins to emit items emitted by the currentObservable.final @NonNull Observable<T> startWith(@NonNull SingleSource<T> other) Returns anObservablewhich first runs the otherSingleSourcethen the currentObservableif the other succeeded normally.final @NonNull Observable<T> startWithArray(T... items) Returns anObservablethat emits the specified items before it begins to emit items emitted by the currentObservable.final @NonNull Observable<T> startWithItem(T item) Returns anObservablethat emits a specified item before it begins to emit items emitted by the currentObservable.final @NonNull Observable<T> startWithIterable(@NonNull Iterable<? extends T> items) Returns anObservablethat emits the items in a specifiedIterablebefore it begins to emit items emitted by the currentObservable.final @NonNull DisposableSubscribes to the currentObservableand ignoresonNextandonCompleteemissions.final voidSubscribes the givenObserverto thisObservableSourceinstance.final @NonNull DisposableSubscribes to the currentObservableand provides a callback to handle the items it emits.final @NonNull DisposableSubscribes to the currentObservableand provides callbacks to handle the items it emits and any error notification it signals.final @NonNull Disposablesubscribe(@NonNull Consumer<? super T> onNext, @NonNull Consumer<? super Throwable> onError, @NonNull Action onComplete) Subscribes to the currentObservableand provides callbacks to handle the items it emits and any error or completion notification it signals.final @NonNull Disposablesubscribe(@NonNull Consumer<? super T> onNext, @NonNull Consumer<? super Throwable> onError, @NonNull Action onComplete, @NonNull DisposableContainer container) Wraps the given onXXX callbacks into aDisposableObserver, adds it to the givenDisposableContainerand ensures, that if the upstream terminates or this particularDisposableis disposed, theObserveris removed from the given container.final @NonNull Observable<T> subscribeOn(@NonNull Scheduler scheduler) subscribeWith(@NonNull E observer) Subscribes a givenObserver(subclass) to the currentObservableand returns the givenObserverinstance as is.final @NonNull Observable<T> switchIfEmpty(@NonNull ObservableSource<? extends T> other) Returns anObservablethat emits the items emitted by the currentObservableor the items of an alternateObservableSourceif the currentObservableis empty.final <@NonNull R>
@NonNull Observable<R> Returns a newObservableby applying a function that you supply to each item emitted by the currentObservablethat returns anObservableSource, and then emitting the items emitted by the most recently emitted of theseObservableSources.final <@NonNull R>
@NonNull Observable<R> switchMap(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, int bufferSize) Returns a newObservableby applying a function that you supply to each item emitted by the currentObservablethat returns anObservableSource, and then emitting the items emitted by the most recently emitted of theseObservableSources.final @NonNull CompletableswitchMapCompletable(@NonNull Function<? super T, ? extends CompletableSource> mapper) Maps the items of the currentObservableintoCompletableSources, subscribes to the newer one while disposing the subscription to the previousCompletableSource, thus keeping at most one activeCompletableSourcerunning.final @NonNull CompletableswitchMapCompletableDelayError(@NonNull Function<? super T, ? extends CompletableSource> mapper) Maps the upstream values intoCompletableSources, subscribes to the newer one while disposing the subscription to the previousCompletableSource, thus keeping at most one activeCompletableSourcerunning and delaying any main or inner errors until all of them terminate.final <@NonNull R>
@NonNull Observable<R> switchMapDelayError(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper) Returns a newObservableby applying a function that you supply to each item emitted by the currentObservablethat returns anObservableSource, and then emitting the items emitted by the most recently emitted of theseObservableSources and delays any error until allObservableSources terminate.final <@NonNull R>
@NonNull Observable<R> switchMapDelayError(@NonNull Function<? super T, ? extends ObservableSource<? extends @NonNull R>> mapper, int bufferSize) Returns a newObservableby applying a function that you supply to each item emitted by the currentObservablethat returns anObservableSource, and then emitting the items emitted by the most recently emitted of theseObservableSources and delays any error until allObservableSources terminate.final <@NonNull R>
@NonNull Observable<R> switchMapMaybe(@NonNull Function<? super T, ? extends MaybeSource<? extends @NonNull R>> mapper) Maps the items of the currentObservableintoMaybeSources 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 currentObservableor any of the active innerMaybeSources fail.final <@NonNull R>
@NonNull Observable<R> switchMapMaybeDelayError(@NonNull Function<? super T, ? extends MaybeSource<? extends @NonNull R>> mapper) Maps the upstream items intoMaybeSources 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 currentObservableor the innerMaybeSources until all terminate.final <@NonNull R>
@NonNull Observable<R> switchMapSingle(@NonNull Function<? super T, ? extends SingleSource<? extends @NonNull R>> mapper) Returns a newObservableby applying a function that you supply to each item emitted by the currentObservablethat returns aSingleSource, and then emitting the item emitted by the most recently emitted of theseSingleSources.final <@NonNull R>
@NonNull Observable<R> switchMapSingleDelayError(@NonNull Function<? super T, ? extends SingleSource<? extends @NonNull R>> mapper) Returns a newObservableby applying a function that you supply to each item emitted by the currentObservablethat returns aSingleSource, and then emitting the item emitted by the most recently emitted of theseSingleSources and delays any error until allSingleSources terminate.static <@NonNull T>
@NonNull Observable<T> switchOnNext(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources) Converts anObservableSourcethat emitsObservableSources into anObservablethat emits the items emitted by the most recently emitted of thoseObservableSources.static <@NonNull T>
@NonNull Observable<T> switchOnNext(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources, int bufferSize) Converts anObservableSourcethat emitsObservableSources into anObservablethat emits the items emitted by the most recently emitted of thoseObservableSources.static <@NonNull T>
@NonNull Observable<T> switchOnNextDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources) Converts anObservableSourcethat emitsObservableSources into anObservablethat emits the items emitted by the most recently emitted of thoseObservableSources and delays any exception until allObservableSources terminate.static <@NonNull T>
@NonNull Observable<T> switchOnNextDelayError(@NonNull ObservableSource<? extends ObservableSource<? extends @NonNull T>> sources, int bufferSize) Converts anObservableSourcethat emitsObservableSources into anObservablethat emits the items emitted by the most recently emitted of thoseObservableSources and delays any exception until allObservableSources terminate.final @NonNull Observable<T> take(long count) Returns anObservablethat emits only the firstcountitems emitted by the currentObservable.final @NonNull Observable<T> Returns anObservablethat emits those items emitted by the currentObservablebefore a specified time runs out.final @NonNull Observable<T> Returns anObservablethat emits those items emitted by the currentObservablebefore a specified time (on a specifiedScheduler) runs out.final @NonNull Observable<T> takeLast(int count) Returns anObservablethat emits at most the lastcountitems emitted by the currentObservable.final @NonNull Observable<T> Returns anObservablethat emits at most a specified number of items from the currentObservablethat were emitted in a specified window of time before the currentObservablecompleted.final @NonNull Observable<T> Returns anObservablethat emits at most a specified number of items from the currentObservablethat were emitted in a specified window of time before the currentObservablecompleted, where the timing information is provided by a givenScheduler.final @NonNull Observable<T> takeLast(long count, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError, int bufferSize) Returns anObservablethat emits at most a specified number of items from the currentObservablethat were emitted in a specified window of time before the currentObservablecompleted, where the timing information is provided by a givenScheduler.final @NonNull Observable<T> Returns anObservablethat emits the items from the currentObservablethat were emitted in a specified window of time before the currentObservablecompleted.final @NonNull Observable<T> Returns anObservablethat emits the items from the currentObservablethat were emitted in a specified window of time before the currentObservablecompleted.final @NonNull Observable<T> Returns anObservablethat emits the items from the currentObservablethat were emitted in a specified window of time before the currentObservablecompleted, where the timing information is provided by a specifiedScheduler.final @NonNull Observable<T> Returns anObservablethat emits the items from the currentObservablethat were emitted in a specified window of time before the currentObservablecompleted, where the timing information is provided by a specifiedScheduler.final @NonNull Observable<T> takeLast(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError, int bufferSize) Returns anObservablethat emits the items from the currentObservablethat were emitted in a specified window of time before the currentObservablecompleted, where the timing information is provided by a specifiedScheduler.final <@NonNull U>
@NonNull Observable<T> takeUntil(@NonNull ObservableSource<@NonNull U> other) Returns anObservablethat emits the items emitted by the currentObservableuntil a secondObservableSourceemits an item or completes.final @NonNull Observable<T> Returns anObservablethat emits items emitted by the currentObservable, checks the specified predicate for each item, and then completes when the condition is satisfied.final @NonNull Observable<T> Returns anObservablethat emits items emitted by the currentObservableso long as each item satisfied a specified condition, and then completes as soon as this condition is not satisfied.final @NonNull TestObserver<T> test()Creates aTestObserverand subscribes it to the currentObservable.final @NonNull TestObserver<T> test(boolean dispose) Creates aTestObserver, optionally disposes it and then subscribes it to the currentObservable.final @NonNull Observable<T> throttleFirst(long windowDuration, @NonNull TimeUnit unit) Returns anObservablethat emits only the first item emitted by the currentObservableduring sequential time windows of a specified duration.final @NonNull Observable<T> throttleFirst(long skipDuration, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) Returns anObservablethat emits only the first item emitted by the currentObservableduring sequential time windows of a specified duration, where the windows are managed by a specifiedScheduler.final @NonNull Observable<T> throttleFirst(long skipDuration, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Consumer<? super T> onDropped) Returns anObservablethat emits only the first item emitted by the currentObservableduring sequential time windows of a specified duration, where the windows are managed by a specifiedScheduler.final @NonNull Observable<T> throttleLast(long intervalDuration, @NonNull TimeUnit unit) Returns anObservablethat emits only the last item emitted by the currentObservableduring sequential time windows of a specified duration.final @NonNull Observable<T> throttleLast(long intervalDuration, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) Returns anObservablethat emits only the last item emitted by the currentObservableduring sequential time windows of a specified duration, where the duration is governed by a specifiedScheduler.final @NonNull Observable<T> throttleLast(long intervalDuration, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Consumer<? super T> onDropped) Returns anObservablethat emits only the last item emitted by the currentObservableduring sequential time windows of a specified duration, where the duration is governed by a specifiedScheduler.final @NonNull Observable<T> throttleLatest(long timeout, @NonNull TimeUnit unit) Throttles items from the currentObservableby first emitting the next item from upstream, then periodically emitting the latest item (if any) when the specified timeout elapses between them.final @NonNull Observable<T> throttleLatest(long timeout, @NonNull TimeUnit unit, boolean emitLast) Throttles items from the currentObservableby first emitting the next item from upstream, then periodically emitting the latest item (if any) when the specified timeout elapses between them.final @NonNull Observable<T> throttleLatest(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) Throttles items from the currentObservableby first emitting the next item from upstream, then periodically emitting the latest item (if any) when the specified timeout elapses between them.final @NonNull Observable<T> throttleLatest(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean emitLast) Throttles items from the currentObservableby first emitting the next item from upstream, then periodically emitting the latest item (if any) when the specified timeout elapses between them.final @NonNull Observable<T> throttleLatest(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean emitLast, @NonNull Consumer<? super T> onDropped) Throttles items from the currentObservableby 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.final @NonNull Observable<T> throttleWithTimeout(long timeout, @NonNull TimeUnit unit) Returns anObservablethat mirrors the currentObservable, except that it drops items emitted by the currentObservablethat are followed by newer items before a timeout value expires.final @NonNull Observable<T> throttleWithTimeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) Returns anObservablethat mirrors the currentObservable, except that it drops items emitted by the currentObservablethat are followed by newer items before a timeout value expires on a specifiedScheduler.final @NonNull Observable<T> throttleWithTimeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Consumer<? super T> onDropped) Returns anObservablethat mirrors the currentObservable, except that it drops items emitted by the currentObservablethat are followed by newer items before a timeout value expires on a specifiedScheduler.final @NonNull Observable<Timed<T>> Returns anObservablethat emits records of the time interval between consecutive items emitted by the currentObservable.final @NonNull Observable<Timed<T>> timeInterval(@NonNull Scheduler scheduler) Returns anObservablethat emits records of the time interval between consecutive items emitted by the currentObservable, where this interval is computed on a specifiedScheduler.final @NonNull Observable<Timed<T>> timeInterval(@NonNull TimeUnit unit) Returns anObservablethat emits records of the time interval between consecutive items emitted by the currentObservable.final @NonNull Observable<Timed<T>> timeInterval(@NonNull TimeUnit unit, @NonNull Scheduler scheduler) Returns anObservablethat emits records of the time interval between consecutive items emitted by the currentObservable, where this interval is computed on a specifiedScheduler.final @NonNull Observable<T> Returns anObservablethat mirrors the currentObservablebut applies a timeout policy for each emitted item.final @NonNull Observable<T> Returns anObservablethat mirrors the currentObservablebut applies a timeout policy for each emitted item.final @NonNull Observable<T> Returns anObservablethat mirrors the currentObservablebut applies a timeout policy for each emitted item, where this policy is governed on a specifiedScheduler.final @NonNull Observable<T> timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull ObservableSource<? extends T> fallback) Returns anObservablethat mirrors the currentObservablebut applies a timeout policy for each emitted item using a specifiedScheduler.final <@NonNull U, @NonNull V>
@NonNull Observable<T> timeout(@NonNull ObservableSource<@NonNull U> firstTimeoutIndicator, @NonNull Function<? super T, ? extends ObservableSource<@NonNull V>> itemTimeoutIndicator) Returns anObservablethat mirrors the currentObservable, but notifies observers of aTimeoutExceptionif either the first item emitted by the currentObservableor any subsequent item doesn't arrive within time windows defined by indicatorObservableSources.final <@NonNull U, @NonNull V>
@NonNull Observable<T> timeout(@NonNull ObservableSource<@NonNull U> firstTimeoutIndicator, @NonNull Function<? super T, ? extends ObservableSource<@NonNull V>> itemTimeoutIndicator, @NonNull ObservableSource<? extends T> fallback) Returns anObservablethat mirrors the currentObservable, but switches to a fallbackObservableSourceif either the first item emitted by the currentObservableor any subsequent item doesn't arrive within time windows defined by indicatorObservableSources.final <@NonNull V>
@NonNull Observable<T> Returns anObservablethat mirrors the currentObservable, but notifies observers of aTimeoutExceptionif an item emitted by the currentObservabledoesn't arrive within a window of time after the emission of the previous item, where that period of time is measured by anObservableSourcethat is a function of the previous item.final <@NonNull V>
@NonNull Observable<T> timeout(@NonNull Function<? super T, ? extends ObservableSource<@NonNull V>> itemTimeoutIndicator, @NonNull ObservableSource<? extends T> fallback) Returns anObservablethat mirrors the currentObservable, but that switches to a fallbackObservableSourceif an item emitted by the currentObservabledoesn't arrive within a window of time after the emission of the previous item, where that period of time is measured by anObservableSourcethat is a function of the previous item.static @NonNull Observable<Long> Returns anObservablethat emits0Lafter a specified delay, and then completes.static @NonNull Observable<Long> Returns anObservablethat emits0Lafter a specified delay, on a specifiedScheduler, and then completes.final @NonNull Observable<Timed<T>> Returns anObservablethat emits each item emitted by the currentObservable, wrapped in aTimedobject.final @NonNull Observable<Timed<T>> final @NonNull Observable<Timed<T>> Returns anObservablethat emits each item emitted by the currentObservable, wrapped in aTimedobject.final @NonNull Observable<Timed<T>> final <@NonNull R>
Rto(@NonNull ObservableConverter<T, ? extends @NonNull R> converter) Calls the specified converter function during assembly time and returns its resulting value.toFlowable(@NonNull BackpressureStrategy strategy) Converts the currentObservableinto aFlowableby applying the specified backpressure strategy.toFuture()Returns aFuturerepresenting the only value emitted by the currentObservable.toList()toList(int capacityHint) Returns aSinglethat emits a single item, aCollection(subclass) composed of all the items emitted by the finite upstreamObservable.toMap(@NonNull Function<? super T, ? extends @NonNull K> keySelector, @NonNull Function<? super T, ? extends @NonNull V> valueSelector) toMap(@NonNull Function<? super T, ? extends @NonNull K> keySelector, @NonNull Function<? super T, ? extends @NonNull V> valueSelector, @NonNull Supplier<? extends Map<@NonNull K, @NonNull V>> mapSupplier) toMultimap(@NonNull Function<? super T, ? extends @NonNull K> keySelector) toMultimap(@NonNull Function<? super T, ? extends @NonNull K> keySelector, @NonNull Function<? super T, ? extends @NonNull V> valueSelector) toMultimap(@NonNull Function<? super T, ? extends @NonNull K> keySelector, @NonNull Function<? super T, ? extends @NonNull V> valueSelector, @NonNull Supplier<? extends Map<@NonNull K, Collection<@NonNull V>>> mapSupplier, @NonNull Function<? super @NonNull K, ? extends Collection<? super @NonNull V>> collectionFactory) Returns aSinglethat emits a singleMap(subclass), returned by a specifiedmapFactoryfunction, that contains a customCollectionof values, extracted by a specifiedvalueSelectorfunction from items emitted by the current and finiteObservable, and keyed by thekeySelectorfunction.toMultimap(@NonNull Function<? super T, ? extends @NonNull K> keySelector, @NonNull Function<? super T, ? extends @NonNull V> valueSelector, @NonNull Supplier<Map<@NonNull K, Collection<@NonNull V>>> mapSupplier) toSortedList(int capacityHint) toSortedList(@NonNull Comparator<? super T> comparator) toSortedList(@NonNull Comparator<? super T> comparator, int capacityHint) static <@NonNull T>
@NonNull Observable<T> unsafeCreate(@NonNull ObservableSource<@NonNull T> onSubscribe) Create anObservableby wrapping anObservableSourcewhich has to be implemented according to theObservablespecification derived from the Reactive Streams specification by handling disposal correctly; no safeguards are provided by theObservableitself.final @NonNull Observable<T> unsubscribeOn(@NonNull Scheduler scheduler) static <@NonNull T, @NonNull D>
@NonNull Observable<T> using(@NonNull Supplier<? extends @NonNull D> resourceSupplier, @NonNull Function<? super @NonNull D, ? extends ObservableSource<? extends @NonNull T>> sourceSupplier, @NonNull Consumer<? super @NonNull D> resourceCleanup) Constructs anObservablethat creates a dependent resource object, anObservableSourcewith that resource and calls the providedresourceDisposerfunction if this inner source terminates or the downstream disposes the flow.static <@NonNull T, @NonNull D>
@NonNull Observable<T> using(@NonNull Supplier<? extends @NonNull D> resourceSupplier, @NonNull Function<? super @NonNull D, ? extends ObservableSource<? extends @NonNull T>> sourceSupplier, @NonNull Consumer<? super @NonNull D> resourceCleanup, boolean eager) Constructs anObservablethat creates a dependent resource object, anObservableSourcewith that resource and calls the provideddisposerfunction if this inner source terminates or the downstream disposes the flow; doing it before these end-states have been reached ifeager == true, after otherwise.final @NonNull Observable<Observable<T>> window(long count) Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> window(long count, long skip) Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> window(long count, long skip, int bufferSize) Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> window(long timespan, long timeskip, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, int bufferSize) Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> window(long timespan, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, long count, boolean restart) Returns anObservablethat emits windows of items it collects from the currentObservable.final @NonNull Observable<Observable<T>> window(long timespan, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, long count, boolean restart, int bufferSize) Returns anObservablethat emits windows of items it collects from the currentObservable.final <@NonNull B>
@NonNull Observable<Observable<T>> window(@NonNull ObservableSource<@NonNull B> boundaryIndicator) Returns anObservablethat emits non-overlapping windows of items it collects from the currentObservablewhere the boundary of each window is determined by the items emitted from a specified boundary-governingObservableSource.final <@NonNull B>
@NonNull Observable<Observable<T>> window(@NonNull ObservableSource<@NonNull B> boundaryIndicator, int bufferSize) Returns anObservablethat emits non-overlapping windows of items it collects from the currentObservablewhere the boundary of each window is determined by the items emitted from a specified boundary-governingObservableSource.final <@NonNull U, @NonNull V>
@NonNull Observable<Observable<T>> window(@NonNull ObservableSource<@NonNull U> openingIndicator, @NonNull Function<? super @NonNull U, ? extends ObservableSource<@NonNull V>> closingIndicator) Returns anObservablethat emits windows of items it collects from the currentObservable.final <@NonNull U, @NonNull V>
@NonNull Observable<Observable<T>> window(@NonNull ObservableSource<@NonNull U> openingIndicator, @NonNull Function<? super @NonNull U, ? extends ObservableSource<@NonNull V>> closingIndicator, int bufferSize) Returns anObservablethat emits windows of items it collects from the currentObservable.final <@NonNull R>
@NonNull Observable<R> withLatestFrom(@NonNull ObservableSource<?>[] others, @NonNull Function<? super Object[], @NonNull R> combiner) Combines the value emission from the currentObservablewith the latest emissions from the otherObservableSources via a function to produce the output item.final <@NonNull U, @NonNull R>
@NonNull Observable<R> withLatestFrom(@NonNull ObservableSource<? extends @NonNull U> other, @NonNull BiFunction<? super T, ? super @NonNull U, ? extends @NonNull R> combiner) Merges the specifiedObservableSourceinto the currentObservablesequence by using theresultSelectorfunction only when the currentObservableemits an item.withLatestFrom(@NonNull ObservableSource<@NonNull T1> source1, @NonNull ObservableSource<@NonNull T2> source2, @NonNull ObservableSource<@NonNull T3> source3, @NonNull ObservableSource<@NonNull T4> source4, @NonNull Function5<? super T, ? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, @NonNull R> combiner) Combines the value emission from the currentObservablewith the latest emissions from the otherObservableSources via a function to produce the output item.withLatestFrom(@NonNull ObservableSource<@NonNull T1> source1, @NonNull ObservableSource<@NonNull T2> source2, @NonNull ObservableSource<@NonNull T3> source3, @NonNull Function4<? super T, ? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, @NonNull R> combiner) Combines the value emission from the currentObservablewith the latest emissions from the otherObservableSources via a function to produce the output item.final <@NonNull T1, @NonNull T2, @NonNull R>
@NonNull Observable<R> withLatestFrom(@NonNull ObservableSource<@NonNull T1> source1, @NonNull ObservableSource<@NonNull T2> source2, @NonNull Function3<? super T, ? super @NonNull T1, ? super @NonNull T2, @NonNull R> combiner) Combines the value emission from the currentObservablewith the latest emissions from the otherObservableSources via a function to produce the output item.final <@NonNull R>
@NonNull Observable<R> withLatestFrom(@NonNull Iterable<@NonNull ? extends ObservableSource<?>> others, @NonNull Function<? super Object[], @NonNull R> combiner) Combines the value emission from the currentObservablewith the latest emissions from the otherObservableSources via a function to produce the output item.static <@NonNull T>
@NonNull Observable<T> wrap(@NonNull ObservableSource<@NonNull T> source) static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull T9, @NonNull R>
@NonNull Observable<R> zip(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull ObservableSource<? extends @NonNull T5> source5, @NonNull ObservableSource<? extends @NonNull T6> source6, @NonNull ObservableSource<? extends @NonNull T7> source7, @NonNull ObservableSource<? extends @NonNull T8> source8, @NonNull ObservableSource<? extends @NonNull T9> source9, @NonNull Function9<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? super @NonNull T5, ? super @NonNull T6, ? super @NonNull T7, ? super @NonNull T8, ? super @NonNull T9, ? extends @NonNull R> zipper) Returns anObservablethat emits the results of a specified combiner function applied to combinations of nine items emitted, in sequence, by nine otherObservableSources.static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull R>
@NonNull Observable<R> zip(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull ObservableSource<? extends @NonNull T5> source5, @NonNull ObservableSource<? extends @NonNull T6> source6, @NonNull ObservableSource<? extends @NonNull T7> source7, @NonNull ObservableSource<? extends @NonNull T8> source8, @NonNull Function8<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? super @NonNull T5, ? super @NonNull T6, ? super @NonNull T7, ? super @NonNull T8, ? extends @NonNull R> zipper) Returns anObservablethat emits the results of a specified combiner function applied to combinations of eight items emitted, in sequence, by eight otherObservableSources.static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull R>
@NonNull Observable<R> zip(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull ObservableSource<? extends @NonNull T5> source5, @NonNull ObservableSource<? extends @NonNull T6> source6, @NonNull ObservableSource<? extends @NonNull T7> source7, @NonNull Function7<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? super @NonNull T5, ? super @NonNull T6, ? super @NonNull T7, ? extends @NonNull R> zipper) Returns anObservablethat emits the results of a specified combiner function applied to combinations of seven items emitted, in sequence, by seven otherObservableSources.static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull R>
@NonNull Observable<R> zip(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull ObservableSource<? extends @NonNull T5> source5, @NonNull ObservableSource<? extends @NonNull T6> source6, @NonNull Function6<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? super @NonNull T5, ? super @NonNull T6, ? extends @NonNull R> zipper) Returns anObservablethat emits the results of a specified combiner function applied to combinations of six items emitted, in sequence, by six otherObservableSources.static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull R>
@NonNull Observable<R> zip(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull ObservableSource<? extends @NonNull T5> source5, @NonNull Function5<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? super @NonNull T5, ? extends @NonNull R> zipper) Returns anObservablethat emits the results of a specified combiner function applied to combinations of five items emitted, in sequence, by five otherObservableSources.zip(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull ObservableSource<? extends @NonNull T4> source4, @NonNull Function4<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? super @NonNull T4, ? extends @NonNull R> zipper) Returns anObservablethat emits the results of a specified combiner function applied to combinations of four items emitted, in sequence, by four otherObservableSources.zip(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull ObservableSource<? extends @NonNull T3> source3, @NonNull Function3<? super @NonNull T1, ? super @NonNull T2, ? super @NonNull T3, ? extends @NonNull R> zipper) Returns anObservablethat emits the results of a specified combiner function applied to combinations of three items emitted, in sequence, by three otherObservableSources.static <@NonNull T1, @NonNull T2, @NonNull R>
@NonNull Observable<R> zip(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull BiFunction<? super @NonNull T1, ? super @NonNull T2, ? extends @NonNull R> zipper) Returns anObservablethat emits the results of a specified combiner function applied to combinations of two items emitted, in sequence, by two otherObservableSources.static <@NonNull T1, @NonNull T2, @NonNull R>
@NonNull Observable<R> zip(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull BiFunction<? super @NonNull T1, ? super @NonNull T2, ? extends @NonNull R> zipper, boolean delayError) Returns anObservablethat emits the results of a specified combiner function applied to combinations of two items emitted, in sequence, by two otherObservableSources.static <@NonNull T1, @NonNull T2, @NonNull R>
@NonNull Observable<R> zip(@NonNull ObservableSource<? extends @NonNull T1> source1, @NonNull ObservableSource<? extends @NonNull T2> source2, @NonNull BiFunction<? super @NonNull T1, ? super @NonNull T2, ? extends @NonNull R> zipper, boolean delayError, int bufferSize) Returns anObservablethat emits the results of a specified combiner function applied to combinations of two items emitted, in sequence, by two otherObservableSources.static <@NonNull T, @NonNull R>
@NonNull Observable<R> zip(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, @NonNull Function<? super Object[], ? extends @NonNull R> zipper) Returns anObservablethat emits the results of a specified combiner function applied to combinations of items emitted, in sequence, by anIterableof otherObservableSources.static <@NonNull T, @NonNull R>
@NonNull Observable<R> zip(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends @NonNull T>> sources, @NonNull Function<? super Object[], ? extends @NonNull R> zipper, boolean delayError, int bufferSize) Returns anObservablethat emits the results of a specified combiner function applied to combinations of items emitted, in sequence, by anIterableof otherObservableSources.static <@NonNull T, @NonNull R>
@NonNull Observable<R> zipArray(@NonNull Function<? super Object[], ? extends @NonNull R> zipper, boolean delayError, int bufferSize, @NonNull ObservableSource<? extends @NonNull T>... sources) Returns anObservablethat emits the results of a specified combiner function applied to combinations of items emitted, in sequence, by an array of otherObservableSources.final <@NonNull U, @NonNull R>
@NonNull Observable<R> zipWith(@NonNull ObservableSource<? extends @NonNull U> other, @NonNull BiFunction<? super T, ? super @NonNull U, ? extends @NonNull R> zipper) Returns anObservablethat emits items that are the result of applying a specified function to pairs of values, one each from the currentObservableand another specifiedObservableSource.final <@NonNull U, @NonNull R>
@NonNull Observable<R> zipWith(@NonNull ObservableSource<? extends @NonNull U> other, @NonNull BiFunction<? super T, ? super @NonNull U, ? extends @NonNull R> zipper, boolean delayError) Returns anObservablethat emits items that are the result of applying a specified function to pairs of values, one each from the currentObservableand another specifiedObservableSource.final <@NonNull U, @NonNull R>
@NonNull Observable<R> zipWith(@NonNull ObservableSource<? extends @NonNull U> other, @NonNull BiFunction<? super T, ? super @NonNull U, ? extends @NonNull R> zipper, boolean delayError, int bufferSize) Returns anObservablethat emits items that are the result of applying a specified function to pairs of values, one each from the currentObservableand another specifiedObservableSource.final <@NonNull U, @NonNull R>
@NonNull Observable<R> zipWith(@NonNull Iterable<@NonNull U> other, @NonNull BiFunction<? super T, ? super @NonNull U, ? extends @NonNull R> zipper) Returns anObservablethat emits items that are the result of applying a specified function to pairs of values, one each from the currentObservableand a specifiedIterablesequence.
-
Method Details
-
create
Creates an UnicastSubject with an internal buffer capacity hint 16.- Type Parameters:
T- the value type- Returns:
- an UnicastSubject instance
-
create
Creates an UnicastSubject with the given internal buffer capacity hint.- Type Parameters:
T- the value type- Parameters:
capacityHint- the hint to size the internal unbounded buffer- Returns:
- an UnicastSubject instance
- Throws:
IllegalArgumentException- ifcapacityHintis non-positive
-
create
@CheckReturnValue @NonNull public static <T> @NonNull UnicastSubject<T> create(int capacityHint, @NonNull @NonNull Runnable onTerminate) Creates an UnicastSubject with the given internal buffer capacity hint and a callback for the case when the single Subscriber cancels its subscription or the subject is terminated.The callback, if not null, is called exactly once and non-overlapped with any active replay.
- Type Parameters:
T- the value type- Parameters:
capacityHint- the hint to size the internal unbounded bufferonTerminate- the callback to run when the Subject is terminated or cancelled, null not allowed- Returns:
- an UnicastSubject instance
- Throws:
NullPointerException- ifonTerminateisnullIllegalArgumentException- ifcapacityHintis non-positive
-
create
@CheckReturnValue @NonNull public static <T> @NonNull UnicastSubject<T> create(int capacityHint, @NonNull @NonNull Runnable onTerminate, boolean delayError) Creates an UnicastSubject with the given internal buffer capacity hint, delay error flag and a callback for the case when the single Observer disposes itsDisposableor the subject is terminated.The callback, if not null, is called exactly once and non-overlapped with any active replay.
History: 2.0.8 - experimental
- Type Parameters:
T- the value type- Parameters:
capacityHint- the hint to size the internal unbounded bufferonTerminate- the callback to run when the Subject is terminated or cancelled, null not alloweddelayError- deliver pending onNext events before onError- Returns:
- an UnicastSubject instance
- Throws:
NullPointerException- ifonTerminateisnullIllegalArgumentException- ifcapacityHintis non-positive- Since:
- 2.2
-
create
Creates an UnicastSubject with an internal buffer capacity hint 16 and given delay error flag.The callback, if not null, is called exactly once and non-overlapped with any active replay.
History: 2.0.8 - experimental
- Type Parameters:
T- the value type- Parameters:
delayError- deliver pending onNext events before onError- Returns:
- an UnicastSubject instance
- Since:
- 2.2
-
subscribeActual
Description copied from class:ObservableOperator implementations (both source and intermediate) should implement this method that performs the necessary business logic and handles the incomingObservers.There is no need to call any of the plugin hooks on the current
Observableinstance or theObserver; all hooks and basic safeguards have been applied byObservable.subscribe(Observer)before this method gets called.- Specified by:
subscribeActualin classObservable<T>- Parameters:
observer- the incomingObserver, nevernull
-
onSubscribe
Description copied from interface:ObserverProvides theObserverwith the means of cancelling (disposing) the connection (channel) with theObservablein both synchronous (from withinObserver.onNext(Object)) and asynchronous manner.- Parameters:
d- theDisposableinstance whoseDisposable.dispose()can be called anytime to cancel the connection
-
onNext
Description copied from interface:ObserverProvides theObserverwith a new item to observe.The
Observablemay call this method 0 or more times.The
Observablewill not call this method again after it calls eitherObserver.onComplete()orObserver.onError(Throwable).- Parameters:
t- the item emitted by the Observable
-
onError
Description copied from interface:ObserverNotifies theObserverthat theObservablehas experienced an error condition.If the
Observablecalls this method, it will not thereafter callObserver.onNext(T)orObserver.onComplete().- Parameters:
t- the exception encountered by the Observable
-
onComplete
public void onComplete()Description copied from interface:ObserverNotifies theObserverthat theObservablehas finished sending push-based notifications.The
Observablewill not call this method if it callsObserver.onError(Throwable). -
hasObservers
Description copied from class:SubjectReturns true if the subject has any Observers.The method is thread-safe.
- Specified by:
hasObserversin classSubject<T>- Returns:
- true if the subject has any Observers
-
getThrowable
Description copied from class:SubjectReturns the error that caused the Subject to terminate or null if the Subject hasn't terminated yet.The method is thread-safe.
- Specified by:
getThrowablein classSubject<T>- Returns:
- the error that caused the Subject to terminate or null if the Subject hasn't terminated yet
-
hasThrowable
Description copied from class:SubjectReturns true if the subject has reached a terminal state through an error event.The method is thread-safe.
- Specified by:
hasThrowablein classSubject<T>- Returns:
- true if the subject has reached a terminal state through an error event
- See Also:
-
hasComplete
Description copied from class:SubjectReturns true if the subject has reached a terminal state through a complete event.The method is thread-safe.
- Specified by:
hasCompletein classSubject<T>- Returns:
- true if the subject has reached a terminal state through a complete event
- See Also:
-