Class ReferenceDisposable<T>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Dispose the resource, the operation should be idempotent.
      boolean isDisposed()
      Returns true if this resource has been disposed.
      protected abstract void onDisposed​(T value)  
      • Methods inherited from class java.util.concurrent.atomic.AtomicReference

        accumulateAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, get, getAcquire, getAndAccumulate, getAndSet, getAndUpdate, getOpaque, getPlain, lazySet, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ReferenceDisposable

        ReferenceDisposable​(T value)
    • Method Detail

      • onDisposed

        protected abstract void onDisposed​(@NonNull
                                           T value)
      • dispose

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

        public final 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