Enum DisposableHelper

    • Enum Constant Detail

      • DISPOSED

        public static final DisposableHelper DISPOSED
        The singleton instance representing a terminal, disposed state, don't leak it.
    • Method Detail

      • values

        public static DisposableHelper[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DisposableHelper c : DisposableHelper.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DisposableHelper valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • isDisposed

        public static boolean isDisposed​(io.reactivex.rxjava3.disposables.Disposable d)
        Checks if the given Disposable is the common DISPOSED enum value.
        Parameters:
        d - the disposable to check
        Returns:
        true if d is DISPOSED
      • set

        public static boolean set​(AtomicReference<io.reactivex.rxjava3.disposables.Disposable> field,
                                  io.reactivex.rxjava3.disposables.Disposable d)
        Atomically sets the field and disposes the old contents.
        Parameters:
        field - the target field
        d - the new Disposable to set
        Returns:
        true if successful, false if the field contains the DISPOSED instance.
      • dispose

        public static boolean dispose​(AtomicReference<io.reactivex.rxjava3.disposables.Disposable> field)
        Atomically disposes the Disposable in the field if not already disposed.
        Parameters:
        field - the target field
        Returns:
        true if the current thread managed to dispose the Disposable
      • dispose

        public void dispose()
        Specified by:
        dispose in interface io.reactivex.rxjava3.disposables.Disposable
      • isDisposed

        public boolean isDisposed()
        Specified by:
        isDisposed in interface io.reactivex.rxjava3.disposables.Disposable