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