Class MaterializeSingleObserver<T>
- java.lang.Object
-
- io.reactivex.rxjava3.internal.operators.mixed.MaterializeSingleObserver<T>
-
- Type Parameters:
T- the element type of the source
- All Implemented Interfaces:
CompletableObserver,MaybeObserver<T>,SingleObserver<T>,Disposable
public final class MaterializeSingleObserver<T> extends java.lang.Object implements SingleObserver<T>, MaybeObserver<T>, CompletableObserver, Disposable
A consumer that implements the consumer types of Maybe, Single and Completable and turns their signals into Notifications for a SingleObserver.History: 2.2.4 - experimental
- Since:
- 3.0.0
-
-
Field Summary
Fields Modifier and Type Field Description (package private) SingleObserver<? super Notification<T>>downstream(package private) Disposableupstream
-
Constructor Summary
Constructors Constructor Description MaterializeSingleObserver(SingleObserver<? super Notification<T>> downstream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Dispose the resource, the operation should be idempotent.booleanisDisposed()Returns true if this resource has been disposed.voidonComplete()Called once the deferred computation completes normally.voidonError(java.lang.Throwable e)Notifies theSingleObserverthat theSinglehas experienced an error condition.voidonSubscribe(Disposable d)Provides theSingleObserverwith the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)itself) and asynchronous manner.voidonSuccess(T t)Notifies theSingleObserverwith a single item and that theSinglehas finished sending push-based notifications.
-
-
-
Field Detail
-
downstream
final SingleObserver<? super Notification<T>> downstream
-
upstream
Disposable upstream
-
-
Constructor Detail
-
MaterializeSingleObserver
public MaterializeSingleObserver(SingleObserver<? super Notification<T>> downstream)
-
-
Method Detail
-
onSubscribe
public void onSubscribe(Disposable d)
Description copied from interface:SingleObserverProvides theSingleObserverwith the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)itself) and asynchronous manner.- Specified by:
onSubscribein interfaceCompletableObserver- Specified by:
onSubscribein interfaceMaybeObserver<T>- Specified by:
onSubscribein interfaceSingleObserver<T>- Parameters:
d- the Disposable instance whoseDisposable.dispose()can be called anytime to cancel the connection
-
onComplete
public void onComplete()
Description copied from interface:MaybeObserverCalled once the deferred computation completes normally.- Specified by:
onCompletein interfaceCompletableObserver- Specified by:
onCompletein interfaceMaybeObserver<T>
-
onSuccess
public void onSuccess(T t)
Description copied from interface:SingleObserverNotifies theSingleObserverwith a single item and that theSinglehas finished sending push-based notifications.The
Singlewill not call this method if it callsSingleObserver.onError(java.lang.Throwable).- Specified by:
onSuccessin interfaceMaybeObserver<T>- Specified by:
onSuccessin interfaceSingleObserver<T>- Parameters:
t- the item emitted by theSingle
-
onError
public void onError(java.lang.Throwable e)
Description copied from interface:SingleObserverNotifies theSingleObserverthat theSinglehas experienced an error condition.If the
Singlecalls this method, it will not thereafter callSingleObserver.onSuccess(T).- Specified by:
onErrorin interfaceCompletableObserver- Specified by:
onErrorin interfaceMaybeObserver<T>- Specified by:
onErrorin interfaceSingleObserver<T>- Parameters:
e- the exception encountered by theSingle
-
isDisposed
public boolean isDisposed()
Description copied from interface:DisposableReturns true if this resource has been disposed.- Specified by:
isDisposedin interfaceDisposable- Returns:
- true if this resource has been disposed
-
dispose
public void dispose()
Description copied from interface:DisposableDispose the resource, the operation should be idempotent.- Specified by:
disposein interfaceDisposable
-
-