public static interface Disposable.Swap extends Disposable, Supplier<Disposable>
Disposable
container that allows updating/replacing its inner Disposable
atomically and with respect of disposing the container itself.Disposable.Composite, Disposable.Swap
Modifier and Type | Method and Description |
---|---|
boolean |
replace(Disposable next)
Atomically set the next
Disposable on this container but don't dispose the previous
one (if any). |
boolean |
update(Disposable next)
Atomically set the next
Disposable on this container and dispose the previous
one (if any). |
dispose, isDisposed
boolean update(@Nullable Disposable next)
Disposable
on this container and dispose the previous
one (if any). If the container has been disposed, fall back to disposing next
.next
- the Disposable
to set, may be nullreplace(Disposable)
boolean replace(@Nullable Disposable next)
Disposable
on this container but don't dispose the previous
one (if any). If the container has been disposed, fall back to disposing next
.next
- the Disposable
to set, may be nullupdate(Disposable)