T - the actual value type held by the Notificationpublic final classNotification<T>extends java.lang.ObjectObservable.| Modifier and Type | Class and Description |
|---|---|
static class | Notification.KindSpecifies the kind of the notification: an element, an error or a completion notification. |
| Modifier and Type | Method and Description |
|---|---|
void | accept(Observer<? superT> observer)Forwards this notification on to a specified Observer. |
static <T> Notification<T> | createOnCompleted()Creates and returns a Notification of varietyKind.OnCompleted. |
static <T> Notification<T> | createOnCompleted(java.lang.Class<T> type)Deprecated. this method does the same as createOnCompleted() and does not use the passed in type hence it's useless. |
static <T> Notification<T> | createOnError(java.lang.Throwable e)Creates and returns a Notification of varietyKind.OnError, and assigns it an exception. |
static <T> Notification<T> | createOnNext(T t)Creates and returns a Notification of varietyKind.OnNext, and assigns it a value. |
boolean | equals(java.lang.Object obj) |
Notification.Kind | getKind()Retrieves the kind of this notification: OnNext,OnError, orOnCompleted |
java.lang.Throwable | getThrowable()Retrieves the exception associated with this (onError) notification. |
T | getValue()Retrieves the item associated with this (onNext) notification. |
int | hashCode() |
boolean | hasThrowable()Indicates whether this notification has an exception associated with it. |
boolean | hasValue()Indicates whether this notification has an item associated with it. |
boolean | isOnCompleted()Indicates whether this notification represents an onCompleted event. |
boolean | isOnError()Indicates whether this notification represents an onError event. |
boolean | isOnNext()Indicates whether this notification represents an onNext event. |
java.lang.String | toString() |
public static <T> Notification<T> createOnNext(T t)
Notification of varietyKind.OnNext, and assigns it a value.T - the actual value type held by the Notificationt - the item to assign to the notification as its valueOnNext variety ofNotificationpublic static <T> Notification<T> createOnError(java.lang.Throwable e)
Notification of varietyKind.OnError, and assigns it an exception.T - the actual value type held by the Notificatione - the exception to assign to the notificationOnError variety ofNotificationpublic static <T> Notification<T> createOnCompleted()
Notification of varietyKind.OnCompleted.T - the actual value type held by the NotificationOnCompleted variety ofNotification@Deprecatedpublic static <T> Notification<T> createOnCompleted(java.lang.Class<T> type)
createOnCompleted() and does not use the passed in type hence it's useless.Notification of varietyKind.OnCompleted.T - the actual value type held by the Notificationtype - the type token to help with type inference of<T>OnCompleted variety ofNotificationpublic java.lang.Throwable getThrowable()
public T getValue()
public boolean hasValue()
public boolean hasThrowable()
public Notification.Kind getKind()
OnNext,OnError, orOnCompletedOnNext,OnError, orOnCompletedpublic boolean isOnError()
onError event.onError eventpublic boolean isOnCompleted()
onCompleted event.onCompleted eventpublic boolean isOnNext()
onNext event.onNext eventpublic void accept(Observer<? superT> observer)
Observer.observer - the target observer to call onXXX methods on based on the kind of this Notification instancepublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object