Enum CancelOption

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CANCEL_ON_INTERRUPT
      Indicates that when waiting on a future is interrupted, the future shall be canceled.
      CANCEL_ON_TIMEOUT
      Indicates that when waiting on a future times out, the future shall be canceled.
      NO_CANCELLATION
      Indicates that even if waiting on a future times out or is interrupted, it shall not be canceled.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CancelOption()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static CancelOption valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static CancelOption[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • CANCEL_ON_TIMEOUT

        public static final CancelOption CANCEL_ON_TIMEOUT
        Indicates that when waiting on a future times out, the future shall be canceled.
      • CANCEL_ON_INTERRUPT

        public static final CancelOption CANCEL_ON_INTERRUPT
        Indicates that when waiting on a future is interrupted, the future shall be canceled.
      • NO_CANCELLATION

        public static final CancelOption NO_CANCELLATION
        Indicates that even if waiting on a future times out or is interrupted, it shall not be canceled.

        CANCEL_ON_TIMEOUT and CANCEL_ON_INTERRUPT take predence over this flag. The main purpose of this flag is to be able to call verify(timeout, NO_CANCELLATION) to suppress cancelling a future on time-outs or interrupts altogether. By default, verify(timeout) will cancel the future on both time-outs and interrupts.

    • Constructor Detail

      • CancelOption

        private CancelOption()
    • Method Detail

      • values

        public static CancelOption[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CancelOption c : CancelOption.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CancelOption valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null