Class BooleanSubscription

  • All Implemented Interfaces:
    java.io.Serializable, org.reactivestreams.Subscription

    public final class BooleanSubscription
    extends java.util.concurrent.atomic.AtomicBoolean
    implements org.reactivestreams.Subscription
    Subscription implementation that ignores request but remembers the cancellation which can be checked via isCancelled.
    See Also:
    Serialized Form
    • Field Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cancel()  
      boolean isCancelled()
      Returns true if this BooleanSubscription has been cancelled.
      void request​(long n)  
      java.lang.String toString()  
      • Methods inherited from class java.util.concurrent.atomic.AtomicBoolean

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

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

      • BooleanSubscription

        public BooleanSubscription()
    • Method Detail

      • request

        public void request​(long n)
        Specified by:
        request in interface org.reactivestreams.Subscription
      • cancel

        public void cancel()
        Specified by:
        cancel in interface org.reactivestreams.Subscription
      • isCancelled

        public boolean isCancelled()
        Returns true if this BooleanSubscription has been cancelled.
        Returns:
        true if this BooleanSubscription has been cancelled
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.concurrent.atomic.AtomicBoolean