Record Class ItemDefaults.Properties
java.lang.Object
java.lang.Record
fr.fidorial.item.ItemDefaults.Properties
- Record Components:
maxStackSize- how many of this item fit in one slotmaxDamage- total durability,0when the item cannot breakequipmentSlot- where the item is worn,nullwhen it cannot be
- Enclosing class:
ItemDefaults
public static record ItemDefaults.Properties(int maxStackSize, int maxDamage, @Nullable EquipmentSlot equipmentSlot)
extends Record
An item's defaults.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionProperties(int maxStackSize, int maxDamage) Defaults for an item that cannot be worn.Properties(int maxStackSize, int maxDamage, @Nullable EquipmentSlot equipmentSlot) Creates an instance of aPropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theequipmentSlotrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxDamagerecord component.intReturns the value of themaxStackSizerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Properties
Creates an instance of aPropertiesrecord class.- Parameters:
maxStackSize- the value for themaxStackSizerecord componentmaxDamage- the value for themaxDamagerecord componentequipmentSlot- the value for theequipmentSlotrecord component
-
Properties
public Properties(int maxStackSize, int maxDamage) Defaults for an item that cannot be worn.- Parameters:
maxStackSize- how many of this item fit in one slotmaxDamage- total durability,0when the item cannot break
-
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
maxStackSize
public int maxStackSize()Returns the value of themaxStackSizerecord component.- Returns:
- the value of the
maxStackSizerecord component
-
maxDamage
-
equipmentSlot
Returns the value of theequipmentSlotrecord component.- Returns:
- the value of the
equipmentSlotrecord component
-