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
Author:
Marc Gathier
  • Method Details

    • determinePriority

      int determinePriority(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
    • defaultCommandPriorityCalculator

      static CommandPriorityCalculator defaultCommandPriorityCalculator()
      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