T
- the value typepublic final class Notification<T>
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> Notification<T> |
createOnComplete()
Returns the empty and stateless shared instance of a notification representing
an onComplete signal.
|
static <T> Notification<T> |
createOnError(java.lang.Throwable error)
Constructs an onError notification containing the error.
|
static <T> Notification<T> |
createOnNext(T value)
Constructs an onNext notification containing the given value.
|
boolean |
equals(java.lang.Object obj) |
java.lang.Throwable |
getError()
Returns the container Throwable error if this notification is an onError
signal, null otherwise.
|
T |
getValue()
Returns the contained value if this notification is an onNext
signal, null otherwise.
|
int |
hashCode() |
boolean |
isOnComplete()
Returns true if this notification is an onComplete signal.
|
boolean |
isOnError()
Returns true if this notification is an onError signal and
getError() returns the contained Throwable. |
boolean |
isOnNext()
Returns true if this notification is an onNext signal and
getValue() returns the contained value. |
java.lang.String |
toString() |
public boolean isOnComplete()
public boolean isOnError()
getError()
returns the contained Throwable.getError()
public boolean isOnNext()
getValue()
returns the contained value.getValue()
public T getValue()
isOnNext()
public java.lang.Throwable getError()
isOnError()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static <T> Notification<T> createOnNext(T value)
T
- the value typevalue
- the value to carry around in the notification, not nulljava.lang.NullPointerException
- if value is nullpublic static <T> Notification<T> createOnError(java.lang.Throwable error)
T
- the value typeerror
- the error Throwable to carry around in the notification, not nulljava.lang.NullPointerException
- if error is nullpublic static <T> Notification<T> createOnComplete()
T
- the target value type