java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.cooldown.CooldownKey

public class CooldownKey extends Object
An implementation of a key for use in the cooldown map. It is composed of the recipient uuid and the unique MessageId. If a recipient does not have an uuid, such as the console, the declared constant default uuid is used. This means that the console is subject to message repeat delays, which are shared by all non-uuid message recipients. (Are there more than console? Players and Entities both have uuids.)

This behavior could be adapted by generating random uuids, or specific uuids for various non-uuid message recipient types.

  • Method Details

    • of

      public static Optional<CooldownKey> of(Recipient.Sendable recipient, RecordKey messageKey)
      Static factory method with Message parameter
      Parameters:
      recipient - the recipient used for CooldownKey creation
      messageKey - the message key used for CooldownKey creation
      Returns:
      Optional CooldownKey, or empty Optional if either parameter is invalid
    • getMessageKey

      public RecordKey getMessageKey()
      Retrieve the message key used for this cooldown key
      Returns:
      the message key for this cooldown key
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public final boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object