Class CooldownKey
java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.cooldown.CooldownKey
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 Summary
Modifier and TypeMethodDescriptionfinal boolean
Retrieve the message key used for this cooldown keyint
hashCode()
static Optional
<CooldownKey> of
(Recipient.Sendable recipient, RecordKey messageKey) Static factory method with Message parametertoString()
-
Method Details
-
of
Static factory method with Message parameter- Parameters:
recipient
- the recipient used for CooldownKey creationmessageKey
- the message key used for CooldownKey creation- Returns:
Optional
CooldownKey, or empty Optional if either parameter is invalid
-
getMessageKey
Retrieve the message key used for this cooldown key- Returns:
- the message key for this cooldown key
-
toString
-
equals
-
hashCode
public int hashCode()
-