Enum Class NotificationLite

java.lang.Object
java.lang.Enum<NotificationLite>
io.reactivex.rxjava3.internal.util.NotificationLite
All Implemented Interfaces:
Serializable, Comparable<NotificationLite>, Constable

public enum NotificationLite extends Enum<NotificationLite>
Lightweight notification handling utility class.
  • Enum Constant Details

  • Constructor Details

    • NotificationLite

      private NotificationLite()
  • Method Details

    • values

      public static NotificationLite[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NotificationLite valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • next

      public static <T> Object next(T value)
      Converts a value into a notification value.
      Type Parameters:
      T - the actual value type
      Parameters:
      value - the value to convert
      Returns:
      the notification representing the value
    • complete

      public static Object complete()
      Returns a complete notification.
      Returns:
      a complete notification
    • error

      public static Object error(Throwable e)
      Converts a Throwable into a notification value.
      Parameters:
      e - the Throwable to convert
      Returns:
      the notification representing the Throwable
    • subscription

      public static Object subscription(org.reactivestreams.Subscription s)
      Converts a Subscription into a notification value.
      Parameters:
      s - the Subscription to convert
      Returns:
      the notification representing the Subscription
    • disposable

      public static Object disposable(Disposable d)
      Converts a Disposable into a notification value.
      Parameters:
      d - the disposable to convert
      Returns:
      the notification representing the Disposable
    • isComplete

      public static boolean isComplete(Object o)
      Checks if the given object represents a complete notification.
      Parameters:
      o - the object to check
      Returns:
      true if the object represents a complete notification
    • isError

      public static boolean isError(Object o)
      Checks if the given object represents a error notification.
      Parameters:
      o - the object to check
      Returns:
      true if the object represents a error notification
    • isSubscription

      public static boolean isSubscription(Object o)
      Checks if the given object represents a subscription notification.
      Parameters:
      o - the object to check
      Returns:
      true if the object represents a subscription notification
    • isDisposable

      public static boolean isDisposable(Object o)
    • getValue

      public static <T> T getValue(Object o)
      Extracts the value from the notification object.
      Type Parameters:
      T - the expected value type when unwrapped
      Parameters:
      o - the notification object
      Returns:
      the extracted value
    • getError

      public static Throwable getError(Object o)
      Extracts the Throwable from the notification object.
      Parameters:
      o - the notification object
      Returns:
      the extracted Throwable
    • getSubscription

      public static org.reactivestreams.Subscription getSubscription(Object o)
      Extracts the Subscription from the notification object.
      Parameters:
      o - the notification object
      Returns:
      the extracted Subscription
    • getDisposable

      public static Disposable getDisposable(Object o)
    • accept

      public static <T> boolean accept(Object o, org.reactivestreams.Subscriber<? super T> s)
      Calls the appropriate Subscriber method based on the type of the notification.

      Does not check for a subscription notification, see acceptFull(Object, Subscriber).

      Type Parameters:
      T - the expected value type when unwrapped
      Parameters:
      o - the notification object
      s - the subscriber to call methods on
      Returns:
      true if the notification was a terminal event (i.e., complete or error)
      See Also:
    • accept

      public static <T> boolean accept(Object o, Observer<? super T> observer)
      Calls the appropriate Observer method based on the type of the notification.

      Does not check for a subscription notification.

      Type Parameters:
      T - the expected value type when unwrapped
      Parameters:
      o - the notification object
      observer - the Observer to call methods on
      Returns:
      true if the notification was a terminal event (i.e., complete or error)
    • acceptFull

      public static <T> boolean acceptFull(Object o, org.reactivestreams.Subscriber<? super T> s)
      Calls the appropriate Subscriber method based on the type of the notification.
      Type Parameters:
      T - the expected value type when unwrapped
      Parameters:
      o - the notification object
      s - the subscriber to call methods on
      Returns:
      true if the notification was a terminal event (i.e., complete or error)
      See Also:
    • acceptFull

      public static <T> boolean acceptFull(Object o, Observer<? super T> observer)
      Calls the appropriate Observer method based on the type of the notification.
      Type Parameters:
      T - the expected value type when unwrapped
      Parameters:
      o - the notification object
      observer - the subscriber to call methods on
      Returns:
      true if the notification was a terminal event (i.e., complete or error)
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Enum<NotificationLite>