-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPizzaStore.java
71 lines (60 loc) · 1.7 KB
/
PizzaStore.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.gowthamrajk.pizzastore;
import java.util.List;
import java.util.ArrayList;
public class PizzaStore {
private int storeId;
private String storeName;
private String storeLocation;
private List<Pizza> pizzas = new ArrayList<>();
private List<Customer> customers = new ArrayList<>();
public PizzaStore() { }
public PizzaStore(int storeId, String storeName, String storeLocation) {
this.storeId = storeId;
this.storeName = storeName;
this.storeLocation = storeLocation;
}
public void addPizza(Pizza pizza) {
this.pizzas.add(pizza);
}
public void addCustomer(Customer customer) {
this.customers.add(customer);
}
public void deletePizza(Pizza pizza) {
this.pizzas.remove(pizza);
}
public int getStoreId() {
return storeId;
}
public void setStoreId(int storeId) {
this.storeId = storeId;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getStoreLocation() {
return storeLocation;
}
public void setStoreLocation(String storeLocation) {
this.storeLocation = storeLocation;
}
public List<Pizza> getPizzas() {
return pizzas;
}
public void setPizzas(List<Pizza> pizzas) {
this.pizzas = pizzas;
}
public List<Customer> getCustomers() {
return customers;
}
public void setCustomers(List<Customer> customers) {
this.customers = customers;
}
@Override
public String toString() {
return "\nPizzaStore Details => ID : " + storeId + ", Store Name : " + storeName + ", Location : "
+ storeLocation + "\n\nAvailable Pizzas : \n" + pizzas + "\n\nAvailable Orders : \n" + customers;
}
}