Improve IdentifiablePayload.toString() implementations
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / persisted / AbstractIdentifiablePayload.java
index de9b0bb..0367d15 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.cluster.datastore.persisted;
 import static com.google.common.base.Verify.verifyNotNull;
 import static java.util.Objects.requireNonNull;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.io.ByteStreams;
 import java.io.DataInput;
 import java.io.Externalizable;
@@ -88,6 +89,11 @@ public abstract class AbstractIdentifiablePayload<T extends Identifier> extends
         return serialized.length;
     }
 
+    @Override
+    public final String toString() {
+        return MoreObjects.toStringHelper(this).add("identifier", identifier).add("size", size()).toString();
+    }
+
     protected final Object writeReplace() {
         return verifyNotNull(externalizableProxy(serialized));
     }