RxJava



rx
Class Notification<T>

java.lang.Object
  extended by rx.Notification<T>

public class Notification<T>
extends java.lang.Object

An object representing a notification sent to an Observable. For the Microsoft Rx equivalent see: http://msdn.microsoft.com/en-us/library/hh229462(v=vs.103).aspx


Nested Class Summary
static class Notification.Kind
           
 
Constructor Summary
Notification()
          A constructor used to represent an onCompleted notification.
Notification(T value)
          A constructor used to represent an onNext notification.
Notification(java.lang.Throwable exception)
          A constructor used to represent an onError notification.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 Notification.Kind getKind()
          Retrieves the kind of the notification: OnNext, OnError, OnCompleted
 java.lang.Throwable getThrowable()
          Retrieves the exception associated with an onError notification.
 T getValue()
          Retrieves the data associated with an onNext notification.
 int hashCode()
           
 boolean hasThrowable()
          Retrieves a value indicating whether this notification has an exception.
 boolean hasValue()
          Retrieves a value indicating whether this notification has a value.
 boolean isOnCompleted()
           
 boolean isOnError()
           
 boolean isOnNext()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Notification

public Notification(T value)
A constructor used to represent an onNext notification.

Parameters:
value - The data passed to the onNext method.

Notification

public Notification(java.lang.Throwable exception)
A constructor used to represent an onError notification.

Parameters:
exception - The exception passed to the onError notification.

Notification

public Notification()
A constructor used to represent an onCompleted notification.

Method Detail

getThrowable

public java.lang.Throwable getThrowable()
Retrieves the exception associated with an onError notification.

Returns:
Throwable associated with an onError notification.

getValue

public T getValue()
Retrieves the data associated with an onNext notification.

Returns:
The data associated with an onNext notification.

hasValue

public boolean hasValue()
Retrieves a value indicating whether this notification has a value.

Returns:
a value indicating whether this notification has a value.

hasThrowable

public boolean hasThrowable()
Retrieves a value indicating whether this notification has an exception.

Returns:
a value indicating whether this notification has an exception.

getKind

public Notification.Kind getKind()
Retrieves the kind of the notification: OnNext, OnError, OnCompleted

Returns:
the kind of the notification: OnNext, OnError, OnCompleted

isOnError

public boolean isOnError()

isOnCompleted

public boolean isOnCompleted()

isOnNext

public boolean isOnNext()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object