Record Class FoodData
java.lang.Object
java.lang.Record
com.zenith.mc.food.FoodData
- All Implemented Interfaces:
RegistryData
public record FoodData(int id, String name, int stackSize, float foodPoints, float saturation, boolean canAlwaysEat, boolean isSafeFood)
extends Record
implements RegistryData
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanAlwaysEatrecord component.final booleanIndicates whether some other object is "equal to" this one.floatReturns the value of thefoodPointsrecord component.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.booleanReturns the value of theisSafeFoodrecord component.name()Returns the value of thenamerecord component.floatReturns the value of thesaturationrecord component.intReturns the value of thestackSizerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FoodData
public FoodData(int id, String name, int stackSize, float foodPoints, float saturation, boolean canAlwaysEat, boolean isSafeFood) Creates an instance of aFoodDatarecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componentstackSize- the value for thestackSizerecord componentfoodPoints- the value for thefoodPointsrecord componentsaturation- the value for thesaturationrecord componentcanAlwaysEat- the value for thecanAlwaysEatrecord componentisSafeFood- the value for theisSafeFoodrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
public int id()Returns the value of theidrecord component.- Specified by:
idin interfaceRegistryData- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceRegistryData- Returns:
- the value of the
namerecord component
-
stackSize
public int stackSize()Returns the value of thestackSizerecord component.- Returns:
- the value of the
stackSizerecord component
-
foodPoints
public float foodPoints()Returns the value of thefoodPointsrecord component.- Returns:
- the value of the
foodPointsrecord component
-
saturation
public float saturation()Returns the value of thesaturationrecord component.- Returns:
- the value of the
saturationrecord component
-
canAlwaysEat
public boolean canAlwaysEat()Returns the value of thecanAlwaysEatrecord component.- Returns:
- the value of the
canAlwaysEatrecord component
-
isSafeFood
public boolean isSafeFood()Returns the value of theisSafeFoodrecord component.- Returns:
- the value of the
isSafeFoodrecord component
-