]> git.somenet.org - pub/jan/sbc.git/blob - src/main/java/at/ac/tuwien/sbc/valesriegler/types/PizzaOrder.java
Some UI Fixes in PizzeriaGUI inter-table communication.
[pub/jan/sbc.git] / src / main / java / at / ac / tuwien / sbc / valesriegler / types / PizzaOrder.java
1 package at.ac.tuwien.sbc.valesriegler.types;
2
3 import java.io.Serializable;
4
5 import at.ac.tuwien.sbc.valesriegler.common.HasId;
6 import at.ac.tuwien.sbc.valesriegler.common.Util;
7
8 /**
9  * Class denoting one Pizza in the future and its state.
10  * 
11  * @author jan
12  * 
13  */
14 public class PizzaOrder implements Serializable, HasId {
15         private static int nextID = 0;
16         protected Integer id;
17
18         protected Integer orderId;
19         protected PizzaType pizzaType;
20         protected PizzaOrderStatus status;
21         protected Integer cookId;
22
23     protected boolean isDeliveryPizza;
24
25         public PizzaOrder(PizzaType pizzaType) {
26                 id = ++nextID;
27                 this.pizzaType = pizzaType;
28                 status = PizzaOrderStatus.NEW;
29         }
30
31         public PizzaOrder(int id) {
32                 this.id = id;
33         }
34
35         public PizzaOrder() {
36         }
37
38     public void setDeliveryPizza(boolean deliveryPizza) {
39         isDeliveryPizza = deliveryPizza;
40     }
41
42     public boolean isDeliveryPizza() {
43         return isDeliveryPizza;
44     }
45
46         public PizzaType getPizzaType() {
47                 return pizzaType;
48         }
49
50         public PizzaOrderStatus getStatus() {
51                 return status;
52         }
53
54         public int getId() {
55                 return id;
56         }
57
58         public int getCookId() {
59                 return Util.getIntSafe(cookId);
60         }
61
62         public void setCookId(int cookId) {
63                 this.cookId = cookId;
64         }
65
66         public void setStatus(PizzaOrderStatus status) {
67                 this.status = status;
68         }
69
70         public void setId(Integer id) {
71                 this.id = id;
72         }
73
74         public void setPizzaType(PizzaType pizzaType) {
75                 this.pizzaType = pizzaType;
76         }
77
78
79
80         public int getOrderId() {
81                 return Util.getIntSafe(orderId);
82         }
83
84         public void setOrderId(Integer orderId) {
85                 this.orderId = orderId;
86         }
87
88         @Override
89         public String toString() {
90                 return "PizzaOrder [id=" + id + ", orderId=" + orderId + ", pizzaType="
91                                 + pizzaType + ", status=" + status + "]";
92         }
93
94 }