Modifier and Type | Method and Description |
---|---|
static <T> @NonNull Notification<T> |
createOnComplete()
Returns the empty and stateless shared instance of a notification representing
an
onComplete signal. |
static <T> @NonNull Notification<T> |
createOnError(@NonNull Throwable error)
Constructs an onError notification containing the error.
|
static <T> @NonNull Notification<T> |
createOnNext(T value)
Constructs an onNext notification containing the given value.
|
boolean |
equals(Object obj) |
@Nullable 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. |
String |
toString() |
public boolean isOnComplete()
onComplete
signal.onComplete
signalpublic boolean isOnError()
onError
signal and
getError()
returns the contained Throwable
.onError
signalgetError()
public boolean isOnNext()
onNext
signal and
getValue()
returns the contained value.onNext
signalgetValue()
@Nullable public T getValue()
onNext
signal, null otherwise.isOnNext()
@Nullable public @Nullable Throwable getError()
Throwable
error if this notification is an onError
signal, null otherwise.Throwable
error contained or null
isOnError()
@NonNull public static <T> @NonNull Notification<T> createOnNext(T value)
T
- the value typevalue
- the value to carry around in the notification, not null
NullPointerException
- if value is null
@NonNull public static <T> @NonNull Notification<T> createOnError(@NonNull @NonNull Throwable error)
T
- the value typeerror
- the error Throwable to carry around in the notification, not nullNullPointerException
- if error is null
@NonNull public static <T> @NonNull Notification<T> createOnComplete()
onComplete
signal.T
- the target value typeonComplete
signal