Top Description Fields Constructors Methods
io.reactivex.rxjava3.internal.observers

public final Class SafeSingleObserver<T>

extends Object
implements SingleObserver<T>
Class Inheritance
All Implemented Interfaces
io.reactivex.rxjava3.core.SingleObserver
Type Parameters
<T>
the element type of the sequence
Imports
io.reactivex.rxjava3.annotations.NonNull, io.reactivex.rxjava3.core.SingleObserver, io.reactivex.rxjava3.disposables.Disposable, io.reactivex.rxjava3.exceptions.*, io.reactivex.rxjava3.plugins.RxJavaPlugins

Wraps another SingleObserver and catches exceptions thrown by its onSubscribe, onSuccess or onError methods despite the protocol forbids it.

Such exceptions are routed to the RxJavaPlugins#onError(Throwable) handler.

Since
3.0.0

Field Summary

Modifier and TypeField and Description
pack-priv final SingleObserver<? super T>
pack-priv boolean

Constructor Summary

AccessConstructor and Description
public
SafeSingleObserver(SingleObserver<? super T> downstream)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
onSuccess(T
the item emitted by the Single
t
)

Implements io.reactivex.rxjava3.core.SingleObserver.onSuccess.

Notifies the SingleObserver with a single item and that the Single has finished sending push-based notifications.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

downstreamback to summary
pack-priv final SingleObserver<? super T> downstream
onSubscribeFailedback to summary
pack-priv boolean onSubscribeFailed

Constructor Detail

SafeSingleObserverback to summary
public SafeSingleObserver(SingleObserver<? super T> downstream)

Method Detail

onErrorback to summary
public void onError(@NonNull Throwable e)
Annotations
@Override
onSubscribeback to summary
public void onSubscribe(@NonNull Disposable d)
Annotations
@Override
onSuccessback to summary
public void onSuccess(T t)

Implements io.reactivex.rxjava3.core.SingleObserver.onSuccess.

Doc from io.reactivex.rxjava3.core.SingleObserver.onSuccess.

Notifies the SingleObserver with a single item and that the Single has finished sending push-based notifications.

The Single will not call this method if it calls onError.

Parameters
t:T

the item emitted by the Single

Annotations
@Override