Enum PollingType

java.lang.Object
java.lang.Enum<PollingType>
jline.lang.constant.PollingType
All Implemented Interfaces:
Serializable, Comparable<PollingType>, java.lang.constant.Constable

public enum PollingType extends Enum<PollingType>
Enumeration of polling service types for polling scheduling strategy.

These constants specify how a polling server handles jobs at each queue during a polling cycle:

  • GATED - Serves only jobs present at the start of the polling cycle
  • EXHAUSTIVE - Serves all jobs until the queue is empty
  • KLIMITED - Serves at most K jobs per polling cycle
  • Enum Constant Details

  • Method Details

    • values

      public static PollingType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static PollingType valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()
      Gets the numeric value of this polling type.
      Returns:
      the numeric value
    • fromValue

      public static PollingType fromValue(int value)
      Converts a numeric value to a PollingType enum value.
      Parameters:
      value - the numeric value
      Returns:
      the corresponding PollingType enum value
      Throws:
      RuntimeException - if the value is not recognized
    • toText

      public static String toText(PollingType type)
      Converts a PollingType enum value to its text representation.
      Parameters:
      type - the polling type to convert
      Returns:
      the text representation of the type
    • toId

      public static int toId(PollingType type)
      Gets the ID (numeric value) of the polling type.
      Parameters:
      type - the polling type
      Returns:
      the ID value