added equality functions that do a deep content check

Change-Id: Ibc64373587622fa6911d18e21d1695577cc36301
diff --git a/core/api/src/main/java/org/onosproject/cluster/NodeId.java b/core/api/src/main/java/org/onosproject/cluster/NodeId.java
index 68b490f..6cfb42c 100644
--- a/core/api/src/main/java/org/onosproject/cluster/NodeId.java
+++ b/core/api/src/main/java/org/onosproject/cluster/NodeId.java
@@ -20,7 +20,7 @@
 /**
  * Controller cluster identity.
  */
-public class NodeId {
+public class NodeId implements Comparable<NodeId> {
 
     private final String id;
 
@@ -55,4 +55,9 @@
         return id;
     }
 
+    @Override
+    public int compareTo(NodeId that) {
+        return this.id.compareTo(that.id);
+    }
+
 }