public final class Priority extends Object implements Comparable<Priority>
For example in composites where it can be used to determine the order in which the delegates are used.
The binary operators that determine the ordering sort priorities from high to low.
Modifier and Type | Field and Description |
---|---|
static Priority |
Fallback
Preset priority value that represents a fallback priority.
|
static Priority |
High
Preset priority value that represents a high priority.
|
static Priority |
Low
Preset priority value that represents a low priority.
|
static Priority |
Normal
Preset priority value that represents a default priority.
|
Constructor and Description |
---|
Priority(long value)
Creates a new priority with the given value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Priority other) |
boolean |
equals(Object other) |
long |
getValue()
Returns the priority value.
|
int |
hashCode() |
public static final Priority High
Its priority value is 5000. Priority order: High > Normal > Low > Fallback
public static final Priority Normal
Its priority value is 10000. Priority order: High > Normal > Low > Fallback
public static final Priority Low
Its priority value is 20000. Priority order: High > Normal > Low > Fallback
public static final Priority Fallback
Its priority value is 50000. Priority order: High > Normal > Low > Fallback
public Priority(long value)
value
- a priority value. A lower value means a higher priority. The default value is the value of Priority#normal()
.public long getValue()
A lower value means a higher priority.
public int compareTo(@NotNull Priority other)
compareTo
in interface Comparable<Priority>