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
ConstructorsConstructorDescriptionShapedRecipeWrapper(NamespacedKey key, ItemStack result, List<String> shape, String group, Map<Character, RecipeChoiceWrapper<?>> ingredients) Creates an instance of aShapedRecipeWrapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.group()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theingredientsrecord component.key()Returns the value of thekeyrecord component.static ShapedRecipeWrapperof(ShapedRecipe recipe) Create a newShapedRecipeWrapperbased on aShapedRecipe.result()Returns the value of theresultrecord component.shape()Returns the value of theshaperecord component.Constructs a newShapedRecipebased on wrapper values.final StringtoString()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 aShapedRecipeWrapperrecord class.- Parameters:
key- the value for thekeyrecord componentresult- the value for theresultrecord componentshape- the value for theshaperecord componentgroup- the value for thegrouprecord componentingredients- the value for theingredientsrecord component
-
-
Method Details
-
of
Create a newShapedRecipeWrapperbased on aShapedRecipe.- Parameters:
recipe- recipe instance- Returns:
- new
ShapedRecipeWrapperinstance
-
toBukkitShapedRecipe
Constructs a newShapedRecipebased on wrapper values.- Returns:
- new
ShapedRecipeinstance
-
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 thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
shape
Returns the value of theshaperecord component.- Returns:
- the value of the
shaperecord component
-
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
ingredients
Returns the value of theingredientsrecord component.- Returns:
- the value of the
ingredientsrecord component
-