Package jline.lang.constant
Enum PollingType
- All Implemented Interfaces:
Serializable,Comparable<PollingType>,java.lang.constant.Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic PollingTypefromValue(int value) Converts a numeric value to a PollingType enum value.intgetValue()Gets the numeric value of this polling type.static inttoId(PollingType type) Gets the ID (numeric value) of the polling type.static StringtoText(PollingType type) Converts a PollingType enum value to its text representation.static PollingTypeReturns the enum constant of this type with the specified name.static PollingType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
GATED
-
EXHAUSTIVE
-
KLIMITED
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getValue
public int getValue()Gets the numeric value of this polling type.- Returns:
- the numeric value
-
fromValue
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
Converts a PollingType enum value to its text representation.- Parameters:
type- the polling type to convert- Returns:
- the text representation of the type
-
toId
Gets the ID (numeric value) of the polling type.- Parameters:
type- the polling type- Returns:
- the ID value
-