public final class TerminalNotification
extends java.lang.Object
Throwable
.Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
cause()
Returns the cause of error if this is an error notification.
|
static TerminalNotification |
complete()
Returns a
TerminalNotification for completion. |
static TerminalNotification |
error(java.lang.Throwable cause)
Returns a
TerminalNotification for cause . |
void |
terminate(CompletableSource.Subscriber subscriber)
Invoke
CompletableSource.Subscriber.onComplete() or CompletableSource.Subscriber.onError(Throwable) on the passed subscriber . |
void |
terminate(CompletableSource.Subscriber subscriber,
java.lang.Throwable additionalCause)
Invoke
CompletableSource.Subscriber.onError(Throwable) with the passed Throwable if this
TerminalNotification is for completion. |
void |
terminate(PublisherSource.Subscriber<?> subscriber)
Invoke
PublisherSource.Subscriber#onComplete() or PublisherSource.Subscriber#onError(Throwable)
on the passed subscriber . |
void |
terminate(PublisherSource.Subscriber<?> subscriber,
java.lang.Throwable additionalCause)
Invoke
PublisherSource.Subscriber#onError(Throwable) with the passed Throwable if this
TerminalNotification is for completion. |
java.lang.String |
toString() |
public void terminate(PublisherSource.Subscriber<?> subscriber)
PublisherSource.Subscriber#onComplete()
or PublisherSource.Subscriber#onError(Throwable)
on the passed subscriber
.subscriber
- to terminate.public void terminate(PublisherSource.Subscriber<?> subscriber, java.lang.Throwable additionalCause)
PublisherSource.Subscriber#onError(Throwable)
with the passed Throwable
if this
TerminalNotification
is for completion.
If this TerminalNotification
is for error, then the passed Throwable
will be added as a
suppressed cause to the existing Throwable
.
If this is an error notification, the associated cause will get updated with the additionalCause
.
subscriber
- to terminate.additionalCause
- Throwable
which is used as the causpublic void terminate(CompletableSource.Subscriber subscriber, java.lang.Throwable additionalCause)
CompletableSource.Subscriber.onError(Throwable)
with the passed Throwable
if this
TerminalNotification
is for completion.
If this TerminalNotification
is for error, then the passed Throwable
will be added as a
suppressed cause to the existing Throwable
.
If this is an error notification, the associated cause will get updated with the additionalCause
.
subscriber
- to terminate.additionalCause
- Throwable
which is used as the causpublic void terminate(CompletableSource.Subscriber subscriber)
CompletableSource.Subscriber.onComplete()
or CompletableSource.Subscriber.onError(Throwable)
on the passed subscriber
.subscriber
- to terminate.@Nullable public java.lang.Throwable cause()
Throwable
if this is an error notification, otherwise null
.public static TerminalNotification error(java.lang.Throwable cause)
TerminalNotification
for cause
.cause
- for the notification.TerminalNotification
for cause
.public static TerminalNotification complete()
TerminalNotification
for completion.TerminalNotification
for completion.public java.lang.String toString()
toString
in class java.lang.Object