getLoggedUserName, getLoggedMail, getLoggedName, getLoggedLastname set
[staff/due1/sed-hs15-srs-purple.git] / src / main / java / ch / bfh / ti / srs / dataschema / Reservation.java
CommitLineData
9a78ca13
MT
1/*\r
2 * Copyright (c) 2015 Berner Fachhochschule, Switzerland.\r
3 *\r
4 * Project Smart Reservation System.\r
5 *\r
6 * Distributable under GPL license. See terms of license at gnu.org.\r
7 */\r
8package ch.bfh.ti.srs.dataschema;\r
9\r
81c3aac6
MT
10import java.util.UUID;\r
11\r
9a78ca13
MT
12import ch.bfh.ti.daterange.DateRange;\r
13\r
14public class Reservation {\r
15\r
81c3aac6
MT
16 private UUID id;\r
17 private UUID groupId;\r
9a78ca13
MT
18 private User user;\r
19 private Resource resource;\r
20 private DateRange dateRange;\r
81c3aac6
MT
21 private String remark;\r
22\r
a49c468f
MT
23 public Reservation(UUID groupId, User user, Resource resource, DateRange DateRange, String remark) {\r
24// // if (groupId == null)\r
25// // throw new IllegalArgumentException("GroupID must not be null");\r
26// if (user.getUserName() == null)\r
88e1040c 27// throw new IllegalArgumentException("User must not be null");\r
a49c468f 28// if (resource.getId() == null)\r
88e1040c 29// throw new IllegalArgumentException("Resource must not be null");\r
a49c468f 30// if (dateRange.isEmpty())\r
88e1040c 31// throw new IllegalArgumentException("DateRange must not be null");\r
9a78ca13 32\r
a49c468f 33 this.groupId = groupId;\r
9a78ca13
MT
34 this.user = user;\r
35 this.resource = resource;\r
36 this.dateRange = DateRange;\r
81c3aac6 37 this.remark = remark;\r
a49c468f
MT
38 \r
39 this.id = UUID.randomUUID();\r
9a78ca13
MT
40 }\r
41\r
a49c468f
MT
42 public UUID getId() {\r
43 return id;\r
44 }\r
45 \r
46 public UUID getGroupId() {\r
47 return groupId;\r
48 }\r
49 \r
9a78ca13
MT
50 public User getUser() {\r
51 return user;\r
52 }\r
53\r
54 public Resource getResource() {\r
55 return resource;\r
56 }\r
57\r
58 public DateRange getDateRange() {\r
59 return dateRange;\r
60 }\r
61\r
81c3aac6
MT
62 public String getRemark() {\r
63 return remark;\r
9a78ca13 64 }\r
a49c468f 65 \r
9a78ca13
MT
66 public void setUser(User user) {\r
67 this.user = user;\r
68 }\r
81c3aac6 69 \r
9a78ca13
MT
70 public void setResource(Resource resource) {\r
71 this.resource = resource;\r
72 }\r
73\r
74 public void setDateRange(DateRange dateRange) {\r
75 this.dateRange = dateRange;\r
76 }\r
81c3aac6
MT
77\r
78 public void setRemark(String remark) {\r
79 this.remark = remark;\r
80 }\r
9a78ca13 81}\r