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
-
Nested Class Summary
Nested classes/interfaces inherited from interface DisposableContainer
DisposableContainer.NeverDisposableContainerModifier and TypeInterfaceDescriptionstatic final recordImplementation of a never disposable container. -
Field Summary
Fields inherited from interface DisposableContainer
NEVERModifier and TypeFieldDescriptionstatic final DisposableContainerThe container implementation that just ignores everything, for cases where the dispose signal has no side-effects to work with. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aNeverDisposableContainerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(Disposable d) Adds a disposable to this container or disposes it if the container has been disposed.voidclear()Removes and disposes all containedDisposables, making this container fresh without disposing the entire container.booleandelete(Disposable d) Removes but does not dispose the given disposable if it is part of this container.voiddispose()Dispose the resource, the operation should be idempotent.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns true if this resource has been disposed.booleanremove(Disposable d) Removes and disposes the given disposable if it is part of this container.voidreset()Removes all containedDisposables without disposing them, making this container fresh.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Disposable
closeModifier and TypeMethodDescriptiondefault voidclose()Dispose the resource, the operation should be idempotent.Methods inherited from interface DisposableContainer
register, subscribeModifier and TypeMethodDescriptiondefault DisposableRegisters aDisposablewith this container so that it can be removed and disposed via a simpleDisposable.dispose()call to the returned Disposable.default DisposableRegisters aDisposablewith this container so that it can be deleted, not disposed via a simpleDisposable.dispose()call to the returned Disposable.
-
Constructor Details
-
NeverDisposableContainer
public NeverDisposableContainer()Creates an instance of aNeverDisposableContainerrecord class.
-
-
Method Details
-
dispose
public void dispose()Description copied from interface:DisposableDispose the resource, the operation should be idempotent.- Specified by:
disposein interfaceDisposable
-
isDisposed
public boolean isDisposed()Description copied from interface:DisposableReturns true if this resource has been disposed.- Specified by:
isDisposedin interfaceDisposable- Returns:
- true if this resource has been disposed
-
add
Description copied from interface:DisposableContainerAdds a disposable to this container or disposes it if the container has been disposed.- Specified by:
addin interfaceDisposableContainer- Parameters:
d- the disposable to add, not null- Returns:
- true if successful, false if this container has been disposed
-
remove
Description copied from interface:DisposableContainerRemoves and disposes the given disposable if it is part of this container.- Specified by:
removein interfaceDisposableContainer- Parameters:
d- the disposable to remove and dispose, not null- Returns:
- true if the operation was successful
-
delete
Description copied from interface:DisposableContainerRemoves but does not dispose the given disposable if it is part of this container.- Specified by:
deletein interfaceDisposableContainer- Parameters:
d- the disposable to remove, not null- Returns:
- true if the operation was successful
-
reset
public void reset()Description copied from interface:DisposableContainerRemoves all containedDisposables without disposing them, making this container fresh.- Specified by:
resetin interfaceDisposableContainer
-
clear
public void clear()Description copied from interface:DisposableContainerRemoves and disposes all containedDisposables, making this container fresh without disposing the entire container.- Specified by:
clearin interfaceDisposableContainer
-
toString
-
hashCode
-
equals
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.
-