Class Inventory

java.lang.Object
edu.ntnu.stud.model.Inventory

public class Inventory extends Object
The Inventory class is responsible for managing the inventory of ingredients.
  • Constructor Details

    • Inventory

      public Inventory()
  • Method Details

    • reduceInventoryByRecipe

      public static void reduceInventoryByRecipe(String recipeName)
      Adds a recipe to the inventory by reading the recipe from cookbook.json and adding it to inventory.json.
      Parameters:
      recipeName - The name of the recipe to add to the inventory
    • getInventory

      public static List<Ingredient> getInventory()
      Get the inventory list from inventory.json.
      Returns:
      The inventory list
    • showInventoryWithoutZero

      public static Collection<javafx.util.Pair<String,String>> showInventoryWithoutZero(List<Ingredient> inventory)
      Get the inventory list from inventory.json without ingredients with quantity 0.
      Returns:
      The inventory list without ingredients with quantity 0
    • clearInventory

      public static void clearInventory()
      Clear the inventory by removing all ingredients from inventory.json.