Record Class MaterialChoiceWrapper
java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.MaterialChoiceWrapper
- All Implemented Interfaces:
RecipeChoiceWrapper<RecipeChoice.MaterialChoice>
public record MaterialChoiceWrapper(List<Material> choices)
extends Record
implements RecipeChoiceWrapper<RecipeChoice.MaterialChoice>
Class for wrapping a
RecipeChoice.MaterialChoice
.-
Constructor Summary
ConstructorDescriptionMaterialChoiceWrapper
(List<Material> choices) Creates an instance of aMaterialChoiceWrapper
record class. -
Method Summary
Modifier and TypeMethodDescriptionchoices()
Returns the value of thechoices
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static MaterialChoiceWrapper
of
(RecipeChoice.MaterialChoice choice) Create a newMaterialChoiceWrapper
based on aRecipeChoice.MaterialChoice
.Constructs a newRecipeChoice.MaterialChoice
based on wrapper values.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
MaterialChoiceWrapper
Creates an instance of aMaterialChoiceWrapper
record class.- Parameters:
choices
- the value for thechoices
record component
-
-
Method Details
-
of
Create a newMaterialChoiceWrapper
based on aRecipeChoice.MaterialChoice
.- Parameters:
choice
- choice instance- Returns:
- new
MaterialChoiceWrapper
instance
-
toBukkitRecipeChoice
Constructs a newRecipeChoice.MaterialChoice
based on wrapper values.- Specified by:
toBukkitRecipeChoice
in interfaceRecipeChoiceWrapper<RecipeChoice.MaterialChoice>
- Returns:
- new
RecipeChoice.MaterialChoice
instance
-
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 withObjects::equals(Object,Object)
. -
choices
Returns the value of thechoices
record component.- Returns:
- the value of the
choices
record component
-