1 package at.ac.tuwien.sbc.valesriegler.types;
3 import java.io.Serializable;
5 import at.ac.tuwien.sbc.valesriegler.common.HasId;
6 import at.ac.tuwien.sbc.valesriegler.common.Util;
9 * Class denoting one Pizza in the future and its state.
14 public class PizzaOrder implements Serializable, HasId {
15 private static int nextID = 0;
18 protected Integer orderId;
19 protected PizzaType pizzaType;
20 protected PizzaOrderStatus status;
21 protected Integer cookId;
23 protected boolean isDeliveryPizza;
25 public PizzaOrder(PizzaType pizzaType) {
27 this.pizzaType = pizzaType;
28 status = PizzaOrderStatus.NEW;
31 public PizzaOrder(int id) {
38 public void setDeliveryPizza(boolean deliveryPizza) {
39 isDeliveryPizza = deliveryPizza;
42 public boolean isDeliveryPizza() {
43 return isDeliveryPizza;
46 public PizzaType getPizzaType() {
50 public PizzaOrderStatus getStatus() {
58 public int getCookId() {
59 return Util.getIntSafe(cookId);
62 public void setCookId(int cookId) {
66 public void setStatus(PizzaOrderStatus status) {
70 public void setId(Integer id) {
74 public void setPizzaType(PizzaType pizzaType) {
75 this.pizzaType = pizzaType;
80 public int getOrderId() {
81 return Util.getIntSafe(orderId);
84 public void setOrderId(Integer orderId) {
85 this.orderId = orderId;
89 public String toString() {
90 return "PizzaOrder [id=" + id + ", orderId=" + orderId + ", pizzaType="
91 + pizzaType + ", status=" + status + "]";