public final class Notification<T> extends Object
Observable.
| Modifier and Type | Class and Description |
|---|---|
static class |
Notification
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Observer
Forwards this notification on to a specified
Observer.
|
static <T> Notification |
createOnCompleted()
Creates and returns a
Notification of variety
Kind.OnCompleted.
|
static <T> Notification |
createOnCompleted(Class
Creates and returns a
Notification of variety
Kind.OnCompleted.
|
static <T> Notification |
createOnError(Throwable
Creates and returns a
Notification of variety
Kind.OnError, and assigns it an exception.
|
static <T> Notification |
createOnNext(T t)
Creates and returns a
Notification of variety
Kind.OnNext, and assigns it a value.
|
boolean |
equals(Object
|
Notification |
getKind()
Retrieves the kind of this notification:
OnNext,
OnError, or
OnCompleted
|
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.
|
String |
toString()
|
public static <T> Notification<T> createOnNext(T t)
Notification of variety
Kind.OnNext, and assigns it a value.
t - the item to assign to the notification as its value
OnNext variety of
Notification
public static <T> Notification<T> createOnError(Throwable e)
Notification of variety
Kind.OnError, and assigns it an exception.
e - the exception to assign to the notification
OnError variety of
Notification
public static <T> Notification<T> createOnCompleted()
Notification of variety
Kind.OnCompleted.
OnCompleted variety of
Notification
public static <T> Notification<T> createOnCompleted(Class <T> type)
Notification of variety
Kind.OnCompleted.
type -
OnCompleted variety of
Notification
public ThrowablegetThrowable()
public T getValue()
public boolean hasValue()
public boolean hasThrowable()
public Notification.Kind getKind()
OnNext,
OnError, or
OnCompleted
OnNext,
OnError, or
OnCompleted
public boolean isOnError()
onError event.
onError event
public boolean isOnCompleted()
onCompleted event.
onCompleted event
public boolean isOnNext()
onNext event.
onNext event
public void accept(Observer<? super T> observer)
Observer.
public StringtoString()
public int hashCode()
public boolean equals(Objectobj)