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
ConstructorsConstructorDescriptionShapelessRecipeWrapper(NamespacedKey key, ItemStack result, String group, List<? extends RecipeChoiceWrapper<?>> choiceList) Creates an instance of aShapelessRecipeWrapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<? extends RecipeChoiceWrapper<?>> Returns the value of thechoiceListrecord component.final 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.key()Returns the value of thekeyrecord component.static ShapelessRecipeWrapperof(ShapelessRecipe recipe) Create a newShapelessRecipeWrapperbased on aShapelessRecipe.result()Returns the value of theresultrecord component.Constructs a newShapelessRecipebased on wrapper values.final StringtoString()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 aShapelessRecipeWrapperrecord class.- Parameters:
key- the value for thekeyrecord componentresult- the value for theresultrecord componentgroup- the value for thegrouprecord componentchoiceList- the value for thechoiceListrecord component
-
-
Method Details
-
of
Create a newShapelessRecipeWrapperbased on aShapelessRecipe.- Parameters:
recipe- recipe instance- Returns:
- new
ShapelessRecipeWrapperinstance
-
toBukkitShapelessRecipe
Constructs a newShapelessRecipebased on wrapper values.- Returns:
- new
ShapelessRecipeinstance
-
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
-
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
choiceList
Returns the value of thechoiceListrecord component.- Returns:
- the value of the
choiceListrecord component
-