Class Priority

java.lang.Object
studio.mevera.imperat.util.priority.Priority
All Implemented Interfaces:
Comparable<Priority>

public final class Priority extends Object implements Comparable<Priority>
Represents the relative priority used when resolving command parameters.

A Priority is an immutable wrapper around an integer level. Higher level values represent higher precedence when multiple parameter handlers, resolvers, or strategies are applicable. The exact comparison is typically numeric: a handler with a higher level is preferred over one with a lower level.

This class provides a set of common baseline priorities:

  • MINIMUM – a sentinel priority intended for fallbacks or handlers that should only be used when nothing else matches.
  • LOW – a default low priority for generic or less specific handlers.
  • NORMAL – the standard priority for most parameter handlers.
  • HIGH – a higher priority for more specific or preferred handlers.
  • MAXIMUM – a sentinel priority for handlers that should win over all others when applicable.

Custom priorities can be created via of(int) or by adjusting an existing instance with plus(int). When defining custom levels, choose values relative to the built-in constants so that the resulting ordering remains clear and predictable.