]> git.somenet.org - pub/jan/sbc.git/blob - src/main/java/at/ac/tuwien/sbc/valesriegler/types/PizzaOrder.java
GUI fix for Tables OutOfBoundsException
[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 at.ac.tuwien.sbc.valesriegler.common.HasId;
4 import at.ac.tuwien.sbc.valesriegler.common.Util;
5
6 import java.io.Serializable;
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     protected Boolean isDeliveryPizza;
23
24     public PizzaOrder(PizzaType pizzaType) {
25                 id = ++nextID;
26                 this.pizzaType = pizzaType;
27                 status = PizzaOrderStatus.NEW;
28         }
29
30         public PizzaOrder(int id) {
31                 this.id = id;
32         }
33
34         public PizzaOrder() {
35         }
36
37     public PizzaType getPizzaType() {
38                 return pizzaType;
39         }
40
41     public Boolean getDeliveryPizza() {
42         return isDeliveryPizza;
43     }
44
45         public PizzaOrderStatus getStatus() {
46                 return status;
47         }
48
49     public void setDeliveryPizza(Boolean deliveryPizza) {
50         isDeliveryPizza = deliveryPizza;
51     }
52
53         public int getId() {
54                 return id;
55         }
56
57         public int getCookId() {
58                 return Util.getIntSafe(cookId);
59         }
60
61         public void setCookId(int cookId) {
62                 this.cookId = cookId;
63         }
64
65         public void setStatus(PizzaOrderStatus status) {
66                 this.status = status;
67         }
68
69         public void setId(Integer id) {
70                 this.id = id;
71         }
72
73         public void setPizzaType(PizzaType pizzaType) {
74                 this.pizzaType = pizzaType;
75         }
76
77
78
79         public int getOrderId() {
80                 return Util.getIntSafe(orderId);
81         }
82
83         public void setOrderId(Integer orderId) {
84                 this.orderId = orderId;
85         }
86
87         @Override
88         public String toString() {
89                 return "PizzaOrder [id=" + id + ", orderId=" + orderId + ", pizzaType="
90                                 + pizzaType + ", status=" + status + "]";
91         }
92
93 }