Record Class Enchantment.Cost
java.lang.Object
java.lang.Record
net.minestom.server.item.enchant.Enchantment.Cost
- Enclosing interface:
Enchantment
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<Enchantment.Cost> static final Enchantment.Cost -
Constructor Summary
ConstructorsConstructorDescriptionCost(int base, int perLevelAboveFirst) Creates an instance of aCostrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintbase()Returns the value of thebaserecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theperLevelAboveFirstrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
-
CODEC
-
-
Constructor Details
-
Cost
public Cost(int base, int perLevelAboveFirst) Creates an instance of aCostrecord class.- Parameters:
base- the value for thebaserecord componentperLevelAboveFirst- the value for theperLevelAboveFirstrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 with thecomparemethod from their corresponding wrapper classes. -
base
public int base()Returns the value of thebaserecord component.- Returns:
- the value of the
baserecord component
-
perLevelAboveFirst
public int perLevelAboveFirst()Returns the value of theperLevelAboveFirstrecord component.- Returns:
- the value of the
perLevelAboveFirstrecord component
-