Class InventoryItem

java.lang.Object
csce331.group13.project2.models.InventoryItem

public class InventoryItem extends Object
Represents an inventory item in the system. Stores information about stock levels, unit costs, and availability.
Author:
Varish Kongara
  • Constructor Details

    • InventoryItem

      public InventoryItem()
      Default constructor for InventoryItem.
    • InventoryItem

      public InventoryItem(UUID itemId, String item, String unit, BigDecimal stock, BigDecimal unitCost, boolean available)
      Constructs an InventoryItem with all fields specified.
      Parameters:
      itemId - The unique identifier for the inventory item.
      item - The name of the inventory item.
      unit - The unit of measurement (e.g., "lbs", "oz", "count").
      stock - The current stock quantity.
      unitCost - The cost per unit.
      available - Whether the item is currently available.
    • InventoryItem

      public InventoryItem(String item, String unit, BigDecimal stock, BigDecimal unitCost, boolean available)
      Constructs an InventoryItem with a newly generated UUID.
      Parameters:
      item - The name of the inventory item.
      unit - The unit of measurement (e.g., "lbs", "oz", "count").
      stock - The current stock quantity.
      unitCost - The cost per unit.
      available - Whether the item is currently available.
  • Method Details

    • getItemId

      public UUID getItemId()
      Gets the inventory item's unique identifier.
      Returns:
      The item ID.
    • setItemId

      public void setItemId(UUID itemId)
      Sets the inventory item's unique identifier.
      Parameters:
      itemId - The new item ID.
    • getItem

      public String getItem()
      Gets the inventory item's name.
      Returns:
      The item name.
    • setItem

      public void setItem(String item)
      Sets the inventory item's name.
      Parameters:
      item - The new item name.
    • getUnit

      public String getUnit()
      Gets the unit of measurement for this item.
      Returns:
      The unit (e.g., "lbs", "oz", "count").
    • setUnit

      public void setUnit(String unit)
      Sets the unit of measurement for this item.
      Parameters:
      unit - The new unit.
    • getStock

      public BigDecimal getStock()
      Gets the current stock quantity.
      Returns:
      The stock quantity.
    • setStock

      public void setStock(BigDecimal stock)
      Sets the current stock quantity.
      Parameters:
      stock - The new stock quantity.
    • getUnitCost

      public BigDecimal getUnitCost()
      Gets the cost per unit.
      Returns:
      The unit cost.
    • setUnitCost

      public void setUnitCost(BigDecimal unitCost)
      Sets the cost per unit.
      Parameters:
      unitCost - The new unit cost.
    • isAvailable

      public boolean isAvailable()
      Checks if the inventory item is currently available.
      Returns:
      true if available; false otherwise.
    • setAvailable

      public void setAvailable(boolean available)
      Sets the availability status of the inventory item.
      Parameters:
      available - The new availability status.
    • toString

      public String toString()
      Overrides:
      toString in class Object