All Known Implementing Classes:
CooldownMap
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 Cooldown
A functional interface representing a cooldown check for a given key.

This is used to determine whether a message should be allowed to send, based on the last time it was shown and the configured delay.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    notCooling(CooldownKey cooldownKey)
    Determines if the given cooldown key is not currently cooling down.
  • Method Details

    • notCooling

      boolean notCooling(CooldownKey cooldownKey)
      Determines if the given cooldown key is not currently cooling down.

      Returns true if either no cooldown exists for the key, or the cooldown has expired.

      Parameters:
      cooldownKey - the cooldown key composed of recipient and message identifier
      Returns:
      true if the message is not cooling down and may be shown