Record Class ShapedRecipeWrapper
java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.ShapedRecipeWrapper
public record ShapedRecipeWrapper(NamespacedKey key, ItemStack result, List<String> shape, String group, Map<Character,RecipeChoiceWrapper<?>> ingredients)
extends Record
Class for wrapping a
ShapedRecipe
.-
Constructor Summary
ConstructorDescriptionShapedRecipeWrapper
(NamespacedKey key, ItemStack result, List<String> shape, String group, Map<Character, RecipeChoiceWrapper<?>> ingredients) Creates an instance of aShapedRecipeWrapper
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.Returns the value of theingredients
record component.key()
Returns the value of thekey
record component.static ShapedRecipeWrapper
of
(ShapedRecipe recipe) Create a newShapedRecipeWrapper
based on aShapedRecipe
.result()
Returns the value of theresult
record component.shape()
Returns the value of theshape
record component.Constructs a newShapedRecipe
based on wrapper values.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ShapedRecipeWrapper
public ShapedRecipeWrapper(NamespacedKey key, ItemStack result, List<String> shape, String group, Map<Character, RecipeChoiceWrapper<?>> ingredients) Creates an instance of aShapedRecipeWrapper
record class.- Parameters:
key
- the value for thekey
record componentresult
- the value for theresult
record componentshape
- the value for theshape
record componentgroup
- the value for thegroup
record componentingredients
- the value for theingredients
record component
-
-
Method Details
-
of
Create a newShapedRecipeWrapper
based on aShapedRecipe
.- Parameters:
recipe
- recipe instance- Returns:
- new
ShapedRecipeWrapper
instance
-
toBukkitShapedRecipe
Constructs a newShapedRecipe
based on wrapper values.- Returns:
- new
ShapedRecipe
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
-
shape
Returns the value of theshape
record component.- Returns:
- the value of the
shape
record component
-
group
Returns the value of thegroup
record component.- Returns:
- the value of the
group
record component
-
ingredients
Returns the value of theingredients
record component.- Returns:
- the value of the
ingredients
record component
-