Record Class ShapelessRecipeWrapper
java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.ShapelessRecipeWrapper
public record ShapelessRecipeWrapper(NamespacedKey key, ItemStack result, String group, List<? extends RecipeChoiceWrapper<?>> choiceList)
extends Record
Class for wrapping a
ShapelessRecipe
.-
Constructor Summary
ConstructorDescriptionShapelessRecipeWrapper
(NamespacedKey key, ItemStack result, String group, List<? extends RecipeChoiceWrapper<?>> choiceList) Creates an instance of aShapelessRecipeWrapper
record class. -
Method Summary
Modifier and TypeMethodDescriptionList<? extends RecipeChoiceWrapper<?>>
Returns the value of thechoiceList
record component.final boolean
Indicates whether some other object is "equal to" this one.group()
Returns the value of thegroup
record component.final int
hashCode()
Returns a hash code value for this object.key()
Returns the value of thekey
record component.static ShapelessRecipeWrapper
of
(ShapelessRecipe recipe) Create a newShapelessRecipeWrapper
based on aShapelessRecipe
.result()
Returns the value of theresult
record component.Constructs a newShapelessRecipe
based on wrapper values.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ShapelessRecipeWrapper
public ShapelessRecipeWrapper(NamespacedKey key, ItemStack result, String group, List<? extends RecipeChoiceWrapper<?>> choiceList) Creates an instance of aShapelessRecipeWrapper
record class.- Parameters:
key
- the value for thekey
record componentresult
- the value for theresult
record componentgroup
- the value for thegroup
record componentchoiceList
- the value for thechoiceList
record component
-
-
Method Details
-
of
Create a newShapelessRecipeWrapper
based on aShapelessRecipe
.- Parameters:
recipe
- recipe instance- Returns:
- new
ShapelessRecipeWrapper
instance
-
toBukkitShapelessRecipe
Constructs a newShapelessRecipe
based on wrapper values.- Returns:
- new
ShapelessRecipe
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)
. -
key
Returns the value of thekey
record component.- Returns:
- the value of the
key
record component
-
result
Returns the value of theresult
record component.- Returns:
- the value of the
result
record component
-
group
Returns the value of thegroup
record component.- Returns:
- the value of the
group
record component
-
choiceList
Returns the value of thechoiceList
record component.- Returns:
- the value of the
choiceList
record component
-