Previous patch inadvertedly removed the Map-specific implementation of
toString() -- as it used to be iunherited from AbstractMap. This patch
introduces it back.
Change-Id: Id186a75b5e4880461375c8031756461db78fee0e
Signed-off-by: Robert Varga <rovarga@cisco.com>
return new MutableOffsetMap<>(this);
}
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("{");
+ final Iterator<K> it = offsets.keySet().iterator();
+ int i = 0;
+ while (it.hasNext()) {
+ sb.append(it.next());
+ sb.append('=');
+ sb.append(objects[i++]);
+
+ if (it.hasNext()) {
+ sb.append(", ");
+ }
+ }
+
+ return sb.append('}').toString();
+ }
+
Map<K, Integer> offsets() {
return offsets;
}