Class Recipe
java.lang.Object
edu.ntnu.stud.idatt1005.team3.model.Recipe
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA method to get the allergies the recipe contains.int
A method to get the time it takes to cook the recipe.int
getId()
A method to get the id of the recipe.A method to get the ingredients in the recipe.A method to get the instructions for the recipe.A method to get the name of the recipe.int
A method to get the number of servings the recipe makes.void
setAllergies
(ArrayList<String> allergies) A method to set the allergies the recipe contains.void
setCookTime
(int cookTime) A method to set the time it takes to cook the recipe.void
setId
(int id) A method to set the id of the recipe.void
setIngredients
(ArrayList<FoodItem> ingredients) A method to set the ingredients in the recipe.void
setRecipeInstructions
(ArrayList<String> recipeInstructions) A method to set the instructions for the recipe.void
setRecipeName
(String recipeName) A method to set the name of the recipe.void
setServings
(int servings) A method to set the number of servings the recipe makes.toString()
-
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 reciperecipeName
- 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
A method to get the name of the recipe.- Returns:
- The name of the recipe.
-
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
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
A method to get the ingredients in the recipe.- Returns:
- The ingredients in the recipe.
-
setRecipeName
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
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
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
A method to set the ingredients in the recipe.- Parameters:
ingredients
- The ingredients in the recipe.
-
toString
-