Class MenuItem
java.lang.Object
csce331.group13.project2.models.MenuItem
Represents a menu item in the restaurant system.
Menu items are categorized as Combo, Entree, Side, Drink, or AddOn.
- Author:
- Varish Kongara
-
Constructor Summary
ConstructorsConstructorDescriptionMenuItem()Default constructor for MenuItem.MenuItem(String name, BigDecimal cost, String category, boolean isActive) Constructs a MenuItem with a newly generated UUID.MenuItem(UUID menuItemId, String name, BigDecimal cost, String category, boolean isActive) Constructs a MenuItem with all fields specified. -
Method Summary
Modifier and TypeMethodDescriptionGets the menu item's category.getCost()Gets the menu item's price.Gets the menu item's unique identifier.getName()Gets the menu item's name.booleanisActive()Checks if the menu item is currently active.voidsetActive(boolean active) Sets the menu item's active status.voidsetCategory(String category) Sets the menu item's category.voidsetCost(BigDecimal cost) Sets the menu item's price.voidsetMenuItemId(UUID menuItemId) Sets the menu item's unique identifier.voidSets the menu item's name.toString()
-
Constructor Details
-
MenuItem
public MenuItem()Default constructor for MenuItem. -
MenuItem
Constructs a MenuItem with all fields specified.- Parameters:
menuItemId- The unique identifier for the menu item.name- The name of the menu item.cost- The price of the menu item.category- The category (Combo, Entree, Side, Drink, AddOn).isActive- Whether the item is currently available on the menu.
-
MenuItem
Constructs a MenuItem with a newly generated UUID.- Parameters:
name- The name of the menu item.cost- The price of the menu item.category- The category (Combo, Entree, Side, Drink, AddOn).isActive- Whether the item is currently available on the menu.
-
-
Method Details
-
getMenuItemId
-
setMenuItemId
Sets the menu item's unique identifier.- Parameters:
menuItemId- The new menu item ID.
-
getName
-
setName
-
getCost
-
setCost
Sets the menu item's price.- Parameters:
cost- The new item cost.
-
getCategory
Gets the menu item's category.- Returns:
- The category (Combo, Entree, Side, Drink, AddOn).
-
setCategory
Sets the menu item's category.- Parameters:
category- The new category.
-
isActive
public boolean isActive()Checks if the menu item is currently active.- Returns:
- true if the item is active; false otherwise.
-
setActive
public void setActive(boolean active) Sets the menu item's active status.- Parameters:
active- The new active status.
-
toString
-