Class Notification<T>
java.lang.Object
io.reactivex.rxjava3.core.Notification<T>
- Type Parameters:
T- the value type
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Notification<Object> The singleton instance for createOnComplete.(package private) final Object -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNotification(@Nullable Object value) Not meant to be implemented externally. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @NonNull Notification<T> Returns the empty and stateless shared instance of a notification representing anonCompletesignal.static <T> @NonNull Notification<T> createOnError(@NonNull Throwable error) Constructs an onError notification containing the error.static <@NonNull T>
@NonNull Notification<T> createOnNext(@NonNull T value) Constructs an onNext notification containing the given value.booleangetError()Returns the containerThrowableerror if this notification is anonErrorsignal, null otherwise.getValue()Returns the contained value if this notification is anonNextsignal, null otherwise.inthashCode()booleanReturns true if this notification is anonCompletesignal.booleanReturns true if this notification is anonErrorsignal andgetError()returns the containedThrowable.booleanisOnNext()Returns true if this notification is anonNextsignal andgetValue()returns the contained value.toString()
-
Field Details
-
value
-
COMPLETE
The singleton instance for createOnComplete.
-
-
Constructor Details
-
Notification
-
-
Method Details
-
isOnComplete
public boolean isOnComplete()Returns true if this notification is anonCompletesignal.- Returns:
- true if this notification is an
onCompletesignal
-
isOnError
public boolean isOnError()Returns true if this notification is anonErrorsignal andgetError()returns the containedThrowable.- Returns:
- true if this notification is an
onErrorsignal - See Also:
-
isOnNext
public boolean isOnNext()Returns true if this notification is anonNextsignal andgetValue()returns the contained value.- Returns:
- true if this notification is an
onNextsignal - See Also:
-
getValue
-
getError
-
equals
-
hashCode
-
toString
-
createOnNext
Constructs an onNext notification containing the given value.- Type Parameters:
T- the value type- Parameters:
value- the value to carry around in the notification, notnull- Returns:
- the new Notification instance
- Throws:
NullPointerException- if value isnull
-
createOnError
@NonNull public static <T> @NonNull Notification<T> createOnError(@NonNull @NonNull Throwable error) Constructs an onError notification containing the error.- Type Parameters:
T- the value type- Parameters:
error- the error Throwable to carry around in the notification, not null- Returns:
- the new Notification instance
- Throws:
NullPointerException- if error isnull
-
createOnComplete
Returns the empty and stateless shared instance of a notification representing anonCompletesignal.- Type Parameters:
T- the target value type- Returns:
- the shared Notification instance representing an
onCompletesignal
-