Rename interface Modify to Modifiable.
authorMoritz Trittibach <tritm3@bfh.ch>
Sun, 10 Jan 2016 00:59:51 +0000 (01:59 +0100)
committerMoritz Trittibach <tritm3@bfh.ch>
Sun, 10 Jan 2016 00:59:51 +0000 (01:59 +0100)
Update classes Resevation, Resource

src/main/java/ch/bfh/ti/srs/dataschema/Modifiable.java [new file with mode: 0644]
src/main/java/ch/bfh/ti/srs/dataschema/Modify.java [deleted file]
src/main/java/ch/bfh/ti/srs/dataschema/Reservation.java
src/main/java/ch/bfh/ti/srs/dataschema/Resource.java

diff --git a/src/main/java/ch/bfh/ti/srs/dataschema/Modifiable.java b/src/main/java/ch/bfh/ti/srs/dataschema/Modifiable.java
new file mode 100644 (file)
index 0000000..2988655
--- /dev/null
@@ -0,0 +1,29 @@
+/*\r
+ * Copyright (c) 2015 Berner Fachhochschule, Switzerland.\r
+ *\r
+ * Project Smart Reservation System.\r
+ *\r
+ * Distributable under GPL license. See terms of license at gnu.org.\r
+ */\r
+package ch.bfh.ti.srs.dataschema;\r
+\r
+/**\r
+ * Specifies the interface checking if the Object got modified.\r
+ */\r
+\r
+public interface Modifiable extends Cloneable {\r
+\r
+       /**\r
+        * Checks if any of the updatable variables got changed.\r
+        * @param obj\r
+        *            object to modify\r
+        * @return true if something got changed and false if no change happened.\r
+        */\r
+       public boolean isModified(Object obj);\r
+\r
+       /*\r
+        * (non-Javadoc)\r
+        * @see java.lang.Object#clone()\r
+        */\r
+       public Object clone() throws CloneNotSupportedException;\r
+}\r
diff --git a/src/main/java/ch/bfh/ti/srs/dataschema/Modify.java b/src/main/java/ch/bfh/ti/srs/dataschema/Modify.java
deleted file mode 100644 (file)
index a9b87b5..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*\r
- * Copyright (c) 2015 Berner Fachhochschule, Switzerland.\r
- *\r
- * Project Smart Reservation System.\r
- *\r
- * Distributable under GPL license. See terms of license at gnu.org.\r
- */\r
-package ch.bfh.ti.srs.dataschema;\r
-\r
-public interface Modify extends Cloneable{\r
-       \r
-       public boolean isModified(Object obj);\r
-       \r
-       public Object clone() throws CloneNotSupportedException;\r
-}\r
index 29689a6..6a265a3 100644 (file)
@@ -11,7 +11,7 @@ import java.util.UUID;
 \r
 import ch.bfh.ti.daterange.DateRange;\r
 \r
-public class Reservation implements Modify {\r
+public class Reservation implements Modifiable {\r
 \r
        private UUID id;\r
        private UUID groupId;\r
@@ -20,7 +20,23 @@ public class Reservation implements Modify {
        private DateRange dateRange;\r
        private String remark;\r
 \r
-       public Reservation(UUID groupId, User user, Resource resource, DateRange DateRange, String remark) {\r
+       /**\r
+        * Normal constructor for new reservation created in the Controller\r
+        * @param groupId \r
+        *                      id of reservation group when reocuring reservation, 0 when single reservation\r
+        * @param user\r
+        *                      user who created the reservation\r
+        * @param resource\r
+        *                      reserved resource\r
+        * @param dateRange\r
+        *                      daterange of the reservation\r
+        * @param remark\r
+        *                      remark\r
+        * @throws IllegalArgumentException\r
+        *             the name of the user and resource can't be null\r
+        */\r
+       \r
+       public Reservation(UUID groupId, User user, Resource resource, DateRange dateRange, String remark) {\r
                if (user == null)\r
                        throw new IllegalArgumentException("User must not be null");\r
                if (resource == null)\r
@@ -29,7 +45,7 @@ public class Reservation implements Modify {
                this.groupId = groupId;\r
                this.user = user;\r
                this.resource = resource;\r
-               this.dateRange = DateRange;\r
+               this.dateRange = dateRange;\r
                this.remark = remark;\r
 \r
                this.id = UUID.randomUUID();\r
index 0b740c3..62d047b 100644 (file)
@@ -9,7 +9,7 @@ package ch.bfh.ti.srs.dataschema;
 \r
 import java.util.UUID;\r
 \r
-public class Resource implements Modify {\r
+public class Resource implements Modifiable {\r
 \r
        private UUID id;\r
        private String name;\r