1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.mobility.dining.entity;
17
18 import java.io.Serializable;
19 import java.text.SimpleDateFormat;
20 import java.util.ArrayList;
21 import java.util.Date;
22 import java.util.List;
23
24 import javax.xml.bind.annotation.XmlElement;
25 import javax.xml.bind.annotation.XmlRootElement;
26 import javax.xml.bind.annotation.XmlSeeAlso;
27
28 @XmlRootElement( name="menu" )
29 public class Menu implements Serializable {
30
31 private static final long serialVersionUID = -2096908398187406294L;
32
33 private Date date;
34
35 private List<FoodItem> items;
36
37 public Menu() {
38 this.items = new ArrayList<FoodItem>();
39 }
40
41 public Date getDate() {
42 return date;
43 }
44
45 public void setDate(Date date) {
46 this.date = date;
47 }
48
49 @XmlElement( name="items" )
50 public List<FoodItem> getItems() {
51 return items;
52 }
53
54 public void setItems(List<FoodItem> items) {
55 this.items = items;
56 }
57
58 public String getDateFormatted() {
59 if (this.getDate() != null) {
60 SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy");
61 String date = sdf.format(new Date(this.getDate().getTime()));
62 return date;
63 }
64 return "";
65 }
66
67 }