Class Recipe

java.lang.Object
edu.ntnu.stud.idatt1005.team3.model.Recipe

public class Recipe extends Object
This class represents a recipe. It contains information about the recipe, such as name, instructions, servings, allergies, cook time and ingredients.
Since:
0.1
Version:
0.2
Author:
augustrb
  • Constructor Details

    • Recipe

      public Recipe(int id, String recipeName, ArrayList<String> recipeInstructions, int servings, ArrayList<String> allergies, int cookTime, ArrayList<FoodItem> ingredients)
      Constructor for the Recipe class.
      Parameters:
      id - The id of the recipe
      recipeName - The name of the recipe.
      recipeInstructions - The instructions for the recipe.
      servings - The number of servings the recipe makes.
      allergies - The allergies the recipe contains.
      cookTime - The time it takes to cook the recipe.
      ingredients - The ingredients in the recipe.
  • Method Details

    • getId

      public int getId()
      A method to get the id of the recipe.
      Returns:
      The id of the recipe.
    • getRecipeName

      public String getRecipeName()
      A method to get the name of the recipe.
      Returns:
      The name of the recipe.
    • getRecipeInstructions

      public ArrayList<String> getRecipeInstructions()
      A method to get the instructions for the recipe.
      Returns:
      The instructions for the recipe.
    • getServings

      public int getServings()
      A method to get the number of servings the recipe makes.
      Returns:
      The number of servings the recipe makes.
    • getAllergies

      public ArrayList<String> getAllergies()
      A method to get the allergies the recipe contains.
      Returns:
      The allergies the recipe contains.
    • getCookTime

      public int getCookTime()
      A method to get the time it takes to cook the recipe.
      Returns:
      The time it takes to cook the recipe.
    • getIngredients

      public ArrayList<FoodItem> getIngredients()
      A method to get the ingredients in the recipe.
      Returns:
      The ingredients in the recipe.
    • setRecipeName

      public void setRecipeName(String recipeName)
      A method to set the name of the recipe.
      Parameters:
      recipeName - The name of the recipe.
    • setId

      public void setId(int id)
      A method to set the id of the recipe.
      Parameters:
      id - The name of the recipe.
    • setRecipeInstructions

      public void setRecipeInstructions(ArrayList<String> recipeInstructions)
      A method to set the instructions for the recipe.
      Parameters:
      recipeInstructions - The instructions for the recipe.
    • setServings

      public void setServings(int servings)
      A method to set the number of servings the recipe makes.
      Parameters:
      servings - The number of servings the recipe makes.
    • setAllergies

      public void setAllergies(ArrayList<String> allergies)
      A method to set the allergies the recipe contains.
      Parameters:
      allergies - The allergies the recipe contains.
    • setCookTime

      public void setCookTime(int cookTime)
      A method to set the time it takes to cook the recipe.
      Parameters:
      cookTime - The time it takes to cook the recipe.
    • setIngredients

      public void setIngredients(ArrayList<FoodItem> ingredients)
      A method to set the ingredients in the recipe.
      Parameters:
      ingredients - The ingredients in the recipe.
    • toString

      public String toString()
      Overrides:
      toString in class Object