1 package at.ac.tuwien.sbc.valesriegler.types;
3 import java.io.Serializable;
5 import at.ac.tuwien.sbc.valesriegler.common.Util;
6 import at.ac.tuwien.sbc.valesriegler.waiter.Waiter;
9 * this is a PIZZA! omnomnomnom
14 public class Pizza extends PizzaOrder implements Serializable {
15 public Waiter deliveryAgent;
18 * Yes that's funny! the pizza has a field idOfOrder although PizzaOrder
19 * already has a field orderId! The reason: The space linda selection is a
20 * little bit limited. when I look for a template pizza with orderId set the
21 * space gives me ALL pizzas. The reason obviously is that it can't really
22 * include the field of the superclass in the search. So we must have an
23 * idOfOrder field in the pizza and not only in the PizzaOrder for the time
26 private Integer idOfOrder;
28 // private Person consumer;
30 private Pizza(int id, PizzaType type, int cookId, int orderId) {
36 status = PizzaOrderStatus.DONE;
43 public static Pizza createPizzaFromPizzaOrder(PizzaOrder pizzaorder, int cookId) {
44 return new Pizza(pizzaorder.getId(), pizzaorder.getPizzaType(), cookId, pizzaorder.getOrderId());
48 public String toString() {
49 return "Pizza [deliveryAgent=" + deliveryAgent + ", id=" + id + ", orderId=" + orderId + ", pizzaType=" + pizzaType
50 + ", status=" + status + ", cookId=" + cookId + "]";
54 public int getOrderId() {
55 return getIdOfOrder();
59 public void setOrderId(Integer orderId) {
63 public int getIdOfOrder() {
64 return Util.getIntSafe(idOfOrder);
67 public void setIdOfOrder(Integer idOfOrder) {
68 this.idOfOrder = idOfOrder;