Class Order.Meal

java.lang.Object
csce331.group13.project2.models.Order.Meal
Enclosing class:
Order

public static class Order.Meal extends Object
Represents a meal in an order, which can consist of a combo, side, entrees, drinks, and add-ons. Note that drinks and add-ons do not have to be associated with combos.
Author:
Varish Kongara, William Clymire
  • Constructor Details

    • Meal

      public Meal(String combo, String side, List<String> entrees, List<String> drinks, List<String> addOns)
      Constructs a Meal with the specified components. Meals can contain a combo (combo type, entrees, and sides), drinks, and/or add-ons.
      Parameters:
      combo - The combo name (can be null).
      side - The side name (can be null).
      entrees - The list of entree names.
      drinks - The list of drink names.
      addOns - The list of add-on names.
  • Method Details

    • getCombo

      public String getCombo()
      Gets the combo name.
      Returns:
      The combo name (can be null).
    • getSide

      public String getSide()
      Gets the side name.
      Returns:
      The side name (can be null).
    • getEntrees

      public List<String> getEntrees()
      Gets the list of entree names.
      Returns:
      The list of entrees.
    • getDrinks

      public List<String> getDrinks()
      Gets the list of drink names.
      Returns:
      The list of drinks.
    • getAddOns

      public List<String> getAddOns()
      Gets the list of add-on names.
      Returns:
      The list of add-ons.
    • getTotalPrice

      public BigDecimal getTotalPrice()
      Calculates the total price of this meal by summing up the costs of all components.
      Returns:
      The total price of the meal.
    • toString

      public String toString()
      Overrides:
      toString in class Object