static
<T>
Single<T>
|
amb(Iterable<? extends SingleSource<? extends T>> sources)
Runs multiple Single sources and signals the events of the first one that signals (cancelling
the rest).
|
static
<T>
Single<T>
|
ambArray(SingleSource...<? extends T> sources)
Runs multiple Single sources and signals the events of the first one that signals (cancelling
the rest).
|
final
Single<T>
|
ambWith(SingleSource<? extends T> other)
Signals the event of this or the other SingleSource whichever signals first.
|
final
T
|
blockingGet()
Waits in a blocking fashion until the current Single signals a success value (which is returned) or
an exception (which is propagated).
|
final
Single<T>
|
cache()
Stores the success value or exception from the current Single and replays it to late SingleObservers.
|
final
<U>
Single<U>
|
cast(Class<? extends U> clazz)
Casts the success value of the current Single into the target type or signals a
ClassCastException if not compatible.
|
final
<R>
Single<R>
|
compose(SingleTransformer<? super T, ? extends R> transformer)
Transform a Single by applying a particular Transformer function to it.
|
static
<T>
Flowable<T>
|
concat(Publisher<? extends SingleSource<? extends T>> sources)
Concatenate the single values, in a non-overlapping fashion, of the Single sources provided by
a Publisher sequence.
|
static
<T>
Flowable<T>
|
concat(Publisher<? extends SingleSource<? extends T>> sources, int prefetch)
Concatenate the single values, in a non-overlapping fashion, of the Single sources provided by
a Publisher sequence and prefetched by the specified amount.
|
static
<T>
Flowable<T>
|
concat(SingleSource<? extends T> source1, SingleSource<? extends T> source2, SingleSource<? extends T> source3, SingleSource<? extends T> source4)
Returns a Flowable that emits the items emitted by four Singles, one after the other.
|
static
<T>
Observable<T>
|
concat(ObservableSource<? extends SingleSource<? extends T>> sources)
Concatenate the single values, in a non-overlapping fashion, of the Single sources provided by
an Observable sequence.
|
static
<T>
Flowable<T>
|
concat(SingleSource<? extends T> source1, SingleSource<? extends T> source2)
Returns a Flowable that emits the items emitted by two Singles, one after the other.
|
static
<T>
Flowable<T>
|
concat(SingleSource<? extends T> source1, SingleSource<? extends T> source2, SingleSource<? extends T> source3)
Returns a Flowable that emits the items emitted by three Singles, one after the other.
|
static
<T>
Flowable<T>
|
concat(Iterable<? extends SingleSource<? extends T>> sources)
Concatenate the single values, in a non-overlapping fashion, of the Single sources provided by
an Iterable sequence.
|
static
<T>
Flowable<T>
|
concatArray(SingleSource...<? extends T> sources)
Concatenate the single values, in a non-overlapping fashion, of the Single sources provided in
an array.
|
final
Flowable<T>
|
concatWith(SingleSource<? extends T> other)
Returns a Flowable that emits the item emitted by the source Single, then the item emitted by the
specified Single.
|
final
Single<Boolean>
|
contains(Object value)
Signals true if the current Single signals a success value that is Object-equals with the value
provided.
|
final
Single<Boolean>
|
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.
|
static
<T>
Single<T>
|
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>
|
defer(Callable<? extends SingleSource<? extends T>> singleSupplier)
Calls a Callable for each individual SingleObserver to return the actual Single source to
be subscribed to.
|
final
Single<T>
|
delay(long time, TimeUnit unit)
Delays the emission of the success or error signal from the current Single by
the specified amount.
|
final
Single<T>
|
delay(long time, TimeUnit unit, Scheduler scheduler)
Delays the emission of the success signal from the current Single by the specified amount.
|
final
<U>
Single<T>
|
delaySubscription(Publisher<U> other)
Delays the actual subscription to the current Single until the given other Publisher
signals its first value or completes.
|
final
<U>
Single<T>
|
delaySubscription(long time, TimeUnit unit, Scheduler scheduler)
Delays the actual subscription to the current Single until the given time delay elapsed.
|
final
<U>
Single<T>
|
delaySubscription(SingleSource<U> other)
Delays the actual subscription to the current Single until the given other SingleSource
signals success.
|
final
<U>
Single<T>
|
delaySubscription(long time, TimeUnit unit)
Delays the actual subscription to the current Single until the given time delay elapsed.
|
final
<U>
Single<T>
|
delaySubscription(ObservableSource<U> other)
Delays the actual subscription to the current Single until the given other ObservableSource
signals its first value or completes.
|
final
Single<T>
|
delaySubscription(CompletableSource other)
Delays the actual subscription to the current Single until the given other CompletableSource
completes.
|
final
Single<T>
|
doAfterSuccess(Consumer<? super T> onAfterSuccess)
Calls the specified consumer with the success item after this item has been emitted to the downstream.
|
final
Single<T>
|
doAfterTerminate(Action onAfterTerminate)
Registers an Action to be called after this Single invokes either onSuccess or onError.
|
final
Single<T>
|
doFinally(Action onFinally)
Calls the specified action after this Single signals onSuccess or onError or gets disposed by
the downstream.
|
final
Single<T>
|
doOnDispose(Action onDispose)
Calls the shared Action if a SingleObserver subscribed to the current Single
disposes the common Disposable it received via onSubscribe.
|
final
Single<T>
|
doOnError(Consumer<? super Throwable> onError)
Calls the shared consumer with the error sent via onError for each
SingleObserver that subscribes to the current Single.
|
final
Single<T>
|
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.
|
final
Single<T>
|
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.
|
final
Single<T>
|
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.
|
static
<T>
Single<Boolean>
|
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>
|
error(Throwable exception)
Returns a Single that invokes a subscriber's onError method when the
subscriber subscribes to it.
|
static
<T>
Single<T>
|
error(Callable<? extends Throwable> errorSupplier)
Signals a Throwable returned by the callback function for each individual SingleObserver.
|
final
Maybe<T>
|
filter(Predicate<? super T> predicate)
Filters the success item of the Single via a predicate function and emitting it if the predicate
returns true, completing otherwise.
|
final
<R>
Single<R>
|
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.
|
final
Completable
|
flatMapCompletable(Function<? super T, ? extends CompletableSource> mapper)
Returns a Completable that completes based on applying a specified function to the item emitted by the
source Single , where that function returns a Completable .
|
final
<R>
Maybe<R>
|
flatMapMaybe(Function<? super T, ? extends MaybeSource<? extends R>> mapper)
Returns a Maybe that is based on applying a specified function to the item emitted by the source Single,
where that function returns a MaybeSource.
|
final
<R>
Observable<R>
|
flatMapObservable(Function<? super T, ? extends ObservableSource<? extends R>> mapper)
Returns an Observable that is based on applying a specified function to the item emitted by the source Single,
where that function returns an ObservableSource.
|
final
<R>
Flowable<R>
|
flatMapPublisher(Function<? super T, ? extends Publisher<? extends R>> mapper)
Returns a Flowable that emits items based on applying a specified function to the item emitted by the
source Single, where that function returns a Publisher.
|
final
<U>
Flowable<U>
|
flattenAsFlowable(Function<? super T, ? extends Iterable<? extends U>> mapper)
Returns a Flowable that merges each item emitted by the source Single with the values in an
Iterable corresponding to that item that is generated by a selector.
|
final
<U>
Observable<U>
|
flattenAsObservable(Function<? super T, ? extends Iterable<? extends U>> mapper)
Returns an Observable that maps a success value into an Iterable and emits its items.
|
static
<T>
Single<T>
|
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>
|
fromFuture(Future<? extends T> future, Scheduler scheduler)
|
static
<T>
Single<T>
|
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>
|
fromFuture(Future<? extends T> future)
Converts a Future into a Single .
|
static
<T>
Single<T>
|
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>
|
fromObservable(ObservableSource<? extends T> observableSource)
Wraps a specific ObservableSource into a Single and signals its single element or error.
|
static
<T>
Single<T>
|
fromPublisher(Publisher<? extends T> publisher)
Wraps a specific Publisher into a Single and signals its single element or error.
|
final
Single<T>
|
hide()
Hides the identity of the current Single, including the Disposable that is sent
to the downstream via onSubscribe() .
|
static
<T>
Single<T>
|
just(T item)
Returns a Single that emits a specified item.
|
final
<R>
Single<R>
|
lift(SingleOperator<? extends R, ? super T> lift)
Lifts a function to the current Single and returns a new Single that when subscribed to will pass the
values of the current Single through the Operator function.
|
final
<R>
Single<R>
|
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.
|
static
<T>
Flowable<T>
|
merge(Iterable<? extends SingleSource<? extends T>> sources)
Merges an Iterable sequence of SingleSource instances into a single Flowable sequence,
running all SingleSources at once.
|
static
<T>
Flowable<T>
|
merge(SingleSource<? extends T> source1, SingleSource<? extends T> source2, SingleSource<? extends T> source3, SingleSource<? extends T> source4)
Flattens four Singles into a single Flowable, without any transformation.
|
static
<T>
Flowable<T>
|
merge(SingleSource<? extends T> source1, SingleSource<? extends T> source2)
Flattens two Singles into a single Flowable, without any transformation.
|
static
<T>
Flowable<T>
|
merge(SingleSource<? extends T> source1, SingleSource<? extends T> source2, SingleSource<? extends T> source3)
Flattens three Singles into a single Flowable, without any transformation.
|
static
<T>
Flowable<T>
|
merge(Publisher<? extends SingleSource<? extends T>> sources)
Merges a Flowable sequence of SingleSource instances into a single Flowable sequence,
running all SingleSources at once.
|
static
<T>
Single<T>
|
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.
|
final
Flowable<T>
|
mergeWith(SingleSource<? extends T> other)
Flattens this and another Single into a single Flowable, without any transformation.
|
static
<T>
Single<T>
|
never()
Returns a singleton instance of a never-signalling Single (only calls onSubscribe).
|
final
Single<T>
|
observeOn(Scheduler scheduler)
Modifies a Single to emit its item (or notify of its error) on a specified Scheduler ,
asynchronously.
|
final
Single<T>
|
onErrorResumeNext(Single<? extends T> resumeSingleInCaseOfError)
Instructs a Single to pass control to another Single rather than invoking
onError(Throwable) if it encounters an error.
|
final
Single<T>
|
onErrorResumeNext(Function<? super Throwable, ? extends SingleSource<? extends T>> resumeFunctionInCaseOfError)
Instructs a Single to pass control to another Single rather than invoking
onError(Throwable) if it encounters an error.
|
final
Single<T>
|
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.
|
final
Single<T>
|
onErrorReturnItem(T value)
Signals the specified value as success in case the current Single signals an error.
|
final
Flowable<T>
|
repeat()
Repeatedly re-subscribes to the current Single and emits each success value.
|
final
Flowable<T>
|
repeat(long times)
Re-subscribes to the current Single at most the given number of times and emits each success value.
|
final
Flowable<T>
|
repeatUntil(BooleanSupplier stop)
Re-subscribes to the current Single until the given BooleanSupplier returns true.
|
final
Flowable<T>
|
repeatWhen(Function<? super Flowable<Object>, ? extends Publisher<?>> handler)
Re-subscribes to the current Single if
the Publisher returned by the handler function signals a value in response to a
value signalled through the Flowable the handle receives.
|
final
Single<T>
|
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.
|
final
Single<T>
|
retry(Predicate<? super Throwable> predicate)
Re-subscribe to the current Single if the given predicate returns true when the Single fails
with an onError.
|
final
Single<T>
|
retry()
Repeatedly re-subscribes to the current Single indefinitely if it fails with an onError.
|
final
Single<T>
|
retry(long times)
Repeatedly re-subscribe at most the specified times to the current Single
if it fails with an onError.
|
final
Single<T>
|
retryWhen(Function<? super Flowable<Throwable>, ? extends Publisher<?>> handler)
Re-subscribes to the current Single if and when the Publisher returned by the handler
function signals a value.
|
final
Disposable
|
subscribe(Consumer<? super T> onSuccess)
Subscribes to a Single and provides a callback to handle the item it emits.
|
final
Disposable
|
subscribe(BiConsumer<? super T, ? super Throwable> onCallback)
Subscribes to a Single and provides a composite callback to handle the item it emits
or any error notification it issues.
|
final
void
|
subscribe(SingleObserver<? super T> subscriber)
Subscribes the given SingleObserver to this SingleSource instance.
|
final
Disposable
|
subscribe(Consumer<? super T> onSuccess, Consumer<? super Throwable> onError)
Subscribes to a Single and provides callbacks to handle the item it emits or any error notification it
issues.
|
final
Disposable
|
subscribe()
Subscribes to a Single but ignore its emission or notification.
|
abstract
void
|
subscribeActual(SingleObserver<? super T> observer)
Override this method in subclasses to handle the incoming SingleObservers.
|
final
Single<T>
|
subscribeOn(Scheduler scheduler)
Asynchronously subscribes subscribers to this Single on the specified Scheduler .
|
final
<E extends SingleObserver<? super T>>
E
|
subscribeWith(E observer)
Subscribes a given SingleObserver (subclass) to this Single and returns the given
SingleObserver as is.
|
final
<E>
Single<T>
|
takeUntil(SingleSource<? extends E> other)
Returns a Single that emits the item emitted by the source Single until a second Single emits an item.
|
final
<E>
Single<T>
|
takeUntil(Publisher<E> other)
Returns a Single that emits the item emitted by the source Single until a Publisher emits an item.
|
final
Single<T>
|
takeUntil(CompletableSource other)
Returns a Single that emits the item emitted by the source Single until a Completable terminates.
|
final
TestObserver<T>
|
test(boolean cancelled)
Creates a TestObserver optionally in cancelled state, then subscribes it to this Single.
|
final
TestObserver<T>
|
test()
Creates a TestObserver and subscribes
it to this Single.
|
final
Single<T>
|
timeout(long timeout, TimeUnit unit)
Signals a TimeoutException if the current Single doesn't signal a success value within the
specified timeout window.
|
final
Single<T>
|
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
cancelled and the other SingleSource subscribed to.
|
final
Single<T>
|
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
cancelled and the other SingleSource subscribed to.
|
final
Single<T>
|
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.
|
static
Single<Long>
|
timer(long delay, TimeUnit unit, Scheduler scheduler)
Signals success with 0L value after the given delay for each SingleObserver.
|
static
Single<Long>
|
timer(long delay, TimeUnit unit)
Signals success with 0L value after the given delay for each SingleObserver.
|
final
<R>
R
|
to(Function<? super Single<T>, R> convert)
Calls the specified converter function with the current Single instance
during assembly time and returns its result.
|
final
Completable
|
toCompletable()
Returns a Completable that discards result of the Single
and calls onComplete when this source Single calls
onSuccess .
|
final
Flowable<T>
|
toFlowable()
|
final
Future<T>
|
toFuture()
Returns a Future representing the single value emitted by this Single .
|
final
Maybe<T>
|
toMaybe()
Converts this Single into a Maybe .
|
final
Observable<T>
|
toObservable()
|
static
<T>
Single<T>
|
unsafeCreate(SingleSource<T> onSubscribe)
Advanced use only: creates a Single instance without
any safeguards by using a callback that is called with a SingleObserver.
|
final
Single<T>
|
unsubscribeOn(Scheduler scheduler)
Returns a Single which makes sure when a SingleObserver disposes the Disposable,
that call is propagated up on the specified scheduler
- Scheduler:
unsubscribeOn calls dispose() of the upstream on the Scheduler you specify.
|
static
<T, U>
Single<T>
|
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, U>
Single<T>
|
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>
Single<T>
|
wrap(SingleSource<T> source)
Wraps a SingleSource instance into a new Single instance if not already a Single
instance.
|
static
<T1, T2, T3, T4, T5, R>
Single<R>
|
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, T7, T8, R>
Single<R>
|
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, R>
Single<R>
|
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, R>
Single<R>
|
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, T6, T7, T8, T9, R>
Single<R>
|
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
<T1, T2, T3, R>
Single<R>
|
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, R>
Single<R>
|
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, T4, T5, T6, R>
Single<R>
|
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
<T, R>
Single<R>
|
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
<T, R>
Single<R>
|
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.
|
final
<U, R>
Single<R>
|
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.
|