Package | Description |
---|---|
io.reactivex |
Base reactive classes:
Flowable , Observable ,
Single , Maybe and
Completable ; base reactive consumers;
other common base interfaces. |
io.reactivex.internal.operators.completable | |
io.reactivex.internal.operators.flowable | |
io.reactivex.internal.operators.maybe | |
io.reactivex.internal.operators.observable | |
io.reactivex.internal.operators.single | |
io.reactivex.plugins |
Contains the central plugin handler
RxJavaPlugins
class to hook into the lifecycle of the base reactive types and schedulers. |
io.reactivex.subjects |
Classes representing so-called hot sources, aka subjects, that implement a base reactive class and
the respective consumer type at once to allow forms of multicasting events to multiple
consumers as well as consuming another base reactive type of their kind.
|
Modifier and Type | Method and Description |
---|---|
Single<Boolean> |
Observable.all(Predicate<? super T> predicate)
Returns a Single that emits a Boolean that indicates whether all of the items emitted by the source
ObservableSource satisfy a condition.
|
Single<Boolean> |
Flowable.all(Predicate<? super T> predicate)
Returns a Single that emits a Boolean that indicates whether all of the items emitted by the source
Publisher satisfy a condition.
|
static <T> Single<T> |
Single.amb(Iterable<? extends SingleSource<? extends T>> sources)
Runs multiple SingleSources and signals the events of the first one that signals (disposing
the rest).
|
static <T> Single<T> |
Single.ambArray(SingleSource<? extends T>... sources)
Runs multiple SingleSources and signals the events of the first one that signals (disposing
the rest).
|
Single<T> |
Single.ambWith(SingleSource<? extends T> other)
Signals the event of this or the other SingleSource whichever signals first.
|
<T> Single<T> |
Completable.andThen(SingleSource<T> next)
Returns a Single which will subscribe to this Completable and once that is completed then
will subscribe to the
next SingleSource. |
Single<Boolean> |
Observable.any(Predicate<? super T> predicate)
Returns a Single that emits
true if any item emitted by the source ObservableSource satisfies a
specified condition, otherwise false . |
Single<Boolean> |
Flowable.any(Predicate<? super T> predicate)
Returns a Single that emits
true if any item emitted by the source Publisher satisfies a
specified condition, otherwise false . |
Single<T> |
Single.cache()
Stores the success value or exception from the current Single and replays it to late SingleObservers.
|
<U> Single<U> |
Single.cast(Class<? extends U> clazz)
Casts the success value of the current Single into the target type or signals a
ClassCastException if not compatible.
|
<U> Single<U> |
Observable.collect(Callable<? extends U> initialValueSupplier,
BiConsumer<? super U,? super T> collector)
Collects items emitted by the finite source ObservableSource into a single mutable data structure and returns
a Single that emits this structure.
|
<U> Single<U> |
Flowable.collect(Callable<? extends U> initialItemSupplier,
BiConsumer<? super U,? super T> collector)
Collects items emitted by the finite source Publisher into a single mutable data structure and returns
a Single that emits this structure.
|
<U> Single<U> |
Observable.collectInto(U initialValue,
BiConsumer<? super U,? super T> collector)
Collects items emitted by the finite source ObservableSource into a single mutable data structure and returns
a Single that emits this structure.
|
<U> Single<U> |
Flowable.collectInto(U initialItem,
BiConsumer<? super U,? super T> collector)
Collects items emitted by the finite source Publisher into a single mutable data structure and returns
a Single that emits this structure.
|
<R> Single<R> |
Single.compose(SingleTransformer<? super T,? extends R> transformer)
Transform a Single by applying a particular Transformer function to it.
|
Single<Boolean> |
Single.contains(Object value)
Signals true if the current Single signals a success value that is Object-equals with the value
provided.
|
Single<Boolean> |
Observable.contains(Object element)
Returns a Single that emits a Boolean that indicates whether the source ObservableSource emitted a
specified item.
|
Single<Boolean> |
Maybe.contains(Object item)
Returns a Single that emits a Boolean that indicates whether the source Maybe emitted a
specified item.
|
Single<Boolean> |
Flowable.contains(Object item)
Returns a Single that emits a Boolean that indicates whether the source Publisher emitted a
specified item.
|
Single<Boolean> |
Single.contains(Object value,
BiPredicate<Object,Object> comparer)
Signals true if the current Single signals a success value that is equal with
the value provided by calling a bi-predicate.
|
Single<Long> |
Observable.count()
Returns a Single that counts the total number of items emitted by the source ObservableSource and emits
this count as a 64-bit Long.
|
Single<Long> |
Maybe.count()
Returns a Maybe that counts the total number of items emitted (0 or 1) by the source Maybe and emits
this count as a 64-bit Long.
|
Single<Long> |
Flowable.count()
Returns a Single that counts the total number of items emitted by the source Publisher and emits
this count as a 64-bit Long.
|
static <T> Single<T> |
Single.create(SingleOnSubscribe<T> source)
Provides an API (via a cold Completable) that bridges the reactive world with the callback-style world.
|
static <T> Single<T> |
Single.defer(Callable<? extends SingleSource<? extends T>> singleSupplier)
Calls a
Callable for each individual SingleObserver to return the actual SingleSource to
be subscribed to. |
Single<T> |
Single.delay(long time,
TimeUnit unit)
Delays the emission of the success signal from the current Single by the specified amount.
|
Single<T> |
Single.delay(long time,
TimeUnit unit,
boolean delayError)
Delays the emission of the success or error signal from the current Single by the specified amount.
|
Single<T> |
Single.delay(long time,
TimeUnit unit,
Scheduler scheduler)
Delays the emission of the success signal from the current Single by the specified amount.
|
Single<T> |
Single.delay(long time,
TimeUnit unit,
Scheduler scheduler,
boolean delayError)
Delays the emission of the success or error signal from the current Single by the specified amount.
|
Single<T> |
Single.delaySubscription(CompletableSource other)
Delays the actual subscription to the current Single until the given other CompletableSource
completes.
|
Single<T> |
Single.delaySubscription(long time,
TimeUnit unit)
Delays the actual subscription to the current Single until the given time delay elapsed.
|
Single<T> |
Single.delaySubscription(long time,
TimeUnit unit,
Scheduler scheduler)
Delays the actual subscription to the current Single until the given time delay elapsed.
|
<U> Single<T> |
Single.delaySubscription(ObservableSource<U> other)
Delays the actual subscription to the current Single until the given other ObservableSource
signals its first value or completes.
|
<U> Single<T> |
Single.delaySubscription(org.reactivestreams.Publisher<U> other)
Delays the actual subscription to the current Single until the given other Publisher
signals its first value or completes.
|
<U> Single<T> |
Single.delaySubscription(SingleSource<U> other)
Delays the actual subscription to the current Single until the given other SingleSource
signals success.
|
Single<T> |
Single.doAfterSuccess(Consumer<? super T> onAfterSuccess)
Calls the specified consumer with the success item after this item has been emitted to the downstream.
|
Single<T> |
Single.doAfterTerminate(Action onAfterTerminate)
Registers an
Action to be called after this Single invokes either onSuccess or onError. |
Single<T> |
Single.doFinally(Action onFinally)
Calls the specified action after this Single signals onSuccess or onError or gets disposed by
the downstream.
|
Single<T> |
Single.doOnDispose(Action onDispose)
Calls the shared
Action if a SingleObserver subscribed to the current Single
disposes the common Disposable it received via onSubscribe. |
Single<T> |
Single.doOnError(Consumer<? super Throwable> onError)
Calls the shared consumer with the error sent via onError for each
SingleObserver that subscribes to the current Single.
|
Single<T> |
Single.doOnEvent(BiConsumer<? super T,? super Throwable> onEvent)
Calls the shared consumer with the error sent via onError or the value
via onSuccess for each SingleObserver that subscribes to the current Single.
|
Single<T> |
Single.doOnSubscribe(Consumer<? super Disposable> onSubscribe)
Calls the shared consumer with the Disposable sent through the onSubscribe for each
SingleObserver that subscribes to the current Single.
|
Single<T> |
Single.doOnSuccess(Consumer<? super T> onSuccess)
Calls the shared consumer with the success value sent via onSuccess for each
SingleObserver that subscribes to the current Single.
|
Single<T> |
Observable.elementAt(long index,
T defaultItem)
Returns a Single that emits the item found at a specified index in a sequence of emissions from
this Observable, or a default item if that index is out of range.
|
Single<T> |
Flowable.elementAt(long index,
T defaultItem)
Returns a Flowable that emits the item found at a specified index in a sequence of emissions from
this Flowable, or a default item if that index is out of range.
|
Single<T> |
Observable.elementAtOrError(long index)
Returns a Single that emits the item found at a specified index in a sequence of emissions from this Observable
or signals a
NoSuchElementException if this Observable signals fewer elements than index. |
Single<T> |
Flowable.elementAtOrError(long index)
Returns a Flowable that emits the item found at a specified index in a sequence of emissions from
this Flowable or signals a
NoSuchElementException if this Flowable has fewer elements than index. |
static <T> Single<Boolean> |
Single.equals(SingleSource<? extends T> first,
SingleSource<? extends T> second)
Compares two SingleSources and emits true if they emit the same value (compared via Object.equals).
|
static <T> Single<T> |
Single.error(Callable<? extends Throwable> errorSupplier)
Signals a Throwable returned by the callback function for each individual SingleObserver.
|
static <T> Single<T> |
Single.error(Throwable exception)
Returns a Single that invokes a subscriber's
onError method when the
subscriber subscribes to it. |
Single<T> |
Observable.first(T defaultItem)
Returns a Single that emits only the very first item emitted by the source ObservableSource, or a default item
if the source ObservableSource completes without emitting any items.
|
Single<T> |
Flowable.first(T defaultItem)
Returns a Single that emits only the very first item emitted by this Flowable, or a default
item if this Flowable completes without emitting anything.
|
Single<T> |
Observable.firstOrError()
Returns a Single that emits only the very first item emitted by this Observable or
signals a
NoSuchElementException if this Observable is empty. |
Single<T> |
Flowable.firstOrError()
Returns a Single that emits only the very first item emitted by this Flowable or
signals a
NoSuchElementException if this Flowable is empty. |
<R> Single<R> |
Single.flatMap(Function<? super T,? extends SingleSource<? extends R>> mapper)
Returns a Single that is based on applying a specified function to the item emitted by the source Single,
where that function returns a SingleSource.
|
<R> Single<R> |
Maybe.flatMapSingle(Function<? super T,? extends SingleSource<? extends R>> mapper)
|
static <T> Single<T> |
Single.fromCallable(Callable<? extends T> callable)
Returns a
Single that invokes passed function and emits its result for each new SingleObserver that subscribes. |
static <T> Single<T> |
Single.fromFuture(Future<? extends T> future)
Converts a
Future into a Single . |
static <T> Single<T> |
Single.fromFuture(Future<? extends T> future,
long timeout,
TimeUnit unit)
Converts a
Future into a Single , with a timeout on the Future. |
static <T> Single<T> |
Single.fromFuture(Future<? extends T> future,
long timeout,
TimeUnit unit,
Scheduler scheduler)
Converts a
Future into a Single , with a timeout on the Future. |
static <T> Single<T> |
Single.fromFuture(Future<? extends T> future,
Scheduler scheduler)
|
static <T> Single<T> |
Single.fromObservable(ObservableSource<? extends T> observableSource)
Wraps a specific ObservableSource into a Single and signals its single element or error.
|
static <T> Single<T> |
Single.fromPublisher(org.reactivestreams.Publisher<? extends T> publisher)
Wraps a specific Publisher into a Single and signals its single element or error.
|
Single<T> |
Single.hide()
Hides the identity of the current Single, including the Disposable that is sent
to the downstream via
onSubscribe() . |
Single<Boolean> |
Observable.isEmpty()
Returns a Single that emits
true if the source ObservableSource is empty, otherwise false . |
Single<Boolean> |
Maybe.isEmpty()
Returns a Single that emits
true if the source Maybe is empty, otherwise false . |
Single<Boolean> |
Flowable.isEmpty()
Returns a Single that emits
true if the source Publisher is empty, otherwise false . |
static <T> Single<T> |
Single.just(T item)
Returns a
Single that emits a specified item. |
Single<T> |
Observable.last(T defaultItem)
Returns a Single that emits only the last item emitted by this Observable, or a default item
if this Observable completes without emitting any items.
|
Single<T> |
Flowable.last(T defaultItem)
Returns a Single that emits only the last item emitted by this Flowable, or a default item
if this Flowable completes without emitting any items.
|
Single<T> |
Observable.lastOrError()
Returns a Single that emits only the last item emitted by this Observable or
signals a
NoSuchElementException if this Observable is empty. |
Single<T> |
Flowable.lastOrError()
Returns a Single that emits only the last item emitted by this Flowable or signals
a
NoSuchElementException if this Flowable is empty. |
<R> Single<R> |
Single.lift(SingleOperator<? extends R,? super T> lift)
This method requires advanced knowledge about building operators, please consider
other standard composition methods first;
Returns a
Single which, when subscribed to, invokes the apply(SingleObserver) method
of the provided SingleOperator for each individual downstream Single and allows the
insertion of a custom operator by accessing the downstream's SingleObserver during this subscription phase
and providing a new SingleObserver , containing the custom operator's intended business logic, that will be
used in the subscription process going further upstream. |
<R> Single<R> |
Single.map(Function<? super T,? extends R> mapper)
Returns a Single that applies a specified function to the item emitted by the source Single and
emits the result of this function application.
|
Single<Notification<T>> |
Single.materialize()
Maps the signal types of this Single into a
Notification of the same kind
and emits it as a single success value to downstream. |
Single<Notification<T>> |
Maybe.materialize()
Maps the signal types of this Maybe into a
Notification of the same kind
and emits it as a single success value to downstream. |
<T> Single<Notification<T>> |
Completable.materialize()
Maps the signal types of this Completable into a
Notification of the same kind
and emits it as a single success value to downstream. |
static <T> Single<T> |
Single.merge(SingleSource<? extends SingleSource<? extends T>> source)
Flattens a
Single that emits a Single into a single Single that emits the item
emitted by the nested Single , without any transformation. |
static <T> Single<T> |
Single.never()
Returns a singleton instance of a never-signalling Single (only calls onSubscribe).
|
Single<T> |
Single.observeOn(Scheduler scheduler)
Modifies a Single to emit its item (or notify of its error) on a specified
Scheduler ,
asynchronously. |
Single<T> |
Single.onErrorResumeNext(Function<? super Throwable,? extends SingleSource<? extends T>> resumeFunctionInCaseOfError)
Instructs a Single to pass control to another Single rather than invoking
SingleObserver.onError(Throwable) if it encounters an error. |
Single<T> |
Single.onErrorResumeNext(Single<? extends T> resumeSingleInCaseOfError)
Instructs a Single to pass control to another Single rather than invoking
SingleObserver.onError(Throwable) if it encounters an error. |
Single<T> |
Single.onErrorReturn(Function<Throwable,? extends T> resumeFunction)
Instructs a Single to emit an item (returned by a specified function) rather than invoking
onError if it encounters an error. |
Single<T> |
Single.onErrorReturnItem(T value)
Signals the specified value as success in case the current Single signals an error.
|
Single<T> |
Single.onTerminateDetach()
Nulls out references to the upstream producer and downstream SingleObserver if
the sequence is terminated or downstream calls dispose().
|
<R> Single<R> |
Observable.reduce(R seed,
BiFunction<R,? super T,R> reducer)
Returns a Single that applies a specified accumulator function to the first item emitted by a source
ObservableSource and a specified seed value, then feeds the result of that function along with the second item
emitted by an ObservableSource into the same function, and so on until all items have been emitted by the
finite source ObservableSource, emitting the final result from the final call to your function as its sole item.
|
<R> Single<R> |
Flowable.reduce(R seed,
BiFunction<R,? super T,R> reducer)
Returns a Single that applies a specified accumulator function to the first item emitted by a source
Publisher and a specified seed value, then feeds the result of that function along with the second item
emitted by a Publisher into the same function, and so on until all items have been emitted by the
finite source Publisher, emitting the final result from the final call to your function as its sole item.
|
<R> Single<R> |
Observable.reduceWith(Callable<R> seedSupplier,
BiFunction<R,? super T,R> reducer)
Returns a Single that applies a specified accumulator function to the first item emitted by a source
ObservableSource and a seed value derived from calling a specified seedSupplier, then feeds the result
of that function along with the second item emitted by an ObservableSource into the same function,
and so on until all items have been emitted by the finite source ObservableSource, emitting the final result
from the final call to your function as its sole item.
|
<R> Single<R> |
Flowable.reduceWith(Callable<R> seedSupplier,
BiFunction<R,? super T,R> reducer)
Returns a Single that applies a specified accumulator function to the first item emitted by a source
Publisher and a seed value derived from calling a specified seedSupplier, then feeds the result
of that function along with the second item emitted by a Publisher into the same function, and so on until
all items have been emitted by the finite source Publisher, emitting the final result from the final call to your
function as its sole item.
|
Single<T> |
Single.retry()
Repeatedly re-subscribes to the current Single indefinitely if it fails with an onError.
|
Single<T> |
Single.retry(BiPredicate<? super Integer,? super Throwable> predicate)
Re-subscribe to the current Single if the given predicate returns true when the Single fails
with an onError.
|
Single<T> |
Single.retry(long times)
Repeatedly re-subscribe at most the specified times to the current Single
if it fails with an onError.
|
Single<T> |
Single.retry(long times,
Predicate<? super Throwable> predicate)
Repeatedly re-subscribe at most times or until the predicate returns false, whichever happens first
if it fails with an onError.
|
Single<T> |
Single.retry(Predicate<? super Throwable> predicate)
Re-subscribe to the current Single if the given predicate returns true when the Single fails
with an onError.
|
Single<T> |
Single.retryWhen(Function<? super Flowable<Throwable>,? extends org.reactivestreams.Publisher<?>> handler)
Re-subscribes to the current Single if and when the Publisher returned by the handler
function signals a value.
|
static <T> Single<Boolean> |
Maybe.sequenceEqual(MaybeSource<? extends T> source1,
MaybeSource<? extends T> source2)
Returns a Single that emits a Boolean value that indicates whether two MaybeSource sequences are the
same by comparing the items emitted by each MaybeSource pairwise.
|
static <T> Single<Boolean> |
Maybe.sequenceEqual(MaybeSource<? extends T> source1,
MaybeSource<? extends T> source2,
BiPredicate<? super T,? super T> isEqual)
Returns a Single that emits a Boolean value that indicates whether two MaybeSources are the
same by comparing the items emitted by each MaybeSource pairwise based on the results of a specified
equality function.
|
static <T> Single<Boolean> |
Observable.sequenceEqual(ObservableSource<? extends T> source1,
ObservableSource<? extends T> source2)
Returns a Single that emits a Boolean value that indicates whether two ObservableSource sequences are the
same by comparing the items emitted by each ObservableSource pairwise.
|
static <T> Single<Boolean> |
Observable.sequenceEqual(ObservableSource<? extends T> source1,
ObservableSource<? extends T> source2,
BiPredicate<? super T,? super T> isEqual)
Returns a Single that emits a Boolean value that indicates whether two ObservableSource sequences are the
same by comparing the items emitted by each ObservableSource pairwise based on the results of a specified
equality function.
|
static <T> Single<Boolean> |
Observable.sequenceEqual(ObservableSource<? extends T> source1,
ObservableSource<? extends T> source2,
BiPredicate<? super T,? super T> isEqual,
int bufferSize)
Returns a Single that emits a Boolean value that indicates whether two ObservableSource sequences are the
same by comparing the items emitted by each ObservableSource pairwise based on the results of a specified
equality function.
|
static <T> Single<Boolean> |
Observable.sequenceEqual(ObservableSource<? extends T> source1,
ObservableSource<? extends T> source2,
int bufferSize)
Returns a Single that emits a Boolean value that indicates whether two ObservableSource sequences are the
same by comparing the items emitted by each ObservableSource pairwise.
|
static <T> Single<Boolean> |
Flowable.sequenceEqual(org.reactivestreams.Publisher<? extends T> source1,
org.reactivestreams.Publisher<? extends T> source2)
Returns a Single that emits a Boolean value that indicates whether two Publisher sequences are the
same by comparing the items emitted by each Publisher pairwise.
|
static <T> Single<Boolean> |
Flowable.sequenceEqual(org.reactivestreams.Publisher<? extends T> source1,
org.reactivestreams.Publisher<? extends T> source2,
BiPredicate<? super T,? super T> isEqual)
Returns a Single that emits a Boolean value that indicates whether two Publisher sequences are the
same by comparing the items emitted by each Publisher pairwise based on the results of a specified
equality function.
|
static <T> Single<Boolean> |
Flowable.sequenceEqual(org.reactivestreams.Publisher<? extends T> source1,
org.reactivestreams.Publisher<? extends T> source2,
BiPredicate<? super T,? super T> isEqual,
int bufferSize)
Returns a Single that emits a Boolean value that indicates whether two Publisher sequences are the
same by comparing the items emitted by each Publisher pairwise based on the results of a specified
equality function.
|
static <T> Single<Boolean> |
Flowable.sequenceEqual(org.reactivestreams.Publisher<? extends T> source1,
org.reactivestreams.Publisher<? extends T> source2,
int bufferSize)
Returns a Single that emits a Boolean value that indicates whether two Publisher sequences are the
same by comparing the items emitted by each Publisher pairwise.
|
Single<T> |
Observable.single(T defaultItem)
Returns a Single that emits the single item emitted by this Observable, if this Observable
emits only a single item, or a default item if the source ObservableSource emits no items.
|
Single<T> |
Flowable.single(T defaultItem)
Returns a Single that emits the single item emitted by the source Publisher, if that Publisher
emits only a single item, or a default item if the source Publisher emits no items.
|
Single<T> |
Observable.singleOrError()
Returns a Single that emits the single item emitted by this Observable if this Observable
emits only a single item, otherwise
if this Observable completes without emitting any items or emits more than one item a
NoSuchElementException or IllegalArgumentException will be signalled respectively. |
Single<T> |
Flowable.singleOrError()
Returns a Single that emits the single item emitted by this Flowable, if this Flowable
emits only a single item, otherwise
if this Flowable completes without emitting any items a
NoSuchElementException will be signaled and
if this Flowable emits more than one item, an IllegalArgumentException will be signaled. |
Single<T> |
Single.subscribeOn(Scheduler scheduler)
Asynchronously subscribes subscribers to this Single on the specified
Scheduler . |
Single<T> |
Maybe.switchIfEmpty(SingleSource<? extends T> other)
Returns a Single that emits the items emitted by the source Maybe or the item of an alternate
SingleSource if the current Maybe is empty.
|
Single<T> |
Single.takeUntil(CompletableSource other)
Returns a Single that emits the item emitted by the source Single until a Completable terminates.
|
<E> Single<T> |
Single.takeUntil(org.reactivestreams.Publisher<E> other)
Returns a Single that emits the item emitted by the source Single until a Publisher emits an item.
|
<E> Single<T> |
Single.takeUntil(SingleSource<? extends E> other)
Returns a Single that emits the item emitted by the source Single until a second Single emits an item.
|
Single<T> |
Single.timeout(long timeout,
TimeUnit unit)
Signals a TimeoutException if the current Single doesn't signal a success value within the
specified timeout window.
|
Single<T> |
Single.timeout(long timeout,
TimeUnit unit,
Scheduler scheduler)
Signals a TimeoutException if the current Single doesn't signal a success value within the
specified timeout window.
|
Single<T> |
Single.timeout(long timeout,
TimeUnit unit,
Scheduler scheduler,
SingleSource<? extends T> other)
Runs the current Single and if it doesn't signal within the specified timeout window, it is
disposed and the other SingleSource subscribed to.
|
Single<T> |
Single.timeout(long timeout,
TimeUnit unit,
SingleSource<? extends T> other)
Runs the current Single and if it doesn't signal within the specified timeout window, it is
disposed and the other SingleSource subscribed to.
|
static Single<Long> |
Single.timer(long delay,
TimeUnit unit)
Signals success with 0L value after the given delay for each SingleObserver.
|
static Single<Long> |
Single.timer(long delay,
TimeUnit unit,
Scheduler scheduler)
Signals success with 0L value after the given delay for each SingleObserver.
|
Single<List<T>> |
Observable.toList()
Returns a Single that emits a single item, a list composed of all the items emitted by the
finite source ObservableSource.
|
Single<List<T>> |
Flowable.toList()
Returns a Single that emits a single item, a list composed of all the items emitted by the
finite upstream source Publisher.
|
<U extends Collection<? super T>> |
Observable.toList(Callable<U> collectionSupplier)
Returns a Single that emits a single item, a list composed of all the items emitted by the
finite source ObservableSource.
|
<U extends Collection<? super T>> |
Flowable.toList(Callable<U> collectionSupplier)
Returns a Single that emits a single item, a list composed of all the items emitted by the
finite source Publisher.
|
Single<List<T>> |
Observable.toList(int capacityHint)
Returns a Single that emits a single item, a list composed of all the items emitted by the
finite source ObservableSource.
|
Single<List<T>> |
Flowable.toList(int capacityHint)
Returns a Single that emits a single item, a list composed of all the items emitted by the
finite source Publisher.
|
<K> Single<Map<K,T>> |
Observable.toMap(Function<? super T,? extends K> keySelector)
Returns a Single that emits a single HashMap containing all items emitted by the
finite source ObservableSource, mapped by the keys returned by a specified
keySelector function. |
<K> Single<Map<K,T>> |
Flowable.toMap(Function<? super T,? extends K> keySelector)
Returns a Single that emits a single HashMap containing all items emitted by the finite source Publisher,
mapped by the keys returned by a specified
keySelector function. |
<K,V> Single<Map<K,V>> |
Observable.toMap(Function<? super T,? extends K> keySelector,
Function<? super T,? extends V> valueSelector)
Returns a Single that emits a single HashMap containing values corresponding to items emitted by the
finite source ObservableSource, mapped by the keys returned by a specified
keySelector function. |
<K,V> Single<Map<K,V>> |
Flowable.toMap(Function<? super T,? extends K> keySelector,
Function<? super T,? extends V> valueSelector)
Returns a Single that emits a single HashMap containing values corresponding to items emitted by the
finite source Publisher, mapped by the keys returned by a specified
keySelector function. |
<K,V> Single<Map<K,V>> |
Observable.toMap(Function<? super T,? extends K> keySelector,
Function<? super T,? extends V> valueSelector,
Callable<? extends Map<K,V>> mapSupplier)
Returns a Single that emits a single Map, returned by a specified
mapFactory function, that
contains keys and values extracted from the items emitted by the finite source ObservableSource. |
<K,V> Single<Map<K,V>> |
Flowable.toMap(Function<? super T,? extends K> keySelector,
Function<? super T,? extends V> valueSelector,
Callable<? extends Map<K,V>> mapSupplier)
Returns a Single that emits a single Map, returned by a specified
mapFactory function, that
contains keys and values extracted from the items emitted by the finite source Publisher. |
<K> Single<Map<K,Collection<T>>> |
Observable.toMultimap(Function<? super T,? extends K> keySelector)
Returns a Single that emits a single HashMap that contains an ArrayList of items emitted by the
finite source ObservableSource keyed by a specified
keySelector function. |
<K> Single<Map<K,Collection<T>>> |
Flowable.toMultimap(Function<? super T,? extends K> keySelector)
Returns a Single that emits a single HashMap that contains an ArrayList of items emitted by the
finite source Publisher keyed by a specified
keySelector function. |
<K,V> Single<Map<K,Collection<V>>> |
Observable.toMultimap(Function<? super T,? extends K> keySelector,
Function<? super T,? extends V> valueSelector)
Returns a Single that emits a single HashMap that contains an ArrayList of values extracted by a
specified
valueSelector function from items emitted by the finite source ObservableSource,
keyed by a specified keySelector function. |
<K,V> Single<Map<K,Collection<V>>> |
Flowable.toMultimap(Function<? super T,? extends K> keySelector,
Function<? super T,? extends V> valueSelector)
Returns a Single that emits a single HashMap that contains an ArrayList of values extracted by a
specified
valueSelector function from items emitted by the finite source Publisher, keyed by a
specified keySelector function. |
<K,V> Single<Map<K,Collection<V>>> |
Observable.toMultimap(Function<? super T,? extends K> keySelector,
Function<? super T,? extends V> valueSelector,
Callable<? extends Map<K,Collection<V>>> mapSupplier,
Function<? super K,? extends Collection<? super V>> collectionFactory)
Returns a Single that emits a single Map, returned by a specified
mapFactory function, that
contains a custom collection of values, extracted by a specified valueSelector function from
items emitted by the source ObservableSource, and keyed by the keySelector function. |
<K,V> Single<Map<K,Collection<V>>> |
Flowable.toMultimap(Function<? super T,? extends K> keySelector,
Function<? super T,? extends V> valueSelector,
Callable<? extends Map<K,Collection<V>>> mapSupplier,
Function<? super K,? extends Collection<? super V>> collectionFactory)
Returns a Single that emits a single Map, returned by a specified
mapFactory function, that
contains a custom collection of values, extracted by a specified valueSelector function from
items emitted by the finite source Publisher, and keyed by the keySelector function. |
<K,V> Single<Map<K,Collection<V>>> |
Observable.toMultimap(Function<? super T,? extends K> keySelector,
Function<? super T,? extends V> valueSelector,
Callable<Map<K,Collection<V>>> mapSupplier)
Returns a Single that emits a single Map, returned by a specified
mapFactory function, that
contains an ArrayList of values, extracted by a specified valueSelector function from items
emitted by the finite source ObservableSource and keyed by the keySelector function. |
<K,V> Single<Map<K,Collection<V>>> |
Flowable.toMultimap(Function<? super T,? extends K> keySelector,
Function<? super T,? extends V> valueSelector,
Callable<Map<K,Collection<V>>> mapSupplier)
Returns a Single that emits a single Map, returned by a specified
mapFactory function, that
contains an ArrayList of values, extracted by a specified valueSelector function from items
emitted by the finite source Publisher and keyed by the keySelector function. |
Single<T> |
Maybe.toSingle()
Converts this Maybe into a Single instance composing disposal
through and turning an empty Maybe into a signal of NoSuchElementException.
|
<T> Single<T> |
Completable.toSingle(Callable<? extends T> completionValueSupplier)
Converts this Completable into a Single which when this Completable completes normally,
calls the given supplier and emits its returned value through onSuccess.
|
Single<T> |
Maybe.toSingle(T defaultValue)
Converts this Maybe into a Single instance composing disposal
through and turning an empty Maybe into a Single that emits the given
value through onSuccess.
|
<T> Single<T> |
Completable.toSingleDefault(T completionValue)
Converts this Completable into a Single which when this Completable completes normally,
emits the given value through onSuccess.
|
Single<List<T>> |
Observable.toSortedList()
Returns a Single that emits a list that contains the items emitted by the finite source ObservableSource, in a
sorted order.
|
Single<List<T>> |
Flowable.toSortedList()
Returns a Single that emits a list that contains the items emitted by the finite source Publisher, in a
sorted order.
|
Single<List<T>> |
Observable.toSortedList(Comparator<? super T> comparator)
Returns a Single that emits a list that contains the items emitted by the finite source ObservableSource, in a
sorted order based on a specified comparison function.
|
Single<List<T>> |
Flowable.toSortedList(Comparator<? super T> comparator)
Returns a Single that emits a list that contains the items emitted by the finite source Publisher, in a
sorted order based on a specified comparison function.
|
Single<List<T>> |
Observable.toSortedList(Comparator<? super T> comparator,
int capacityHint)
Returns a Single that emits a list that contains the items emitted by the finite source ObservableSource, in a
sorted order based on a specified comparison function.
|
Single<List<T>> |
Flowable.toSortedList(Comparator<? super T> comparator,
int capacityHint)
Returns a Single that emits a list that contains the items emitted by the finite source Publisher, in a
sorted order based on a specified comparison function.
|
Single<List<T>> |
Observable.toSortedList(int capacityHint)
Returns a Single that emits a list that contains the items emitted by the finite source ObservableSource, in a
sorted order.
|
Single<List<T>> |
Flowable.toSortedList(int capacityHint)
Returns a Flowable that emits a list that contains the items emitted by the finite source Publisher, in a
sorted order.
|
static <T> Single<T> |
Single.unsafeCreate(SingleSource<T> onSubscribe)
Advanced use only: creates a Single instance without
any safeguards by using a callback that is called with a SingleObserver.
|
Single<T> |
Single.unsubscribeOn(Scheduler scheduler)
Returns a Single which makes sure when a SingleObserver disposes the Disposable,
that call is propagated up on the specified scheduler.
|
static <T,U> Single<T> |
Single.using(Callable<U> resourceSupplier,
Function<? super U,? extends SingleSource<? extends T>> singleFunction,
Consumer<? super U> disposer)
Allows using and disposing a resource while running a SingleSource instance generated from
that resource (similar to a try-with-resources).
|
static <T,U> Single<T> |
Single.using(Callable<U> resourceSupplier,
Function<? super U,? extends SingleSource<? extends T>> singleFunction,
Consumer<? super U> disposer,
boolean eager)
Allows using and disposing a resource while running a SingleSource instance generated from
that resource (similar to a try-with-resources).
|
static <T> Single<T> |
Single.wrap(SingleSource<T> source)
Wraps a SingleSource instance into a new Single instance if not already a Single
instance.
|
static <T,R> Single<R> |
Single.zip(Iterable<? extends SingleSource<? extends T>> sources,
Function<? super Object[],? extends R> zipper)
Waits until all SingleSource sources provided by the Iterable sequence signal a success
value and calls a zipper function with an array of these values to return a result
to be emitted to downstream.
|
static <T1,T2,R> Single<R> |
Single.zip(SingleSource<? extends T1> source1,
SingleSource<? extends T2> source2,
BiFunction<? super T1,? super T2,? extends R> zipper)
Returns a Single that emits the results of a specified combiner function applied to two items emitted by
two other Singles.
|
static <T1,T2,T3,R> |
Single.zip(SingleSource<? extends T1> source1,
SingleSource<? extends T2> source2,
SingleSource<? extends T3> source3,
Function3<? super T1,? super T2,? super T3,? extends R> zipper)
Returns a Single that emits the results of a specified combiner function applied to three items emitted
by three other Singles.
|
static <T1,T2,T3,T4,R> |
Single.zip(SingleSource<? extends T1> source1,
SingleSource<? extends T2> source2,
SingleSource<? extends T3> source3,
SingleSource<? extends T4> source4,
Function4<? super T1,? super T2,? super T3,? super T4,? extends R> zipper)
Returns a Single that emits the results of a specified combiner function applied to four items
emitted by four other Singles.
|
static <T1,T2,T3,T4,T5,R> |
Single.zip(SingleSource<? extends T1> source1,
SingleSource<? extends T2> source2,
SingleSource<? extends T3> source3,
SingleSource<? extends T4> source4,
SingleSource<? extends T5> source5,
Function5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> zipper)
Returns a Single that emits the results of a specified combiner function applied to five items
emitted by five other Singles.
|
static <T1,T2,T3,T4,T5,T6,R> |
Single.zip(SingleSource<? extends T1> source1,
SingleSource<? extends T2> source2,
SingleSource<? extends T3> source3,
SingleSource<? extends T4> source4,
SingleSource<? extends T5> source5,
SingleSource<? extends T6> source6,
Function6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> zipper)
Returns a Single that emits the results of a specified combiner function applied to six items
emitted by six other Singles.
|
static <T1,T2,T3,T4,T5,T6,T7,R> |
Single.zip(SingleSource<? extends T1> source1,
SingleSource<? extends T2> source2,
SingleSource<? extends T3> source3,
SingleSource<? extends T4> source4,
SingleSource<? extends T5> source5,
SingleSource<? extends T6> source6,
SingleSource<? extends T7> source7,
Function7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> zipper)
Returns a Single that emits the results of a specified combiner function applied to seven items
emitted by seven other Singles.
|
static <T1,T2,T3,T4,T5,T6,T7,T8,R> |
Single.zip(SingleSource<? extends T1> source1,
SingleSource<? extends T2> source2,
SingleSource<? extends T3> source3,
SingleSource<? extends T4> source4,
SingleSource<? extends T5> source5,
SingleSource<? extends T6> source6,
SingleSource<? extends T7> source7,
SingleSource<? extends T8> source8,
Function8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> zipper)
Returns a Single that emits the results of a specified combiner function applied to eight items
emitted by eight other Singles.
|
static <T1,T2,T3,T4,T5,T6,T7,T8,T9,R> |
Single.zip(SingleSource<? extends T1> source1,
SingleSource<? extends T2> source2,
SingleSource<? extends T3> source3,
SingleSource<? extends T4> source4,
SingleSource<? extends T5> source5,
SingleSource<? extends T6> source6,
SingleSource<? extends T7> source7,
SingleSource<? extends T8> source8,
SingleSource<? extends T9> source9,
Function9<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? super T9,? extends R> zipper)
Returns a Single that emits the results of a specified combiner function applied to nine items
emitted by nine other Singles.
|
static <T,R> Single<R> |
Single.zipArray(Function<? super Object[],? extends R> zipper,
SingleSource<? extends T>... sources)
Waits until all SingleSource sources provided via an array signal a success
value and calls a zipper function with an array of these values to return a result
to be emitted to downstream.
|
<U,R> Single<R> |
Single.zipWith(SingleSource<U> other,
BiFunction<? super T,? super U,? extends R> zipper)
Returns a Single that emits the result of applying a specified function to the pair of items emitted by
the source Single and another specified Single.
|
Modifier and Type | Method and Description |
---|---|
R |
SingleConverter.apply(Single<T> upstream)
Applies a function to the upstream Single and returns a converted value of type
R . |
SingleSource<Downstream> |
SingleTransformer.apply(Single<Upstream> upstream)
Applies a function to the upstream Single and returns a SingleSource with
optionally different element type.
|
Single<T> |
Single.onErrorResumeNext(Single<? extends T> resumeSingleInCaseOfError)
Instructs a Single to pass control to another Single rather than invoking
SingleObserver.onError(Throwable) if it encounters an error. |
Modifier and Type | Method and Description |
---|---|
<R> R |
Single.to(Function<? super Single<T>,R> convert)
Calls the specified converter function with the current Single instance
during assembly time and returns its result.
|
Modifier and Type | Class and Description |
---|---|
class |
CompletableMaterialize<T>
Turn the signal types of a Completable source into a single Notification of
equal kind.
|
class |
CompletableToSingle<T> |
Modifier and Type | Class and Description |
---|---|
class |
FlowableAllSingle<T> |
class |
FlowableAnySingle<T> |
class |
FlowableCollectSingle<T,U> |
class |
FlowableCountSingle<T> |
class |
FlowableElementAtSingle<T> |
class |
FlowableLastSingle<T>
Consumes the source Publisher and emits its last item or the defaultItem
if empty.
|
class |
FlowableReduceSeedSingle<T,R>
Reduce a sequence of values, starting from a seed value and by using
an accumulator function and return the last accumulated value.
|
class |
FlowableReduceWithSingle<T,R>
Reduce a sequence of values, starting from a generated seed value and by using
an accumulator function and return the last accumulated value.
|
class |
FlowableSequenceEqualSingle<T> |
class |
FlowableSingleSingle<T> |
class |
FlowableToListSingle<T,U extends Collection<? super T>> |
Modifier and Type | Class and Description |
---|---|
class |
MaybeContains<T>
Signals true if the source signals a value that is object-equals with the provided
value, false otherwise or for empty sources.
|
class |
MaybeCount<T>
Signals 1L if the source signalled an item or 0L if the source is empty.
|
class |
MaybeEqualSingle<T>
Compares two MaybeSources to see if they are both empty or emit the same value compared
via a BiPredicate.
|
class |
MaybeFlatMapSingle<T,R>
Maps the success value of the source MaybeSource into a Single.
|
class |
MaybeIsEmptySingle<T>
Signals true if the source Maybe signals onComplete, signals false if the source Maybe
signals onSuccess.
|
class |
MaybeMaterialize<T>
Turn the signal types of a Maybe source into a single Notification of
equal kind.
|
class |
MaybeSwitchIfEmptySingle<T>
Subscribes to the other source if the main source is empty.
|
class |
MaybeToSingle<T>
Wraps a MaybeSource and exposes its onSuccess and onError signals and signals
NoSuchElementException for onComplete.
|
Modifier and Type | Class and Description |
---|---|
class |
ObservableAllSingle<T> |
class |
ObservableAnySingle<T> |
class |
ObservableCollectSingle<T,U> |
class |
ObservableCountSingle<T> |
class |
ObservableElementAtSingle<T> |
class |
ObservableLastSingle<T>
Consumes the source ObservableSource and emits its last item, the defaultItem
if empty or a NoSuchElementException if even the defaultItem is null.
|
class |
ObservableReduceSeedSingle<T,R>
Reduce a sequence of values, starting from a seed value and by using
an accumulator function and return the last accumulated value.
|
class |
ObservableReduceWithSingle<T,R>
Reduce a sequence of values, starting from a generated seed value and by using
an accumulator function and return the last accumulated value.
|
class |
ObservableSequenceEqualSingle<T> |
class |
ObservableSingleSingle<T> |
class |
ObservableToListSingle<T,U extends Collection<? super T>> |
Modifier and Type | Class and Description |
---|---|
class |
SingleAmb<T> |
class |
SingleCache<T> |
class |
SingleContains<T> |
class |
SingleCreate<T> |
class |
SingleDefer<T> |
class |
SingleDelay<T> |
class |
SingleDelayWithCompletable<T> |
class |
SingleDelayWithObservable<T,U> |
class |
SingleDelayWithPublisher<T,U> |
class |
SingleDelayWithSingle<T,U> |
class |
SingleDetach<T>
Breaks the references between the upstream and downstream when the Maybe terminates.
|
class |
SingleDoAfterSuccess<T>
Calls a consumer after pushing the current item to the downstream.
|
class |
SingleDoAfterTerminate<T>
Calls an action after pushing the current item or an error to the downstream.
|
class |
SingleDoFinally<T>
Execute an action after an onSuccess, onError or a dispose event.
|
class |
SingleDoOnDispose<T> |
class |
SingleDoOnError<T> |
class |
SingleDoOnEvent<T> |
class |
SingleDoOnSubscribe<T>
Calls a callback when the upstream calls onSubscribe with a disposable.
|
class |
SingleDoOnSuccess<T> |
class |
SingleEquals<T> |
class |
SingleError<T> |
class |
SingleFlatMap<T,R> |
class |
SingleFromCallable<T> |
class |
SingleFromPublisher<T> |
class |
SingleFromUnsafeSource<T> |
class |
SingleHide<T> |
class |
SingleJust<T> |
class |
SingleLift<T,R> |
class |
SingleMap<T,R> |
class |
SingleMaterialize<T>
Turn the signal types of a Single source into a single Notification of
equal kind.
|
class |
SingleNever |
class |
SingleObserveOn<T> |
class |
SingleOnErrorReturn<T> |
class |
SingleResumeNext<T> |
class |
SingleSubscribeOn<T> |
class |
SingleTakeUntil<T,U>
Signals the events of the source Single or signals a CancellationException if the
other Publisher signalled first.
|
class |
SingleTimeout<T> |
class |
SingleTimer
Signals a
0L after the specified delay. |
class |
SingleUnsubscribeOn<T>
Makes sure a dispose() call from downstream happens on the specified scheduler.
|
class |
SingleUsing<T,U> |
class |
SingleZipArray<T,R> |
class |
SingleZipIterable<T,R> |
Modifier and Type | Field and Description |
---|---|
static Single<Object> |
SingleNever.INSTANCE |
Constructor and Description |
---|
SingleDematerialize(Single<T> source,
Function<? super T,Notification<R>> selector) |
SingleMaterialize(Single<T> source) |
Modifier and Type | Method and Description |
---|---|
static <T> Single<T> |
RxJavaPlugins.onAssembly(Single<T> source)
Calls the associated hook function.
|
Modifier and Type | Method and Description |
---|---|
static Function<? super Single,? extends Single> |
RxJavaPlugins.getOnSingleAssembly()
Returns the current hook function.
|
static Function<? super Single,? extends Single> |
RxJavaPlugins.getOnSingleAssembly()
Returns the current hook function.
|
static BiFunction<? super Single,? super SingleObserver,? extends SingleObserver> |
RxJavaPlugins.getOnSingleSubscribe()
Returns the current hook function.
|
Modifier and Type | Method and Description |
---|---|
static <T> Single<T> |
RxJavaPlugins.onAssembly(Single<T> source)
Calls the associated hook function.
|
static <T> SingleObserver<? super T> |
RxJavaPlugins.onSubscribe(Single<T> source,
SingleObserver<? super T> observer)
Calls the associated hook function.
|
Modifier and Type | Method and Description |
---|---|
static void |
RxJavaPlugins.setOnSingleAssembly(Function<? super Single,? extends Single> onSingleAssembly)
Sets the specific hook function.
|
static void |
RxJavaPlugins.setOnSingleAssembly(Function<? super Single,? extends Single> onSingleAssembly)
Sets the specific hook function.
|
static void |
RxJavaPlugins.setOnSingleSubscribe(BiFunction<? super Single,? super SingleObserver,? extends SingleObserver> onSingleSubscribe)
Sets the specific hook function.
|
Modifier and Type | Class and Description |
---|---|
class |
SingleSubject<T>
Represents a hot Single-like source and consumer of events similar to Subjects.
|
Copyright © 2019. All rights reserved.