public String toString() { Set<Entry<ResourceAddress, NextProtocolBinding>> entries = entrySet(); if (entries.isEmpty()) { return "{}"; } StringBuilder sb = new StringBuilder(); sb.append("{\n"); if (!entries.isEmpty()) { for (Entry<ResourceAddress, NextProtocolBinding> entry : entries) { ResourceAddress key = entry.getKey(); NextProtocolBinding value = entry.getValue(); URI location = key.getResource(); sb.append(" ").append('[').append(location.resolve("/")).append(']'); sb.append(" = "); sb.append(value); sb.append(',').append('\n'); } sb.setLength(sb.length() - 2); } return sb.append("\n}").toString(); }