Record Class RestaurantsData.RestaurantData
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.world.restaurant.RestaurantsData.RestaurantData
- Enclosing class:
RestaurantsData
public static record RestaurantsData.RestaurantData(int ordersTaken, int ordersFulfilled, int xp, Optional<String> customName, List<IRestaurantOrder> menu)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RestaurantsData.RestaurantData> -
Constructor Summary
ConstructorsConstructorDescriptionRestaurantData(int ordersTaken, int ordersFulfilled, int xp, Optional<String> customName, List<IRestaurantOrder> menu) Creates an instance of aRestaurantDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecustomNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.menu()Returns the value of themenurecord component.protected RestaurantsData.RestaurantData.Mutablemutable()intReturns the value of theordersFulfilledrecord component.intReturns the value of theordersTakenrecord component.final StringtoString()Returns a string representation of this record class.intxp()Returns the value of thexprecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
RestaurantData
public RestaurantData() -
RestaurantData
public RestaurantData(int ordersTaken, int ordersFulfilled, int xp, Optional<String> customName, List<IRestaurantOrder> menu) Creates an instance of aRestaurantDatarecord class.- Parameters:
ordersTaken- the value for theordersTakenrecord componentordersFulfilled- the value for theordersFulfilledrecord componentxp- the value for thexprecord componentcustomName- the value for thecustomNamerecord componentmenu- the value for themenurecord component
-
-
Method Details
-
mutable
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
ordersTaken
public int ordersTaken()Returns the value of theordersTakenrecord component.- Returns:
- the value of the
ordersTakenrecord component
-
ordersFulfilled
public int ordersFulfilled()Returns the value of theordersFulfilledrecord component.- Returns:
- the value of the
ordersFulfilledrecord component
-
xp
public int xp()Returns the value of thexprecord component.- Returns:
- the value of the
xprecord component
-
customName
Returns the value of thecustomNamerecord component.- Returns:
- the value of the
customNamerecord component
-