Top Description Constructors Methods
io.reactivex

public abstract Class Single<T>

extends Object
implements SingleSource<T>
Class Inheritance
All Implemented Interfaces
io.reactivex.SingleSource
Known Direct Subclasses
io.reactivex.internal.operators.completable.CompletableMaterialize, io.reactivex.internal.operators.completable.CompletableToSingle, io.reactivex.internal.operators.flowable.FlowableAllSingle, io.reactivex.internal.operators.flowable.FlowableAnySingle, io.reactivex.internal.operators.flowable.FlowableCollectSingle, io.reactivex.internal.operators.flowable.FlowableLastSingle, io.reactivex.internal.operators.flowable.FlowableSequenceEqualSingle, io.reactivex.internal.operators.flowable.FlowableSingleSingle, io.reactivex.internal.operators.flowable.FlowableCountSingle, io.reactivex.internal.operators.flowable.FlowableElementAtSingle, io.reactivex.internal.operators.flowable.FlowableToListSingle, io.reactivex.internal.operators.flowable.FlowableReduceSeedSingle, io.reactivex.internal.operators.flowable.FlowableReduceWithSingle, io.reactivex.internal.operators.maybe.MaybeContains, io.reactivex.internal.operators.maybe.MaybeCount, io.reactivex.internal.operators.maybe.MaybeIsEmptySingle, io.reactivex.internal.operators.maybe.MaybeMaterialize, io.reactivex.internal.operators.maybe.MaybeEqualSingle, io.reactivex.internal.operators.maybe.MaybeFlatMapSingle, io.reactivex.internal.operators.maybe.MaybeSwitchIfEmptySingle, io.reactivex.internal.operators.maybe.MaybeToSingle, io.reactivex.internal.operators.observable.ObservableAllSingle, io.reactivex.internal.operators.observable.ObservableAnySingle, io.reactivex.internal.operators.observable.ObservableReduceSeedSingle, io.reactivex.internal.operators.observable.ObservableReduceWithSingle, io.reactivex.internal.operators.observable.ObservableSequenceEqualSingle, io.reactivex.internal.operators.observable.ObservableSingleSingle, io.reactivex.internal.operators.observable.ObservableToListSingle, io.reactivex.internal.operators.observable.ObservableElementAtSingle, io.reactivex.internal.operators.observable.ObservableLastSingle, io.reactivex.internal.operators.observable.ObservableCollectSingle, io.reactivex.internal.operators.observable.ObservableCountSingle, io.reactivex.internal.operators.single.SingleAmb, io.reactivex.internal.operators.single.SingleCache, io.reactivex.internal.operators.single.SingleContains, io.reactivex.internal.operators.single.SingleCreate, io.reactivex.internal.operators.single.SingleDefer, io.reactivex.internal.operators.single.SingleDelay, io.reactivex.internal.operators.single.SingleDelayWithCompletable, io.reactivex.internal.operators.single.SingleDelayWithObservable, io.reactivex.internal.operators.single.SingleDelayWithPublisher, io.reactivex.internal.operators.single.SingleDelayWithSingle, io.reactivex.internal.operators.single.SingleDetach, io.reactivex.internal.operators.single.SingleDoAfterSuccess, io.reactivex.internal.operators.single.SingleDoAfterTerminate, io.reactivex.internal.operators.single.SingleDoFinally, io.reactivex.internal.operators.single.SingleDoOnDispose, io.reactivex.internal.operators.single.SingleDoOnError, io.reactivex.internal.operators.single.SingleDoOnEvent, io.reactivex.internal.operators.single.SingleDoOnSubscribe, io.reactivex.internal.operators.single.SingleDoOnSuccess, io.reactivex.internal.operators.single.SingleDoOnTerminate, io.reactivex.internal.operators.single.SingleEquals, io.reactivex.internal.operators.single.SingleError, io.reactivex.internal.operators.single.SingleFlatMap, io.reactivex.internal.operators.single.SingleFromCallable, io.reactivex.internal.operators.single.SingleFromPublisher, io.reactivex.internal.operators.single.SingleFromUnsafeSource, io.reactivex.internal.operators.single.SingleHide, io.reactivex.internal.operators.single.SingleJust, io.reactivex.internal.operators.single.SingleLift, io.reactivex.internal.operators.single.SingleMap, io.reactivex.internal.operators.single.SingleMaterialize, io.reactivex.internal.operators.single.SingleNever, io.reactivex.internal.operators.single.SingleObserveOn, io.reactivex.internal.operators.single.SingleOnErrorReturn, io.reactivex.internal.operators.single.SingleResumeNext, io.reactivex.internal.operators.single.SingleSubscribeOn, io.reactivex.internal.operators.single.SingleTakeUntil, io.reactivex.internal.operators.single.SingleTimeout, io.reactivex.internal.operators.single.SingleTimer, io.reactivex.internal.operators.single.SingleUnsubscribeOn, io.reactivex.internal.operators.single.SingleUsing, io.reactivex.internal.operators.single.SingleZipArray, io.reactivex.internal.operators.single.SingleZipIterable, io.reactivex.subjects.SingleSubject
Type Parameters
<T>
the type of the item emitted by the Single
Imports
java.util.NoSuchElementException, java.util.concurrent.*, org.reactivestreams.Publisher, io.reactivex.annotations.*, io.reactivex.disposables.Disposable, io.reactivex.exceptions.Exceptions, io.reactivex.functions.*, io.reactivex.internal.functions.*, io.reactivex.internal.fuseable.*, io.reactivex.internal.observers.*, io.reactivex.internal.operators.completable.*, io.reactivex.internal.operators.flowable.*, io.reactivex.internal.operators.maybe.*, io.reactivex.internal.operators.mixed.*, io.reactivex.internal.operators.observable.*, io.reactivex.internal.operators.single.*, io.reactivex.internal.util.*, io.reactivex.observers.TestObserver, io.reactivex.plugins.RxJavaPlugins, io.reactivex.schedulers.Schedulers

The Single class implements the Reactive Pattern for a single value response.

Single behaves similarly to Observable except that it can only emit either a single successful value or an error (there is no "onComplete" notification as there is for an Observable).

The Single class implements the SingleSource base interface and the default consumer type it interacts with is the SingleObserver via the subscribe(SingleObserver) method.

The Single operates with the following sequential protocol:

    onSubscribe (onSuccess | onError)?

Note that onSuccess and onError are mutually exclusive events; unlike Observable, onSuccess is never followed by onError.

Like Observable, a running Single can be stopped through the Disposable instance provided to consumers through SingleObserver#onSubscribe.

Like an Observable, a Single is lazy, can be either "hot" or "cold", synchronous or asynchronous. Single instances returned by the methods of this class are cold and there is a standard hot implementation in the form of a subject: SingleSubject.

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

See Flowable or Observable for the implementation of the Reactive Pattern for a stream or vector of values.

For more information see the ReactiveX documentation.

Example:


Disposable d = Single.just("Hello World")
   .delay(10, TimeUnit.SECONDS, Schedulers.io())
   .subscribeWith(new DisposableSingleObserver<String>() {
       @Override
       public void onStart() {
           System.out.println("Started");
       }

       @Override
       public void onSuccess(String value) {
           System.out.println("Success: " + value);
       }

       @Override
       public void onError(Throwable error) {
           error.printStackTrace();
       }
   });

Thread.sleep(5000);

d.dispose();

Note that by design, subscriptions via subscribe(SingleObserver) can't be disposed from the outside (hence the void return of the subscribe(SingleObserver) method) and it is the responsibility of the implementor of the SingleObserver to allow this to happen. RxJava supports such usage with the standard DisposableSingleObserver instance. For convenience, the subscribeWith(SingleObserver) method is provided as well to allow working with a SingleObserver (or subclass) instance to be applied with in a fluent manner (such as in the example above).

Since
2.0
See Also
io.reactivex.observers.DisposableSingleObserver

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <
the value type
T
>
Single<T>

Returns:

the new Single instance
amb
(final Iterable<? extends SingleSource<? extends T>>
the Iterable sequence of sources. A subscription to each source will occur in the same order as in this Iterable.
sources
)

Runs multiple SingleSources and signals the events of the first one that signals (disposing the rest).

public static <
the value type
T
>
Single<T>

Returns:

the new Single instance
ambArray
(final SingleSource<? extends T>...
the array of sources. A subscription to each source will occur in the same order as in this array.
sources
)

Runs multiple SingleSources and signals the events of the first one that signals (disposing the rest).

public final Single<T>

Returns:

the new Single instance. A subscription to this provided source will occur after subscribing to the current source.
ambWith
(SingleSource<? extends T>
the other SingleSource to race for the first emission of success or error
other
)

Signals the event of this or the other SingleSource whichever signals first.

public final <
the resulting object type
R
>
R

Returns:

the converted value
as
(SingleConverter<T, ? extends R>
the function that receives the current Single instance and returns a value
converter
)

Calls the specified converter function during assembly time and returns its resulting value.

public final T

Returns:

the success value
blockingGet
()

Waits in a blocking fashion until the current Single signals a success value (which is returned) or an exception (which is propagated).

public final Single<T>

Returns:

the new Single instance
cache
()

Stores the success value or exception from the current Single and replays it to late SingleObservers.

public final <
the target type
U
>
Single<U>

Returns:

the new Single instance
cast
(final Class<? extends U>
the type token to use for casting the success result from the current Single
clazz
)

Casts the success value of the current Single into the target type or signals a ClassCastException if not compatible.

public final <
the value type of the single returned by the transformer function
R
>
Single<R>

Returns:

the source Single, transformed by the transformer function
compose
(SingleTransformer<? super T, ? extends R>
the transformer function, not null
transformer
)

Transform a Single by applying a particular Transformer function to it.

public static <
the value type
T
>
Flowable<T>

Returns:

the new Flowable instance
concat
(Iterable<? extends SingleSource<? extends T>>
the Iterable sequence of SingleSource instances
sources
)

Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided by an Iterable sequence.

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

Returns:

the new Observable instance
concat
(ObservableSource<? extends SingleSource<? extends T>>
the ObservableSource of SingleSource instances
sources
)

Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided by an Observable sequence.

public static <
the value type
T
>
Flowable<T>

Returns:

the new Flowable instance
concat
(Publisher<? extends SingleSource<? extends T>>
the Publisher of SingleSource instances
sources
)

Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided by a Publisher sequence.

public static <
the value type
T
>
Flowable<T>

Returns:

the new Flowable instance
concat
(Publisher<? extends SingleSource<? extends T>>
the Publisher of SingleSource instances
sources
,
int
the number of SingleSources to prefetch from the Publisher
prefetch
)

Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided by a Publisher sequence and prefetched by the specified amount.

public static <
the common value type
T
>
Flowable<T>

Returns:

a Flowable that emits items emitted by the two source Singles, one after the other.
concat
(SingleSource<? extends T>
a Single to be concatenated
source1
,
SingleSource<? extends T>
a Single to be concatenated
source2
)

Returns a Flowable that emits the items emitted by two Singles, one after the other.

public static <
the common value type
T
>
Flowable<T>

Returns:

a Flowable that emits items emitted by the three source Singles, one after the other.
concat
(SingleSource<? extends T>
a Single to be concatenated
source1
,
SingleSource<? extends T>
a Single to be concatenated
source2
,
SingleSource<? extends T>
a Single to be concatenated
source3
)

Returns a Flowable that emits the items emitted by three Singles, one after the other.

public static <
the common value type
T
>
Flowable<T>

Returns:

a Flowable that emits items emitted by the four source Singles, one after the other.
concat
(SingleSource<? extends T>
a Single to be concatenated
source1
,
SingleSource<? extends T>
a Single to be concatenated
source2
,
SingleSource<? extends T>
a Single to be concatenated
source3
,
SingleSource<? extends T>
a Single to be concatenated
source4
)

Returns a Flowable that emits the items emitted by four Singles, one after the other.

public static <
the value type
T
>
Flowable<T>

Returns:

the new Flowable instance
concatArray
(SingleSource<? extends T>...
the array of SingleSource instances
sources
)

Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided in an array.

public static <
the value type
T
>
Flowable<T>

Returns:

the new Flowable instance with the specified concatenation behavior
concatArrayEager
(SingleSource<? extends T>...
a sequence of Single that need to be eagerly concatenated
sources
)

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

public static <
the value type
T
>
Flowable<T>

Returns:

the new Publisher instance with the specified concatenation behavior
concatEager
(Publisher<? extends SingleSource<? extends T>>
a sequence of Publishers that need to be eagerly concatenated
sources
)

Concatenates a Publisher sequence of SingleSources eagerly into a single stream of values.

public static <
the value type
T
>
Flowable<T>

Returns:

the new Flowable instance with the specified concatenation behavior
concatEager
(Iterable<? extends SingleSource<? extends T>>
a sequence of SingleSource that need to be eagerly concatenated
sources
)

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

public final Flowable<T>

Returns:

a Flowable that emits the item emitted by the source Single, followed by the item emitted by t1
concatWith
(SingleSource<? extends T>
a Single to be concatenated after the current
other
)

Returns a Flowable that emits the item emitted by the source Single, then the item emitted by the specified Single.

public final Single<Boolean>

Returns:

the new Single instance
contains
(Object
the value to compare against the success value of this Single
value
)

Signals true if the current Single signals a success value that is Object-equals with the value provided.

public final Single<Boolean>

Returns:

the new Single instance
contains
(final Object
the value to compare against the success value of this Single
value
,
final BiPredicate<Object, Object>
the function that receives the success value of this Single, the value provided and should return true if they are considered equal
comparer
)

Signals true if the current Single signals a success value that is equal with the value provided by calling a bi-predicate.

public static <
the value type
T
>
Single<T>

Returns:

the new Single instance
create
(SingleOnSubscribe<T>
the emitter that is called when a SingleObserver subscribes to the returned Single
source
)

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

public static <
the value type
T
>
Single<T>

Returns:

the new Single instance
defer
(final Callable<? extends SingleSource<? extends T>>
the Callable that is called for each individual SingleObserver and returns a SingleSource instance to subscribe to
singleSupplier
)

Calls a Callable for each individual SingleObserver to return the actual SingleSource to be subscribed to.

public final Single<T>

Returns:

the new Single instance
delay
(long
the amount of time the success signal should be delayed for
time
,
TimeUnit
the time unit
unit
)

Delays the emission of the success signal from the current Single by the specified amount.

public final Single<T>

Returns:

the new Single instance
delay
(long
the amount of time the success or error signal should be delayed for
time
,
TimeUnit
the time unit
unit
,
boolean
if true, both success and error signals are delayed. if false, only success signals are delayed.
delayError
)

Delays the emission of the success or error signal from the current Single by the specified amount.

public final Single<T>

Returns:

the new Single instance
delay
(final long
the amount of time the success signal should be delayed for
time
,
final TimeUnit
the time unit
unit
,
final Scheduler
the target scheduler to use for the non-blocking wait and emission
scheduler
)

Delays the emission of the success signal from the current Single by the specified amount.

public final Single<T>

Returns:

the new Single instance
delay
(final long
the amount of time the success or error signal should be delayed for
time
,
final TimeUnit
the time unit
unit
,
final Scheduler
the target scheduler to use for the non-blocking wait and emission
scheduler
,
boolean
if true, both success and error signals are delayed. if false, only success signals are delayed.
delayError
)

Delays the emission of the success or error signal from the current Single by the specified amount.

public final Single<T>

Returns:

the new Single instance
delaySubscription
(CompletableSource
the CompletableSource that has to complete before the subscription to the current Single happens
other
)

Delays the actual subscription to the current Single until the given other CompletableSource completes.

public final <
the element type of the other source
U
>
Single<T>

Returns:

the new Single instance
delaySubscription
(SingleSource<U>
the SingleSource that has to complete before the subscription to the current Single happens
other
)

Delays the actual subscription to the current Single until the given other SingleSource signals success.

public final <
the element type of the other source
U
>
Single<T>

Returns:

the new Single instance
delaySubscription
(ObservableSource<U>
the ObservableSource that has to signal a value or complete before the subscription to the current Single happens
other
)

Delays the actual subscription to the current Single until the given other ObservableSource signals its first value or completes.

public final <
the element type of the other source
U
>
Single<T>

Returns:

the new Single instance
delaySubscription
(Publisher<U>
the Publisher that has to signal a value or complete before the subscription to the current Single happens
other
)

Delays the actual subscription to the current Single until the given other Publisher signals its first value or completes.

public final Single<T>

Returns:

the new Single instance
delaySubscription
(long
the time amount to wait with the subscription
time
,
TimeUnit
the time unit of the waiting
unit
)

Delays the actual subscription to the current Single until the given time delay elapsed.

public final Single<T>

Returns:

the new Single instance
delaySubscription
(long
the time amount to wait with the subscription
time
,
TimeUnit
the time unit of the waiting
unit
,
Scheduler
the scheduler to wait on and subscribe on to the current Single
scheduler
)

Delays the actual subscription to the current Single until the given time delay elapsed.

public final <
the result type
R
>
Maybe<R>

Returns:

the new Maybe instance
dematerialize
(Function<? super T, Notification<R>>
the function called with the success item and should return a Notification instance.
selector
)

Maps the Notification success value of this Single back into normal onSuccess, onError or onComplete signals as a Maybe source.

public final Single<T>

Returns:

the new Single instance
doAfterSuccess
(Consumer<? super T>
the Consumer that will be called after emitting an item from upstream to the downstream
onAfterSuccess
)

Calls the specified consumer with the success item after this item has been emitted to the downstream.

public final Single<T>

Returns:

a Single that emits the same items as the source Single, then invokes the Action
doAfterTerminate
(Action
an Action to be invoked when the source Single finishes
onAfterTerminate
)

Registers an Action to be called after this Single invokes either onSuccess or onError.

public final Single<T>

Returns:

the new Single instance
doFinally
(Action
the action called when this Single terminates or gets disposed
onFinally
)

Calls the specified action after this Single signals onSuccess or onError or gets disposed by the downstream.

public final Single<T>

Returns:

the new Single instance
doOnDispose
(final Action
the action called when the subscription is disposed
onDispose
)

Calls the shared Action if a SingleObserver subscribed to the current Single disposes the common Disposable it received via onSubscribe.

public final Single<T>

Returns:

the new Single instance
doOnError
(final Consumer<? super Throwable>
the consumer called with the success value of onError
onError
)

Calls the shared consumer with the error sent via onError for each SingleObserver that subscribes to the current Single.

public final Single<T>

Returns:

the new Single instance
doOnEvent
(final BiConsumer<? super T, ? super Throwable>
the consumer called with the success value of onEvent
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.

public final Single<T>

Returns:

the new Single instance
doOnSubscribe
(final Consumer<? super Disposable>
the consumer called with the Disposable sent via onSubscribe
onSubscribe
)

Calls the shared consumer with the Disposable sent through the onSubscribe for each SingleObserver that subscribes to the current Single.

public final Single<T>

Returns:

the new Single instance
doOnSuccess
(final Consumer<? super T>
the consumer called with the success value of onSuccess
onSuccess
)

Calls the shared consumer with the success value sent via onSuccess for each SingleObserver that subscribes to the current Single.

public final Single<T>

Returns:

the new Single instance
doOnTerminate
(final Action
the action to invoke when the consumer calls onSuccess or onError
onTerminate
)

Returns a Single instance that calls the given onTerminate callback just before this Single completes normally or with an exception.

public static <
the common value type
T
>
Single<Boolean>

Returns:

the new Single instance
equals
(final SingleSource<? extends T>
the first SingleSource instance
first
,
final SingleSource<? extends T>
the second SingleSource instance
second
)

Compares two SingleSources and emits true if they emit the same value (compared via Object.equals).

public static <
the value type
T
>
Single<T>

Returns:

the new Single instance
error
(final Callable<? extends Throwable>
the callable that is called for each individual SingleObserver and returns a Throwable instance to be emitted.
errorSupplier
)

Signals a Throwable returned by the callback function for each individual SingleObserver.

public static <
the type of the item (ostensibly) emitted by the Single
T
>
Single<T>

Returns:

a Single that invokes the subscriber's onError method when the subscriber subscribes to it
error
(final Throwable
the particular Throwable to pass to onError
exception
)

Returns a Single that invokes a subscriber's onError method when the subscriber subscribes to it.

public final Maybe<T>

Returns:

a Maybe that emit the item emitted by the source Maybe that the filter evaluates as true
filter
(Predicate<? super T>
a function that evaluates the item emitted by the source Maybe, returning true if it passes the filter
predicate
)

Filters the success item of the Single via a predicate function and emitting it if the predicate returns true, completing otherwise.

public final <
the result value type
R
>
Single<R>

Returns:

the Single returned from mapper when applied to the item emitted by the source Single
flatMap
(Function<? super T, ? extends SingleSource<? extends R>>
a function that, when applied to the item emitted by the source Single, returns a SingleSource
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.

public final Completable

Returns:

the Completable returned from func when applied to the item emitted by the source Single
flatMapCompletable
(final Function<? super T, ? extends CompletableSource>
a function that, when applied to the item emitted by the source Single, returns a Completable
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.

public final <
the result value type
R
>
Maybe<R>

Returns:

the Maybe returned from mapper when applied to the item emitted by the source Single
flatMapMaybe
(final Function<? super T, ? extends MaybeSource<? extends R>>
a function that, when applied to the item emitted by the source Single, returns a MaybeSource
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.

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

Returns:

the Observable returned from func when applied to the item emitted by the source Single
flatMapObservable
(Function<? super T, ? extends ObservableSource<? extends R>>
a function that, when applied to the item emitted by the source Single, returns an ObservableSource
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.

public final <
the result value type
R
>
Flowable<R>

Returns:

the Flowable returned from func when applied to the item emitted by the source Single
flatMapPublisher
(Function<? super T, ? extends Publisher<? extends R>>
a function that, when applied to the item emitted by the source Single, returns a Flowable
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.

public final <
the type of item emitted by the resulting Iterable
U
>
Flowable<U>

Returns:

the new Flowable instance
flattenAsFlowable
(final Function<? super T, ? extends Iterable<? extends U>>
a function that returns an Iterable sequence of values for when given an item emitted by the source Single
mapper
)

Maps the success value of the upstream Single into an Iterable and emits its items as a Flowable sequence.

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

Returns:

the new Observable instance
flattenAsObservable
(final Function<? super T, ? extends Iterable<? extends U>>
a function that returns an Iterable sequence of values for when given an item emitted by the source Single
mapper
)

Maps the success value of the upstream Single into an Iterable and emits its items as an Observable sequence.

public static <
the type of the item emitted by the Single.
T
>
Single<T>

Returns:

a Single whose SingleObservers' subscriptions trigger an invocation of the given function.
fromCallable
(final Callable<? extends T>
function which execution should be deferred, it will be invoked when SingleObserver will subscribe to the Single.
callable
)

Returns a Single that invokes passed function and emits its result for each new SingleObserver that subscribes.

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

Returns:

a Single that emits the item from the source Future
fromFuture
(Future<? extends T>
the source Future
future
)

Converts a Future into a Single.

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

Returns:

a Single that emits the item from the source Future
fromFuture
(Future<? extends T>
the source Future
future
,
long
the maximum time to wait before calling get
timeout
,
TimeUnit
the TimeUnit of the timeout argument
unit
)

Converts a Future into a Single, with a timeout on the Future.

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

Returns:

a Single that emits the item from the source Future
fromFuture
(Future<? extends T>
the source Future
future
,
long
the maximum time to wait before calling get
timeout
,
TimeUnit
the TimeUnit of the timeout argument
unit
,
Scheduler
the Scheduler to use for the blocking wait
scheduler
)

Converts a Future into a Single, with a timeout on the Future.

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

Returns:

a Single that emits the item from the source Future
fromFuture
(Future<? extends T>
the source Future
future
,
Scheduler
the Scheduler to wait for the Future on. Use a Scheduler such as Schedulers#io() that can block and wait on the Future
scheduler
)

Converts a Future, operating on a specified Scheduler, into a Single.

public static <
the type of the item emitted by the Single.
T
>
Single<T>

Returns:

the new Single instance
fromObservable
(ObservableSource<? extends T>
the source Observable, not null
observableSource
)

Wraps a specific ObservableSource into a Single and signals its single element or error.

public static <
the value type
T
>
Single<T>

Returns:

the new Single instance
fromPublisher
(final Publisher<? extends T>
the source Publisher instance, not null
publisher
)

Wraps a specific Publisher into a Single and signals its single element or error.

public final Single<T>

Returns:

the new Single instance
hide
()

Hides the identity of the current Single, including the Disposable that is sent to the downstream via onSubscribe().

public final Completable

Returns:

a Completable that calls onComplete on it's observer when the source Single calls onSuccess.
ignoreElement
()

Returns a Completable that ignores the success value of this Single and calls onComplete instead on the returned Completable.

public static <
the type of that item
T
>
Single<T>

Returns:

a Single that emits item
just
(final T
the item to emit
item
)

Returns a Single that emits a specified item.

public final <
the output value type
R
>
Single<R>

Returns:

the new Single instance
lift
(final SingleOperator<? extends R, ? super T>
the SingleOperator that receives the downstream's SingleObserver and should return a SingleObserver with custom behavior to be used as the consumer for the current Single.
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.

public final <
the result value type
R
>
Single<R>

Returns:

a Single that emits the item from the source Single, transformed by the specified function
map
(Function<? super T, ? extends R>
a function to apply to the item emitted by the Single
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.

public final Single<Notification<T>>

Returns:

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

public static <
the common and resulting value type
T
>
Flowable<T>

Returns:

the new Flowable instance
merge
(Iterable<? extends SingleSource<? extends T>>
the Iterable sequence of SingleSource sources
sources
)

Merges an Iterable sequence of SingleSource instances into a single Flowable sequence, running all SingleSources at once.

public static <
the common and resulting value type
T
>
Flowable<T>

Returns:

the new Flowable instance
merge
(Publisher<? extends SingleSource<? extends T>>
the Flowable sequence of SingleSource sources
sources
)

Merges a Flowable sequence of SingleSource instances into a single Flowable sequence, running all SingleSources at once.

public static <
the value type of the sources and the output
T
>
Single<T>

Returns:

a Single that emits the item that is the result of flattening the Single emitted by source
merge
(SingleSource<? extends SingleSource<? extends T>>
a Single that emits a Single
source
)

Flattens a Single that emits a Single into a single Single that emits the item emitted by the nested Single, without any transformation.

public static <
the common value type
T
>
Flowable<T>

Returns:

a Flowable that emits all of the items emitted by the source Singles
merge
(SingleSource<? extends T>
a SingleSource to be merged
source1
,
SingleSource<? extends T>
a SingleSource to be merged
source2
)

Flattens two Singles into a single Flowable, without any transformation.

public static <
the common value type
T
>
Flowable<T>

Returns:

a Flowable that emits all of the items emitted by the source Singles
merge
(SingleSource<? extends T>
a SingleSource to be merged
source1
,
SingleSource<? extends T>
a SingleSource to be merged
source2
,
SingleSource<? extends T>
a SingleSource to be merged
source3
)

Flattens three Singles into a single Flowable, without any transformation.

public static <
the common value type
T
>
Flowable<T>

Returns:

a Flowable that emits all of the items emitted by the source Singles
merge
(SingleSource<? extends T>
a SingleSource to be merged
source1
,
SingleSource<? extends T>
a SingleSource to be merged
source2
,
SingleSource<? extends T>
a SingleSource to be merged
source3
,
SingleSource<? extends T>
a SingleSource to be merged
source4
)

Flattens four Singles into a single Flowable, without any transformation.

public static <
the common and resulting value type
T
>
Flowable<T>

Returns:

the new Flowable instance
mergeDelayError
(Iterable<? extends SingleSource<? extends T>>
the Iterable sequence of SingleSource sources
sources
)

Merges an Iterable sequence of SingleSource instances into a single Flowable sequence, running all SingleSources at once and delaying any error(s) until all sources succeed or fail.

public static <
the common and resulting value type
T
>
Flowable<T>

Returns:

the new Flowable instance
mergeDelayError
(Publisher<? extends SingleSource<? extends T>>
the Flowable sequence of SingleSource sources
sources
)

Merges a Flowable sequence of SingleSource instances into a single Flowable sequence, running all SingleSources at once and delaying any error(s) until all sources succeed or fail.

public static <
the common value type
T
>
Flowable<T>

Returns:

a Flowable that emits all of the items emitted by the source Singles
mergeDelayError
(SingleSource<? extends T>
a SingleSource to be merged
source1
,
SingleSource<? extends T>
a SingleSource to be merged
source2
)

Flattens two Singles into a single Flowable, without any transformation, delaying any error(s) until all sources succeed or fail.

public static <
the common value type
T
>
Flowable<T>

Returns:

a Flowable that emits all of the items emitted by the source Singles
mergeDelayError
(SingleSource<? extends T>
a SingleSource to be merged
source1
,
SingleSource<? extends T>
a SingleSource to be merged
source2
,
SingleSource<? extends T>
a SingleSource to be merged
source3
)

Flattens three Singles into a single Flowable, without any transformation, delaying any error(s) until all sources succeed or fail.

public static <
the common value type
T
>
Flowable<T>

Returns:

a Flowable that emits all of the items emitted by the source Singles
mergeDelayError
(SingleSource<? extends T>
a SingleSource to be merged
source1
,
SingleSource<? extends T>
a SingleSource to be merged
source2
,
SingleSource<? extends T>
a SingleSource to be merged
source3
,
SingleSource<? extends T>
a SingleSource to be merged
source4
)

Flattens four Singles into a single Flowable, without any transformation, delaying any error(s) until all sources succeed or fail.

public final Flowable<T>

Returns:

that emits all of the items emitted by the source Singles
mergeWith
(SingleSource<? extends T>
a SingleSource to be merged
other
)

Flattens this and another Single into a single Flowable, without any transformation.

public static <
the target value type
T
>
Single<T>

Returns:

the singleton never instance
never
()

Returns a singleton instance of a never-signalling Single (only calls onSubscribe).

public final Single<T>

Returns:

the source Single modified so that its subscribers are notified on the specified Scheduler
observeOn
(final Scheduler
the Scheduler to notify subscribers on
scheduler
)

Modifies a Single to emit its item (or notify of its error) on a specified Scheduler, asynchronously.

public final Single<T>

Returns:

the original Single, with appropriately modified behavior.
onErrorResumeNext
(final Single<? extends T>
a Single that will take control if source Single encounters an error.
resumeSingleInCaseOfError
)

Instructs a Single to pass control to another Single rather than invoking SingleObserver#onError(Throwable) if it encounters an error.

public final Single<T>

Returns:

the original Single, with appropriately modified behavior.
onErrorResumeNext
(final Function<? super Throwable, ? extends SingleSource<? extends T>>
a function that returns a Single that will take control if source Single encounters an error.
resumeFunctionInCaseOfError
)

Instructs a Single to pass control to another Single rather than invoking SingleObserver#onError(Throwable) if it encounters an error.

public final Single<T>

Returns:

the original Single with appropriately modified behavior
onErrorReturn
(final Function<Throwable, ? extends T>
a function that returns an item that the new Single will emit if the source Single encounters an error
resumeFunction
)

Instructs a Single to emit an item (returned by a specified function) rather than invoking onError if it encounters an error.

public final Single<T>

Returns:

the new Single instance
onErrorReturnItem
(final T
the value to signal if the current Single fails
value
)

Signals the specified value as success in case the current Single signals an error.

public final Single<T>

Returns:

a Single which nulls out references to the upstream producer and downstream SingleObserver if the sequence is terminated or downstream calls dispose()
onTerminateDetach
()

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

public final Flowable<T>

Returns:

the new Flowable instance
repeat
()

Repeatedly re-subscribes to the current Single and emits each success value.

public final Flowable<T>

Returns:

the new Flowable instance
repeat
(long
the number of times to re-subscribe to the current Single
times
)

Re-subscribes to the current Single at most the given number of times and emits each success value.

public final Flowable<T>

Returns:

the new Flowable instance
repeatUntil
(BooleanSupplier
the BooleanSupplier called after the current Single succeeds and if returns false, the Single is re-subscribed; otherwise the sequence completes.
stop
)

Re-subscribes to the current Single until the given BooleanSupplier returns true.

public final Flowable<T>

Returns:

the new Flowable instance
repeatWhen
(Function<? super Flowable<Object>, ? extends Publisher<?>>
the function that is called with a Flowable that signals a value when the Single signalled a success value and returns a Publisher that has to signal a value to trigger a resubscription to the current Single, otherwise the terminal signal of the Publisher will be the terminal signal of the sequence as well.
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.

public final Single<T>

Returns:

the new Single instance
retry
()

Repeatedly re-subscribes to the current Single indefinitely if it fails with an onError.

public final Single<T>

Returns:

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

Repeatedly re-subscribe at most the specified times to the current Single if it fails with an onError.

public final Single<T>

Returns:

the new Single instance
retry
(BiPredicate<? super Integer, ? super Throwable>
the predicate called with the resubscription count and the failure Throwable and should return true if a resubscription should happen
predicate
)

Re-subscribe to the current Single if the given predicate returns true when the Single fails with an onError.

public final Single<T>

Returns:

the new Single instance
retry
(long
the number of times to resubscribe if the current Single fails
times
,
Predicate<? super Throwable>
the predicate called with the failure Throwable and should return true if a resubscription should happen
predicate
)

Repeatedly re-subscribe at most times or until the predicate returns false, whichever happens first if it fails with an onError.

public final Single<T>

Returns:

the new Single instance
retry
(Predicate<? super Throwable>
the predicate called with the failure Throwable and should return true if a resubscription should happen
predicate
)

Re-subscribe to the current Single if the given predicate returns true when the Single fails with an onError.

public final Single<T>

Returns:

the new Single instance
retryWhen
(Function<? super Flowable<Throwable>, ? extends Publisher<?>>
the function that receives a Flowable of the error the Single emits and should return a Publisher that should signal a normal value (in response to the throwable the Flowable emits) to trigger a resubscription or signal an error to be the output of the resulting Single
handler
)

Re-subscribes to the current Single if and when the Publisher returned by the handler function signals a value.

public final Disposable

Returns:

a Disposable reference can request the Single stop work.
subscribe
()

Subscribes to a Single but ignore its emission or notification.

public final Disposable

Returns:

a Disposable reference can request the Single stop work.
subscribe
(final BiConsumer<? super T, ? super Throwable>
the callback that receives either the success value or the failure Throwable (whichever is not null)
onCallback
)

Subscribes to a Single and provides a composite callback to handle the item it emits or any error notification it issues.

public final Disposable

Returns:

a Disposable reference can request the Single stop work.
subscribe
(Consumer<? super T>
the Consumer<T> you have designed to accept the emission from the Single
onSuccess
)

Subscribes to a Single and provides a callback to handle the item it emits.

public final Disposable

Returns:

a Disposable reference can request the Single stop work.
subscribe
(final Consumer<? super T>
the Consumer<T> you have designed to accept the emission from the Single
onSuccess
,
final Consumer<? super Throwable>
the Consumer<Throwable> you have designed to accept any error notification from the Single
onError
)

Subscribes to a Single and provides callbacks to handle the item it emits or any error notification it issues.

public final void
subscribe(SingleObserver<? super T>
the SingleObserver, not null
observer
)

Implements io.reactivex.SingleSource.subscribe.

Subscribes the given SingleObserver to this SingleSource instance.
protected abstract void
subscribeActual(SingleObserver<? super T>
the SingleObserver to handle, not null
observer
)

Implement this method in subclasses to handle the incoming SingleObservers.

public final Single<T>

Returns:

the source Single modified so that its subscriptions happen on the specified Scheduler
subscribeOn
(final Scheduler
the Scheduler to perform subscription actions on
scheduler
)

Asynchronously subscribes subscribers to this Single on the specified Scheduler.

public final <
the type of the SingleObserver to use and return
E extends SingleObserver<? super T>
>
E

Returns:

the input observer
subscribeWith
(E
the SingleObserver (subclass) to use and return, not null
observer
)

Subscribes a given SingleObserver (subclass) to this Single and returns the given SingleObserver as is.

public final Single<T>

Returns:

a Single that emits the item emitted by the source Single until such time as other terminates.
takeUntil
(final CompletableSource
the Completable whose termination will cause takeUntil to emit the item from the source Single
other
)

Returns a Single that emits the item emitted by the source Single until a Completable terminates.

public final <
the type of items emitted by other
E
>
Single<T>

Returns:

a Single that emits the item emitted by the source Single until such time as other emits its first item
takeUntil
(final Publisher<E>
the Publisher whose first emitted item will cause takeUntil to emit the item from the source Single
other
)

Returns a Single that emits the item emitted by the source Single until a Publisher emits an item.

public final <
the type of item emitted by other
E
>
Single<T>

Returns:

a Single that emits the item emitted by the source Single until such time as other emits its item
takeUntil
(final SingleSource<? extends E>
the Single whose emitted item will cause takeUntil to emit the item from the source Single
other
)

Returns a Single that emits the item emitted by the source Single until a second Single emits an item.

public final TestObserver<T>

Returns:

the new TestObserver instance
test
()

Creates a TestObserver and subscribes it to this Single.

public final TestObserver<T>

Returns:

the new TestObserver instance
test
(boolean
if true, the TestObserver will be cancelled before subscribing to this Single.
cancelled
)

Creates a TestObserver optionally in cancelled state, then subscribes it to this Single.

public final Single<T>

Returns:

the new Single instance
timeout
(long
the timeout amount
timeout
,
TimeUnit
the time unit
unit
)

Signals a TimeoutException if the current Single doesn't signal a success value within the specified timeout window.

public final Single<T>

Returns:

the new Single instance
timeout
(long
the timeout amount
timeout
,
TimeUnit
the time unit
unit
,
Scheduler
the target scheduler where the timeout is awaited and the TimeoutException signalled
scheduler
)

Signals a TimeoutException if the current Single doesn't signal a success value within the specified timeout window.

public final Single<T>

Returns:

the new Single instance
timeout
(long
the timeout amount
timeout
,
TimeUnit
the time unit
unit
,
Scheduler
the scheduler where the timeout is awaited and the subscription to other happens
scheduler
,
SingleSource<? extends T>
the other SingleSource that gets subscribed to if the current Single times out
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.

public final Single<T>

Returns:

the new Single instance
timeout
(long
the timeout amount
timeout
,
TimeUnit
the time unit
unit
,
SingleSource<? extends T>
the other SingleSource that gets subscribed to if the current Single times out
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.

private Single<T>
timeout0(final long timeout, final TimeUnit unit, final Scheduler scheduler, final SingleSource<? extends T> other)

public static Single<Long>

Returns:

the new Single instance
timer
(long
the delay amount
delay
,
TimeUnit
the time unit of the delay
unit
)

Signals success with 0L value after the given delay for each SingleObserver.

public static Single<Long>

Returns:

the new Single instance
timer
(final long
the delay amount
delay
,
final TimeUnit
the time unit of the delay
unit
,
final Scheduler
the scheduler where the single 0L will be emitted
scheduler
)

Signals success with 0L value after the given delay for each SingleObserver.

public final <
the result type
R
>
R

Returns:

the value returned by the convert function
to
(Function<? super Single<T>, R>
the function that is called with the current Single instance during assembly time that should return some value to be the result
convert
)

Calls the specified converter function with the current Single instance during assembly time and returns its result.

public final Completable

Returns:

a Completable that calls onComplete on it's subscriber when the source Single calls onSuccess.
toCompletable
()

Deprecated see ignoreElement() instead, will be removed in 3.0
Returns a Completable that discards result of the Single and calls onComplete when this source Single calls onSuccess.
public final Flowable<T>

Returns:

a Flowable that emits a single item T or an error.
toFlowable
()

Converts this Single into a Flowable.

public final Future<T>

Returns:

a Future that expects a single item to be emitted by this Single
toFuture
()

Returns a Future representing the single value emitted by this Single.

public final Maybe<T>

Returns:

a Maybe that emits a single item T or an error.
toMaybe
()

Converts this Single into a Maybe.

public final Observable<T>

Returns:

an Observable that emits a single item T or an error.
toObservable
()

Converts this Single into an Observable.

private static <T> Single<T>
toSingle(Flowable<T> source)

public static <
the value type
T
>
Single<T>

Returns:

the new Single instance
unsafeCreate
(SingleSource<T>
the function that is called with the subscribing SingleObserver
onSubscribe
)

Advanced use only: creates a Single instance without any safeguards by using a callback that is called with a SingleObserver.

public final Single<T>

Returns:

the new Single instance
unsubscribeOn
(final Scheduler
the target scheduler where to execute the disposal
scheduler
)

Returns a Single which makes sure when a SingleObserver disposes the Disposable, that call is propagated up on the specified scheduler.

public static <
the value type of the SingleSource generated
T
,
the resource type
U
>
Single<T>

Returns:

the new Single instance
using
(Callable<U>
the Callable called for each SingleObserver to generate a resource Object
resourceSupplier
,
Function<? super U, ? extends SingleSource<? extends T>>
the function called with the returned resource Object from resourceSupplier and should return a SingleSource instance to be run by the operator
singleFunction
,
Consumer<? super U>
the consumer of the generated resource that is called exactly once for that particular resource when the generated SingleSource terminates (successfully or with an error) or gets disposed.
disposer
)

Allows using and disposing a resource while running a SingleSource instance generated from that resource (similar to a try-with-resources).

public static <
the value type of the SingleSource generated
T
,
the resource type
U
>
Single<T>

Returns:

the new Single instance
using
(final Callable<U>
the Callable called for each SingleObserver to generate a resource Object
resourceSupplier
,
final Function<? super U, ? extends SingleSource<? extends T>>
the function called with the returned resource Object from resourceSupplier and should return a SingleSource instance to be run by the operator
singleFunction
,
final Consumer<? super U>
the consumer of the generated resource that is called exactly once for that particular resource when the generated SingleSource terminates (successfully or with an error) or gets disposed.
disposer
,
final boolean
if true, the disposer is called before the terminal event is signalled if false, the disposer is called after the terminal event is delivered to downstream
eager
)

Allows using and disposing a resource while running a SingleSource instance generated from that resource (similar to a try-with-resources).

public static <
the value type
T
>
Single<T>

Returns:

the Single wrapper or the source cast to Single (if possible)
wrap
(SingleSource<T>
the source to wrap
source
)

Wraps a SingleSource instance into a new Single instance if not already a Single instance.

public static <
the common value type
T
,
the result value type
R
>
Single<R>

Returns:

the new Single instance
zip
(final Iterable<? extends SingleSource<? extends T>>
the Iterable sequence of SingleSource instances. An empty sequence will result in an onError signal of NoSuchElementException.
sources
,
Function<? super Object[], ? extends R>
the function that receives an array with values from each SingleSource and should return a value to be emitted to downstream
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.

public static <
the first source Single's value type
T1
,
the second source Single's value type
T2
,
the result value type
R
>
Single<R>

Returns:

a Single that emits the zipped results
zip
(SingleSource<? extends T1>
the first source Single
source1
,
SingleSource<? extends T2>
a second source Single
source2
,
BiFunction<? super T1, ? super T2, ? extends R>
a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
zipper
)

Returns a Single that emits the results of a specified combiner function applied to two items emitted by two other Singles.

public static <
the first source Single's value type
T1
,
the second source Single's value type
T2
,
the third source Single's value type
T3
,
the result value type
R
>
Single<R>

Returns:

a Single that emits the zipped results
zip
(SingleSource<? extends T1>
the first source Single
source1
,
SingleSource<? extends T2>
a second source Single
source2
,
SingleSource<? extends T3>
a third source Single
source3
,
Function3<? super T1, ? super T2, ? super T3, ? extends R>
a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
zipper
)

Returns a Single that emits the results of a specified combiner function applied to three items emitted by three other Singles.

public static <
the first source Single's value type
T1
,
the second source Single's value type
T2
,
the third source Single's value type
T3
,
the fourth source Single's value type
T4
,
the result value type
R
>
Single<R>

Returns:

a Single that emits the zipped results
zip
(SingleSource<? extends T1>
the first source Single
source1
,
SingleSource<? extends T2>
a second source Single
source2
,
SingleSource<? extends T3>
a third source Single
source3
,
SingleSource<? extends T4>
a fourth source Single
source4
,
Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R>
a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
zipper
)

Returns a Single that emits the results of a specified combiner function applied to four items emitted by four other Singles.

public static <
the first source Single's value type
T1
,
the second source Single's value type
T2
,
the third source Single's value type
T3
,
the fourth source Single's value type
T4
,
the fifth source Single's value type
T5
,
the result value type
R
>
Single<R>

Returns:

a Single that emits the zipped results
zip
(SingleSource<? extends T1>
the first source Single
source1
,
SingleSource<? extends T2>
a second source Single
source2
,
SingleSource<? extends T3>
a third source Single
source3
,
SingleSource<? extends T4>
a fourth source Single
source4
,
SingleSource<? extends T5>
a fifth source Single
source5
,
Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R>
a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
zipper
)

Returns a Single that emits the results of a specified combiner function applied to five items emitted by five other Singles.

public static <
the first source Single's value type
T1
,
the second source Single's value type
T2
,
the third source Single's value type
T3
,
the fourth source Single's value type
T4
,
the fifth source Single's value type
T5
,
the sixth source Single's value type
T6
,
the result value type
R
>
Single<R>

Returns:

a Single that emits the zipped results
zip
(SingleSource<? extends T1>
the first source Single
source1
,
SingleSource<? extends T2>
a second source Single
source2
,
SingleSource<? extends T3>
a third source Single
source3
,
SingleSource<? extends T4>
a fourth source Single
source4
,
SingleSource<? extends T5>
a fifth source Single
source5
,
SingleSource<? extends T6>
a sixth source Single
source6
,
Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R>
a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
zipper
)

Returns a Single that emits the results of a specified combiner function applied to six items emitted by six other Singles.

public static <
the first source Single's value type
T1
,
the second source Single's value type
T2
,
the third source Single's value type
T3
,
the fourth source Single's value type
T4
,
the fifth source Single's value type
T5
,
the sixth source Single's value type
T6
,
the seventh source Single's value type
T7
,
the result value type
R
>
Single<R>

Returns:

a Single that emits the zipped results
zip
(SingleSource<? extends T1>
the first source Single
source1
,
SingleSource<? extends T2>
a second source Single
source2
,
SingleSource<? extends T3>
a third source Single
source3
,
SingleSource<? extends T4>
a fourth source Single
source4
,
SingleSource<? extends T5>
a fifth source Single
source5
,
SingleSource<? extends T6>
a sixth source Single
source6
,
SingleSource<? extends T7>
a seventh source Single
source7
,
Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R>
a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
zipper
)

Returns a Single that emits the results of a specified combiner function applied to seven items emitted by seven other Singles.

public static <
the first source Single's value type
T1
,
the second source Single's value type
T2
,
the third source Single's value type
T3
,
the fourth source Single's value type
T4
,
the fifth source Single's value type
T5
,
the sixth source Single's value type
T6
,
the seventh source Single's value type
T7
,
the eighth source Single's value type
T8
,
the result value type
R
>
Single<R>

Returns:

a Single that emits the zipped results
zip
(SingleSource<? extends T1>
the first source Single
source1
,
SingleSource<? extends T2>
a second source Single
source2
,
SingleSource<? extends T3>
a third source Single
source3
,
SingleSource<? extends T4>
a fourth source Single
source4
,
SingleSource<? extends T5>
a fifth source Single
source5
,
SingleSource<? extends T6>
a sixth source Single
source6
,
SingleSource<? extends T7>
a seventh source Single
source7
,
SingleSource<? extends T8>
an eighth source Single
source8
,
Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R>
a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
zipper
)

Returns a Single that emits the results of a specified combiner function applied to eight items emitted by eight other Singles.

public static <
the first source Single's value type
T1
,
the second source Single's value type
T2
,
the third source Single's value type
T3
,
the fourth source Single's value type
T4
,
the fifth source Single's value type
T5
,
the sixth source Single's value type
T6
,
the seventh source Single's value type
T7
,
the eighth source Single's value type
T8
,
the ninth source Single's value type
T9
,
the result value type
R
>
Single<R>

Returns:

a Single that emits the zipped results
zip
(SingleSource<? extends T1>
the first source Single
source1
,
SingleSource<? extends T2>
a second source Single
source2
,
SingleSource<? extends T3>
a third source Single
source3
,
SingleSource<? extends T4>
a fourth source Single
source4
,
SingleSource<? extends T5>
a fifth source Single
source5
,
SingleSource<? extends T6>
a sixth source Single
source6
,
SingleSource<? extends T7>
a seventh source Single
source7
,
SingleSource<? extends T8>
an eighth source Single
source8
,
SingleSource<? extends T9>
a ninth source Single
source9
,
Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends R>
a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
zipper
)

Returns a Single that emits the results of a specified combiner function applied to nine items emitted by nine other Singles.

public static <
the common value type
T
,
the result value type
R
>
Single<R>

Returns:

the new Single instance
zipArray
(Function<? super Object[], ? extends R>
the function that receives an array with values from each SingleSource and should return a value to be emitted to downstream
zipper
,
SingleSource<? extends T>...
the array of SingleSource instances. An empty sequence will result in an onError signal of NoSuchElementException.
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.

public final <
the type of items emitted by the other Single
U
,
the type of items emitted by the resulting Single
R
>
Single<R>

Returns:

a Single that pairs up values from the source Single and the other SingleSource and emits the results of zipFunction applied to these pairs
zipWith
(SingleSource<U>
the other SingleSource
other
,
BiFunction<? super T, ? super U, ? extends R>
a function that combines the pairs of items from the two SingleSources to generate the items to be emitted by the resulting Single
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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait