Record Class DisplayArg.TranslationKeyArg
java.lang.Object
java.lang.Record
dev.munebase.dynamickeybinds.model.DisplayArg.TranslationKeyArg
- All Implemented Interfaces:
DisplayArg
- Enclosing interface:
- DisplayArg
public static record DisplayArg.TranslationKeyArg(String translationKey)
extends Record
implements DisplayArg
A translation key argument (for nested translations).
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.munebase.dynamickeybinds.model.DisplayArg
DisplayArg.IntArg, DisplayArg.StringArg, DisplayArg.TranslationKeyArg -
Constructor Summary
ConstructorsConstructorDescriptionTranslationKeyArg(String translationKey) Creates an instance of aTranslationKeyArgrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intGet the type ID of this argument for serialization.getValue()Get the raw object value of this argument (String, Integer, etc).final inthashCode()Returns a hash code value for this object.net.minecraft.nbt.CompoundTagtoNbt()Serialize this DisplayArg to NBT.final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationKeyrecord component.
-
Constructor Details
-
TranslationKeyArg
Creates an instance of aTranslationKeyArgrecord class.- Parameters:
translationKey- the value for thetranslationKeyrecord component
-
-
Method Details
-
toNbt
public net.minecraft.nbt.CompoundTag toNbt()Description copied from interface:DisplayArgSerialize this DisplayArg to NBT.- Specified by:
toNbtin interfaceDisplayArg
-
getTypeId
public int getTypeId()Description copied from interface:DisplayArgGet the type ID of this argument for serialization.- Specified by:
getTypeIdin interfaceDisplayArg
-
getValue
Description copied from interface:DisplayArgGet the raw object value of this argument (String, Integer, etc).- Specified by:
getValuein interfaceDisplayArg
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
translationKey
Returns the value of thetranslationKeyrecord component.- Returns:
- the value of the
translationKeyrecord component
-