ListMessage: Implement toString().
@@ -23,6 +23,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import com.google.common.base.MoreObjects;
+
/**
* <p>Abstract superclass of classes with list based payload, ie InventoryMessage and GetDataMessage.</p>
*
@@ -129,4 +131,11 @@ public abstract class ListMessage extends Message {
public int hashCode() {
return items.hashCode();
}
+
+ @Override
+ public String toString() {
+ MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(this);
+ helper.addValue(items);
+ return helper.toString();
+ }
}
