Provide consistent hash code for enums and use it too
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / action / ActionType.java
index 7da6fa911514d252bee6e647b5eae655420ff0cf..b491c5fcea2e4b53914102a91e88a76591ac5d22 100644 (file)
@@ -75,4 +75,12 @@ public enum ActionType {
             return true;
         }
     }
-}
\ No newline at end of file
+
+    public int calculateConsistentHashCode() {
+        if (this.id != null) {
+            return this.id.hashCode();
+        } else {
+            return 0;
+        }
+    }
+}