Class Recipe

java.lang.Object
com.cis.gorecipe.model.Recipe

@Entity public class Recipe extends Object
This class allows GoRecipe to store the recipes that will power the core feature of the application
  • Field Details

    • id

      private Long id
    • prepTime

      private Integer prepTime
      How many minutes does the recipe take to prepare
    • spoonacularId

      private Long spoonacularId
      If the recipe was sourced from the Spoonacular API, what is their ID for it
    • name

      private String name
      The unique recipe name (e.g. French Onion Soup), also serves as PK
    • instructions

      private String instructions
      The formatted text containing the recipe instructions
    • ingredients

      private List<Ingredient> ingredients
      The list of ingredients to be used in the recipe
    • verboseIngredients

      private List<String> verboseIngredients
      This collection stores the ingredient names and quantities
    • imageURL

      private String imageURL
      An optional hyperlink to an image of the prepared recipe
    • videoURL

      private String videoURL
      An optional hyperlink to a 3rd party video demonstrating the recipe
    • sourceURL

      private String sourceURL
      The hyperlink to where the recipe is from (e.g. NYT Cooking, AllRecipes, Bon Appétit, etc.)
  • Constructor Details

    • Recipe

      public Recipe()
  • Method Details

    • addIngredient

      public Recipe addIngredient(Ingredient ingredient)
      Parameters:
      ingredient - an ingredient to be added to the recipe's ingredient list
      Returns:
      the recipe object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object