]> git.somenet.org - pub/jan/sbc.git/blob - src/main/java/at/ac/tuwien/sbc/valesriegler/types/PizzaOrder.java
Space cooks prepare pizzas and Pizzeria GUI shows that
[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 int cookId;
22
23         public PizzaOrder(PizzaType pizzaType) {
24                 id = ++nextID;
25                 this.pizzaType = pizzaType;
26                 status = PizzaOrderStatus.NEW;
27         }
28         
29         public PizzaOrder(int id) {
30                 this.id = id;           
31         }
32
33         public PizzaType getPizzaType() {
34                 return pizzaType;
35         }
36
37         public PizzaOrderStatus getStatus() {
38                 return status;
39         }
40
41         public int getId() {
42                 return id;
43         }
44
45         public int getCookId() {
46                 return cookId;
47         }
48
49         public void setCookId(int cookId) {
50                 this.cookId = cookId;
51         }
52
53         public void setStatus(PizzaOrderStatus status) {
54                 this.status = status;
55         }
56
57         public void setId(Integer id) {
58                 this.id = id;
59         }
60
61         public void setPizzaType(PizzaType pizzaType) {
62                 this.pizzaType = pizzaType;
63         }
64
65
66
67         public int getOrderId() {
68                 return Util.getIntSafe(orderId);
69         }
70
71         public void setOrderId(Integer orderId) {
72                 this.orderId = orderId;
73         }
74
75         @Override
76         public String toString() {
77                 return "PizzaOrder [id=" + id + ", orderId=" + orderId + ", pizzaType="
78                                 + pizzaType + ", status=" + status + "]";
79         }
80
81 }