From b3bd5c611c56d99de5a6c1c4632158b3037f5f57 Mon Sep 17 00:00:00 2001 From: Erik Hohlfeld Date: Fri, 10 Nov 2023 18:34:45 +0100 Subject: [PATCH] Add getters and setters for CustomProduct --- .../catering/orderCatalog/CustomProduct.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/main/java/catering/orderCatalog/CustomProduct.java diff --git a/src/main/java/catering/orderCatalog/CustomProduct.java b/src/main/java/catering/orderCatalog/CustomProduct.java new file mode 100644 index 0000000..ac0398b --- /dev/null +++ b/src/main/java/catering/orderCatalog/CustomProduct.java @@ -0,0 +1,33 @@ +package catering.orderCatalog; + +public class CustomProduct { + private static int itemIdCounter; + private int itemId; + private String name; + private int amount; + private double cost; + + public CustomProduct(String name, int amount, double cost) { + this.itemId = itemIdCounter; + itemIdCounter++; + this.name = name; + this.amount = amount; + this.cost = cost; + } + + public String getName() { + return name; + } + + public int getAmount() { + return amount; + } + + public double getCost() { + return cost; + } + + public int getItemId() { + return itemId; + } +}