Update Reservation and ReservationTest classes.
[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(User user, Resource resource, DateRange DateRange, String remark) {
24 if (user == null)
25 throw new IllegalArgumentException("User must not be null");
26 if (resource == null)
27 throw new IllegalArgumentException("Resource must not be null");
28 if (dateRange == null)
29 throw new IllegalArgumentException("DateRange must not be null");
30
31 this.user = user;
32 this.resource = resource;
33 this.dateRange = DateRange;
34 this.remark = remark;
35 }
36
37 public User getUser() {
38 return user;
39 }
40
41 public Resource getResource() {
42 return resource;
43 }
44
45 public DateRange getDateRange() {
46 return dateRange;
47 }
48
49 public String getRemark() {
50 return remark;
51 }
52
53 public void setUser(User user) {
54 this.user = user;
55 }
56
57 public void setResource(Resource resource) {
58 this.resource = resource;
59 }
60
61 public void setDateRange(DateRange dateRange) {
62 this.dateRange = dateRange;
63 }
64
65 public void setRemark(String remark) {
66 this.remark = remark;
67 }
68
69 private UUID createUUID() {
70 return null;
71 }
72 }