added id, groupid
[staff/due1/sed-hs15-srs-purple.git] / src / main / java / ch / bfh / ti / srs / dataschema / Reservation.java
index 8ad99e9..fe84e7f 100644 (file)
@@ -20,20 +20,33 @@ public class Reservation {
        private DateRange dateRange;\r
        private String remark;\r
 \r
-       public Reservation(User user, Resource resource, DateRange DateRange, String remark) {\r
-//             if (user == null)\r
+       public Reservation(UUID groupId, User user, Resource resource, DateRange DateRange, String remark) {\r
+//             // if (groupId == null)\r
+//             // throw new IllegalArgumentException("GroupID must not be null");\r
+//             if (user.getUserName() == null)\r
 //                     throw new IllegalArgumentException("User must not be null");\r
-//             if (resource == null)\r
+//             if (resource.getId() == null)\r
 //                     throw new IllegalArgumentException("Resource must not be null");\r
-//             if (dateRange == null)\r
+//             if (dateRange.isEmpty())\r
 //                     throw new IllegalArgumentException("DateRange must not be null");\r
 \r
+               this.groupId = groupId;\r
                this.user = user;\r
                this.resource = resource;\r
                this.dateRange = DateRange;\r
                this.remark = remark;\r
+               \r
+               this.id = UUID.randomUUID();\r
        }\r
 \r
+       public UUID getId() {\r
+               return id;\r
+       }\r
+       \r
+       public UUID getGroupId() {\r
+               return groupId;\r
+       }\r
+       \r
        public User getUser() {\r
                return user;\r
        }\r
@@ -49,7 +62,7 @@ public class Reservation {
        public String getRemark() {\r
                return remark;\r
        }\r
-\r
+       \r
        public void setUser(User user) {\r
                this.user = user;\r
        }\r
@@ -65,8 +78,4 @@ public class Reservation {
        public void setRemark(String remark) {\r
                this.remark = remark;\r
        }\r
-       \r
-       private UUID createUUID() {\r
-               return null;\r
-       }\r
 }\r