byte[] friendly implementation.
()
| 632 | |
| 633 | /** {@code byte[]} friendly implementation. */ |
| 634 | public String toString() { |
| 635 | final int size = size(); |
| 636 | if (size == 0) { |
| 637 | return "{}"; |
| 638 | } |
| 639 | final StringBuilder buf = new StringBuilder(size << 4); |
| 640 | buf.append('{'); |
| 641 | for (final Map.Entry<byte[], V> e : this) { |
| 642 | Bytes.pretty(buf, e.getKey()); |
| 643 | buf.append('='); |
| 644 | final V value = e.getValue(); |
| 645 | if (value instanceof byte[]) { |
| 646 | Bytes.pretty(buf, (byte[]) value); |
| 647 | } else { |
| 648 | buf.append(value == this ? "(this map)" : value); |
| 649 | } |
| 650 | buf.append(", "); |
| 651 | } |
| 652 | buf.setLength(buf.length() - 2); // Remove the extra ", ". |
| 653 | buf.append('}'); |
| 654 | return buf.toString(); |
| 655 | } |
| 656 | |
| 657 | private static final long serialVersionUID = 1280744742; |
| 658 |