public interface Disposable
dispose()
multiple times on a element. Once an
element is disposed, no methods should be invoked on element.Modifier and Type | Method and Description |
---|---|
static Disposable |
asDisposable(java.lang.Object object)
Cast specified object to instance of Disposable.
|
void |
dispose()
Dispose the element.
|
static void |
dispose(java.lang.Object object)
Dispose the supplied object if it is Disposable, else do nothing.
|
boolean |
isDisposed()
Return true if dispose() has been called on object.
|
static boolean |
isDisposed(java.lang.Object object)
Return true if the parameter is Disposable and has been disposed, else return false.
|
default boolean |
isNotDisposed()
Return true if
isDisposed() returns false. |
static boolean |
isNotDisposed(java.lang.Object object)
Return true if
isDisposed(Object) returns false for the same parameter. |
void dispose()
Disposable
for a description of the implications.boolean isDisposed()
default boolean isNotDisposed()
isDisposed()
returns false.isDisposed()
returns false.static void dispose(@Nullable java.lang.Object object)
object
- the object to dispose.static boolean isDisposed(@Nullable java.lang.Object object)
object
- the object to check disposed state.static boolean isNotDisposed(@Nullable java.lang.Object object)
isDisposed(Object)
returns false for the same parameter.object
- the object to check state.@Nonnull static Disposable asDisposable(@Nonnull java.lang.Object object)
object
- the object to cast to Disposable.