Record Class RecipePreviewContext.Selection

java.lang.Object
java.lang.Record
ke.ric.cooking.data.RecipePreviewContext.Selection
Enclosing class:
RecipePreviewContext

public static record RecipePreviewContext.Selection(int recipeSlot, int optionIndex, RecipeItemRef itemRef, String qualifier, String customTag, int quantity) extends Record
  • Constructor Details

    • Selection

      public Selection(int recipeSlot, int optionIndex, RecipeItemRef itemRef, String qualifier, String customTag, int quantity)
      Creates an instance of a Selection record class.
      Parameters:
      recipeSlot - the value for the recipeSlot record component
      optionIndex - the value for the optionIndex record component
      itemRef - the value for the itemRef record component
      qualifier - the value for the qualifier record component
      customTag - the value for the customTag record component
      quantity - the value for the quantity record component
  • Method Details

    • of

      public static RecipePreviewContext.Selection of(int slot, int optionIndex, IngredientOption option, int quantity)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • recipeSlot

      public int recipeSlot()
      Returns the value of the recipeSlot record component.
      Returns:
      the value of the recipeSlot record component
    • optionIndex

      public int optionIndex()
      Returns the value of the optionIndex record component.
      Returns:
      the value of the optionIndex record component
    • itemRef

      public RecipeItemRef itemRef()
      Returns the value of the itemRef record component.
      Returns:
      the value of the itemRef record component
    • qualifier

      public String qualifier()
      Returns the value of the qualifier record component.
      Returns:
      the value of the qualifier record component
    • customTag

      public String customTag()
      Returns the value of the customTag record component.
      Returns:
      the value of the customTag record component
    • quantity

      public int quantity()
      Returns the value of the quantity record component.
      Returns:
      the value of the quantity record component