Package kr.toxicity.command.impl
Record Class CommandMessage
java.lang.Object
java.lang.Record
kr.toxicity.command.impl.CommandMessage
- Record Components:
key- translatable keydefaultMessage- default component if lang file is not found
- All Implemented Interfaces:
Comparable<CommandMessage>
public record CommandMessage(@NotNull String key, @NotNull net.kyori.adventure.text.Component defaultMessage)
extends Record
implements Comparable<CommandMessage>
Component with translatable key
-
Constructor Summary
ConstructorsConstructorDescriptionCommandMessage(@NotNull String key, @NotNull net.kyori.adventure.text.Component defaultMessage) Creates instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull @Unmodifiable Set<CommandMessage>Gets all generated messageintcompareTo(@NotNull CommandMessage o) @NotNull net.kyori.adventure.text.ComponentReturns the value of thedefaultMessagerecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.@NotNull Stringkey()Returns the value of thekeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CommandMessage
public CommandMessage(@NotNull @NotNull String key, @NotNull @NotNull net.kyori.adventure.text.Component defaultMessage) Creates instance.- Parameters:
key- translatable keydefaultMessage- default component if lang file is not found
-
-
Method Details
-
allMessages
Gets all generated message- Returns:
- all message
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
compareTo
- Specified by:
compareToin interfaceComparable<CommandMessage>
-
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
defaultMessage
@NotNull public @NotNull net.kyori.adventure.text.Component defaultMessage()Returns the value of thedefaultMessagerecord component.- Returns:
- the value of the
defaultMessagerecord component
-