Record Class DisposableContainer.NeverDisposableContainer

java.lang.Object
java.lang.Record
io.reactivex.rxjava4.disposables.DisposableContainer.NeverDisposableContainer
All Implemented Interfaces:
Disposable, DisposableContainer, AutoCloseable
Enclosing interface:
DisposableContainer

public static record DisposableContainer.NeverDisposableContainer() extends Record implements DisposableContainer
Implementation of a never disposable container.
Since:
4.0.0
  • Constructor Details

    • NeverDisposableContainer

      public NeverDisposableContainer()
      Creates an instance of a NeverDisposableContainer record class.
  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: Disposable
      Dispose the resource, the operation should be idempotent.
      Specified by:
      dispose in interface Disposable
    • isDisposed

      public boolean isDisposed()
      Description copied from interface: Disposable
      Returns true if this resource has been disposed.
      Specified by:
      isDisposed in interface Disposable
      Returns:
      true if this resource has been disposed
    • add

      public boolean add(Disposable d)
      Description copied from interface: DisposableContainer
      Adds a disposable to this container or disposes it if the container has been disposed.
      Specified by:
      add in interface DisposableContainer
      Parameters:
      d - the disposable to add, not null
      Returns:
      true if successful, false if this container has been disposed
    • remove

      public boolean remove(Disposable d)
      Description copied from interface: DisposableContainer
      Removes and disposes the given disposable if it is part of this container.
      Specified by:
      remove in interface DisposableContainer
      Parameters:
      d - the disposable to remove and dispose, not null
      Returns:
      true if the operation was successful
    • delete

      public boolean delete(Disposable d)
      Description copied from interface: DisposableContainer
      Removes but does not dispose the given disposable if it is part of this container.
      Specified by:
      delete in interface DisposableContainer
      Parameters:
      d - the disposable to remove, not null
      Returns:
      true if the operation was successful
    • reset

      public void reset()
      Description copied from interface: DisposableContainer
      Removes all contained Disposables without disposing them, making this container fresh.
      Specified by:
      reset in interface DisposableContainer
    • clear

      public void clear()
      Description copied from interface: DisposableContainer
      Removes and disposes all contained Disposables, making this container fresh without disposing the entire container.
      Specified by:
      clear in interface DisposableContainer
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.