Enum Class Priority
- All Implemented Interfaces:
Serializable, Comparable<Priority>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic Comparator<Priority> Get a comparator that sorts by priority (highest first).static <T> Comparator<T> Get a comparator that sorts objects by their priority (highest first).static Comparator<Object> comparingReversed(Function<Object, Priority> keyExtractor) Get a comparator that sorts objects by priority in reverse (lowest first).intgetValue()Get the numeric value of this priority.static Priorityhighest()Get the priority with the highest precedence (HIGHEST).booleanCheck if this priority is at least as high as another.booleanCheck if this priority is at most as high as another.booleanisHigherThan(Priority other) Check if this priority is higher than another.booleanisLowerThan(Priority other) Check if this priority is lower than another.booleanCheck if this priority is the same as another.static Prioritylowest()Get the priority with the lowest precedence (LOWEST).static Prioritynormal()Get the default priority (NORMAL).static PriorityParse priority from string (case-insensitive).static PriorityParse priority from string with fallback.toString()static PriorityReturns the enum constant of this class with the specified name.static Priority[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HIGHEST
-
HIGH
-
NORMAL
-
LOW
-
LOWEST
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
comparator
Get a comparator that sorts by priority (highest first). Usage: list.sort(Priority.comparator())- Returns:
- comparator for sorting by priority
-
comparing
Get a comparator that sorts objects by their priority (highest first). Usage: entrypoints.sort(Priority.comparing(BundleEntrypoint::getPriority))- Parameters:
keyExtractor- function to extract priority from object- Returns:
- comparator for sorting objects by priority
-
comparingReversed
Get a comparator that sorts objects by priority in reverse (lowest first).- Parameters:
keyExtractor- function to extract priority from object- Returns:
- reverse comparator for sorting objects by priority
-
highest
Get the priority with the highest precedence (HIGHEST).- Returns:
- HIGHEST priority
-
lowest
Get the priority with the lowest precedence (LOWEST).- Returns:
- LOWEST priority
-
normal
-
parse
-
parse
-
getValue
public int getValue()Get the numeric value of this priority. Lower values = higher priority.- Returns:
- numeric priority value
-
isHigherThan
Check if this priority is higher than another.- Parameters:
other- priority to compare against- Returns:
- true if this priority is higher (executes first)
-
isLowerThan
Check if this priority is lower than another.- Parameters:
other- priority to compare against- Returns:
- true if this priority is lower (executes last)
-
isSameAs
Check if this priority is the same as another.- Parameters:
other- priority to compare against- Returns:
- true if priorities are equal
-
isAtLeast
Check if this priority is at least as high as another.- Parameters:
other- priority to compare against- Returns:
- true if this >= other
-
isAtMost
Check if this priority is at most as high as another.- Parameters:
other- priority to compare against- Returns:
- true if this is greater than 'other' priority
-
toString
-