Interface CommandPriorityCalculator

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface CommandPriorityCalculator
Calculate the priority of CommandMessage based on its content.

Higher value means higher priority.

Since:
4.0.0
Author:
Marc Gathier
  • Method Details

    • determinePriority

      int determinePriority(@Nonnull CommandMessage command)
      Determines the priority of the given command. The higher the returned value, the higher the priority is.
      Parameters:
      command - A CommandMessage to prioritize.
      Returns:
      An int defining the priority of the given command.
    • defaultCalculator

      @Nonnull static CommandPriorityCalculator defaultCalculator()
      Returns a default implementation of the CommandPriorityCalculator, always returning priority 0.
      Returns:
      A lambda taking in a CommandMessage to prioritize to the default of priority 0.