Added isModified method to Resource, Reservation.
[staff/due1/sed-hs15-srs-purple.git] / src / main / java / ch / bfh / ti / srs / dataschema / Resource.java
index e5b1ebe..ab601e6 100644 (file)
@@ -55,6 +55,16 @@ public class Resource implements Cloneable {
                this.type = type;\r
        }\r
 \r
+       public boolean isModified(Resource otherResource) {\r
+               if (otherResource == this) {\r
+                       return false;\r
+               }\r
+               if (otherResource == null) {\r
+                       return true;\r
+               }\r
+               return this.name != otherResource.getName() || this.type != otherResource.getType();\r
+       }\r
+\r
        @Override\r
        public Resource clone() throws CloneNotSupportedException {\r
                return (Resource) super.clone();\r