Record Class MenuInventory

java.lang.Object
java.lang.Record
csce331.group13.project2.models.MenuInventory
Record Components:
menuItemId - The UUID of the menu item.
inventoryItemId - The UUID of the inventory item.
qtyPerUnit - The quantity of the inventory item needed per menu item unit.

public record MenuInventory(UUID menuItemId, UUID inventoryItemId, BigDecimal qtyPerUnit) extends Record
Represents the relationship between a menu item and an inventory item. Indicates how much of an inventory item is needed to make one unit of a menu item.
Author:
Varish Kongara
  • Constructor Details

    • MenuInventory

      public MenuInventory(UUID menuItemId, UUID inventoryItemId, BigDecimal qtyPerUnit)
      Creates an instance of a MenuInventory record class.
      Parameters:
      menuItemId - the value for the menuItemId record component
      inventoryItemId - the value for the inventoryItemId record component
      qtyPerUnit - the value for the qtyPerUnit record component
  • Method Details

    • 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.
    • inventoryItemId

      public UUID inventoryItemId()
      Returns the value of the inventoryItemId record component.
      Returns:
      the value of the inventoryItemId record component
    • qtyPerUnit

      public BigDecimal qtyPerUnit()
      Returns the value of the qtyPerUnit record component.
      Returns:
      the value of the qtyPerUnit record component