public abstract class DisposableBase extends java.lang.Object implements IDisposable
Constructor and Description |
---|
DisposableBase() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static void |
tryDispose(IDisposable disposable)
Helper method which checks if disposable is null before disposing.
|
static <T extends IDisposable> |
tryDispose(java.util.List<T> disposableList)
Helper method which disposes list of disposables.
|
static <T extends IDisposable> |
tryDispose(java.util.Map<?,T> disposableMap)
Helper method which disposes map of disposables.
|
static <T extends IDisposable> |
tryDispose(android.util.SparseArray<T> disposableSparseArray)
Helper method which disposes sparse array of disposables.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispose
public final void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception
public static void tryDispose(IDisposable disposable)
disposable
- The disposable instance.public static <T extends IDisposable> void tryDispose(java.util.List<T> disposableList)
T
- The type of elements in the disposableList
.disposableList
- The disposable list.public static <T extends IDisposable> void tryDispose(android.util.SparseArray<T> disposableSparseArray)
T
- The type of elements in the disposableSparseArray
.disposableSparseArray
- The disposable sparse array.public static <T extends IDisposable> void tryDispose(java.util.Map<?,T> disposableMap)
T
- The type of values in the disposableMap
.disposableMap
- The disposable map.