Provide consistent hash code for enums and use it too
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / UpdateType.java
index 2e9058abe8c781cf57de9cd0ff51bf5d7de9b554..6642eaf44bb1a489d8ab06cb3717c980b251ff89 100644 (file)
@@ -28,4 +28,12 @@ public enum UpdateType {
     public String getName() {
         return this.name;
     }
+
+    public int calculateConsistentHashCode() {
+        if (this.name != null) {
+            return this.name.hashCode();
+        } else {
+            return 0;
+        }
+    }
 }