Record Class JavaFoodPropertiesImpl
java.lang.Object
java.lang.Record
org.geysermc.geyser.item.custom.impl.JavaFoodPropertiesImpl
- All Implemented Interfaces:
org.geysermc.geyser.api.item.custom.v2.component.java.JavaFoodProperties
public record JavaFoodPropertiesImpl(int nutrition, float saturation, boolean canAlwaysEat)
extends Record
implements org.geysermc.geyser.api.item.custom.v2.component.java.JavaFoodProperties
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionJavaFoodPropertiesImpl(int nutrition, float saturation, boolean canAlwaysEat) Creates an instance of aJavaFoodPropertiesImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanAlwaysEatrecord 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 thenutritionrecord component.floatReturns the value of thesaturationrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
JavaFoodPropertiesImpl
public JavaFoodPropertiesImpl(int nutrition, float saturation, boolean canAlwaysEat) Creates an instance of aJavaFoodPropertiesImplrecord class.- Parameters:
nutrition- the value for thenutritionrecord componentsaturation- the value for thesaturationrecord componentcanAlwaysEat- the value for thecanAlwaysEatrecord component
-
-
Method Details
-
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 with '=='. -
nutrition
public int nutrition()Returns the value of thenutritionrecord component.- Specified by:
nutritionin interfaceorg.geysermc.geyser.api.item.custom.v2.component.java.JavaFoodProperties- Returns:
- the value of the
nutritionrecord component
-
saturation
public float saturation()Returns the value of thesaturationrecord component.- Specified by:
saturationin interfaceorg.geysermc.geyser.api.item.custom.v2.component.java.JavaFoodProperties- Returns:
- the value of the
saturationrecord component
-
canAlwaysEat
public boolean canAlwaysEat()Returns the value of thecanAlwaysEatrecord component.- Specified by:
canAlwaysEatin interfaceorg.geysermc.geyser.api.item.custom.v2.component.java.JavaFoodProperties- Returns:
- the value of the
canAlwaysEatrecord component
-