Bug 2194: Find primary shard on remote ShardManager
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / PrimaryFound.java
index a2f6701524a7f4d2f42a4ce93b4463d368414659..4c154d43ae007268b153f2503ad949250031cb21 100644 (file)
@@ -8,50 +8,48 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
-
-public class PrimaryFound implements SerializableMessage {
-  public static final Class SERIALIZABLE_CLASS = PrimaryFound.class;
-  private final String primaryPath;
-
-  public PrimaryFound(String primaryPath) {
-    this.primaryPath = primaryPath;
-  }
-
-  public String getPrimaryPath() {
-    return primaryPath;
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) return true;
-    if (o == null || getClass() != o.getClass()) return false;
-
-    PrimaryFound that = (PrimaryFound) o;
-
-    if (!primaryPath.equals(that.primaryPath)) return false;
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return primaryPath.hashCode();
-  }
-
-  @Override
-  public String toString() {
-    return "PrimaryFound{" +
-            "primaryPath='" + primaryPath + '\'' +
-            '}';
-  }
-
-
-  @Override
-  public Object toSerializable() {
-    return  this;
-  }
-
-  public static PrimaryFound fromSerializable(Object message){
-    return (PrimaryFound) message;
-  }
+import java.io.Serializable;
+
+public class PrimaryFound implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private final String primaryPath;
+
+    public PrimaryFound(final String primaryPath) {
+        this.primaryPath = primaryPath;
+    }
+
+    public String getPrimaryPath() {
+        return primaryPath;
+    }
+
+    @Override
+    public boolean equals(final Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+
+        PrimaryFound that = (PrimaryFound) o;
+
+        if (!primaryPath.equals(that.primaryPath)) {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return primaryPath.hashCode();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("PrimaryFound [primaryPath=").append(primaryPath).append("]");
+        return builder.toString();
+    }
 }