Interface QueryPriorityCalculator

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 QueryPriorityCalculator
Calculate the priority of QueryMessage based on its content.

Higher value means higher priority.

Since:
4.0.0
Author:
Marc Gathier
  • Method Details

    • determinePriority

      int determinePriority(@Nonnull QueryMessage query)
      Determines the priority of the given query. The higher the returned value, the higher the priority is.
      Parameters:
      query - a QueryMessage to prioritize
      Returns:
      an int defining the priority of the given query
    • defaultCalculator

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