Class CooldownKey
java.lang.Object
com.winterhavenmc.library.messagebuilder.models.keys.CooldownKey
An implementation of a string 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 TypeMethodDescriptionbooleanRetrieve the message string used for this cooldown stringinthashCode()static Optional<CooldownKey> of(Recipient.Sendable recipient, ValidMessageKey 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 string used for CooldownKey creation- Returns:
OptionalCooldownKey, or empty Optional if either parameter is invalid
-
getMessageKey
Retrieve the message string used for this cooldown string- Returns:
- the message string for this cooldown string
-
toString
-
equals
-
hashCode
public int hashCode()
-