T
- the element type of the sourcepublic final class MaterializeSingleObserver<T> extends Object implements SingleObserver<T>, MaybeObserver<T>, CompletableObserver, Disposable
Constructor and Description |
---|
MaterializeSingleObserver(SingleObserver<? super Notification<T>> downstream) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Dispose the resource, the operation should be idempotent.
|
boolean |
isDisposed()
Returns true if this resource has been disposed.
|
void |
onComplete()
Called once the deferred computation completes normally.
|
void |
onError(Throwable e)
Notifies the SingleObserver that the
Single has experienced an error condition. |
void |
onSubscribe(Disposable d)
Provides the SingleObserver with the means of cancelling (disposing) the
connection (channel) with the Single in both
synchronous (from within
onSubscribe(Disposable) itself) and asynchronous manner. |
void |
onSuccess(T t)
Notifies the SingleObserver with a single item and that the
Single has finished sending
push-based notifications. |
public MaterializeSingleObserver(SingleObserver<? super Notification<T>> downstream)
public void onSubscribe(Disposable d)
SingleObserver
onSubscribe(Disposable)
itself) and asynchronous manner.onSubscribe
in interface CompletableObserver
onSubscribe
in interface MaybeObserver<T>
onSubscribe
in interface SingleObserver<T>
d
- the Disposable instance whose Disposable.dispose()
can
be called anytime to cancel the connectionpublic void onComplete()
MaybeObserver
onComplete
in interface CompletableObserver
onComplete
in interface MaybeObserver<T>
public void onSuccess(T t)
SingleObserver
Single
has finished sending
push-based notifications.
The Single
will not call this method if it calls SingleObserver.onError(java.lang.Throwable)
.
onSuccess
in interface MaybeObserver<T>
onSuccess
in interface SingleObserver<T>
t
- the item emitted by the Singlepublic void onError(Throwable e)
SingleObserver
Single
has experienced an error condition.
If the Single
calls this method, it will not thereafter call SingleObserver.onSuccess(T)
.
onError
in interface CompletableObserver
onError
in interface MaybeObserver<T>
onError
in interface SingleObserver<T>
e
- the exception encountered by the Singlepublic boolean isDisposed()
Disposable
isDisposed
in interface Disposable
public void dispose()
Disposable
dispose
in interface Disposable
Copyright © 2019. All rights reserved.