Record Class ComplexRecipeImpl

java.lang.Object
java.lang.Record
dev.jorel.commandapi.wrappers.ComplexRecipeImpl
Record Components:
key - the namespaced key
recipe - the recipe
All Implemented Interfaces:
net.kyori.adventure.key.Keyed, org.bukkit.inventory.ComplexRecipe, org.bukkit.inventory.Recipe, org.bukkit.Keyed

public record ComplexRecipeImpl(org.bukkit.NamespacedKey key, org.bukkit.inventory.Recipe recipe) extends Record implements org.bukkit.inventory.ComplexRecipe
Creates a ComplexRecipe based on a NamespacedKey and a Recipe object.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ComplexRecipeImpl(org.bukkit.NamespacedKey key, org.bukkit.inventory.Recipe recipe)
    Creates an instance of a ComplexRecipeImpl record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NotNull org.bukkit.NamespacedKey
    Return the namespaced identifier for this object.
    @NotNull org.bukkit.inventory.ItemStack
    Get the result of this recipe.
    final int
    Returns a hash code value for this object.
    org.bukkit.NamespacedKey
    key()
    Returns the value of the key record component.
    org.bukkit.inventory.Recipe
    Returns the value of the recipe record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ComplexRecipeImpl

      public ComplexRecipeImpl(org.bukkit.NamespacedKey key, org.bukkit.inventory.Recipe recipe)
      Creates an instance of a ComplexRecipeImpl record class.
      Parameters:
      key - the value for the key record component
      recipe - the value for the recipe record component
  • Method Details

    • getResult

      @NotNull public @NotNull org.bukkit.inventory.ItemStack getResult()
      Get the result of this recipe.
      Specified by:
      getResult in interface org.bukkit.inventory.Recipe
      Returns:
      The result stack
    • getKey

      @NotNull public @NotNull org.bukkit.NamespacedKey getKey()
      Return the namespaced identifier for this object.
      Specified by:
      getKey in interface org.bukkit.Keyed
      Returns:
      this object's key
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • key

      public org.bukkit.NamespacedKey key()
      Returns the value of the key record component.
      Specified by:
      key in interface net.kyori.adventure.key.Keyed
      Specified by:
      key in interface org.bukkit.Keyed
      Returns:
      the value of the key record component
    • recipe

      public org.bukkit.inventory.Recipe recipe()
      Returns the value of the recipe record component.
      Returns:
      the value of the recipe record component