Web services status checking servlets, new clustalo x32 binary from Fabian, other...
[jabaws.git] / webservices / compbio / ws / server / Category.java
index 5e164c4..203949f 100644 (file)
@@ -16,6 +16,7 @@ import compbio.ws.client.Services;
  * This class is responsible for initialization of all the categories (done\r
  * statically) and holds the category names as constrains.\r
  * \r
+ * Two categories considered equals if their names are equals.\r
  * \r
  * @author pvtroshin\r
  * @version 1.0 September 2011\r
@@ -84,4 +85,30 @@ public class Category {
 \r
                return categories;\r
        }\r
+\r
+       @Override\r
+       public int hashCode() {\r
+               final int prime = 31;\r
+               int result = 1;\r
+               result = prime * result + ((name == null) ? 0 : name.hashCode());\r
+               return result;\r
+       }\r
+\r
+       @Override\r
+       public boolean equals(Object obj) {\r
+               if (this == obj)\r
+                       return true;\r
+               if (obj == null)\r
+                       return false;\r
+               if (getClass() != obj.getClass())\r
+                       return false;\r
+               Category other = (Category) obj;\r
+               if (name == null) {\r
+                       if (other.name != null)\r
+                               return false;\r
+               } else if (!name.equals(other.name))\r
+                       return false;\r
+               return true;\r
+       }\r
+\r
 }\r