Merge "Avoid IllegalArgument on missing source"
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / PrimaryFound.java
index d6aae3786fc3e4f1e08eda17c168345c83073dc9..4c154d43ae007268b153f2503ad949250031cb21 100644 (file)
@@ -8,40 +8,48 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
-public class PrimaryFound {
-  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 + '\'' +
-            '}';
-  }
-
-
+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();
+    }
 }