netty: add toString() to GrpcHttp2Headers

This commit is contained in:
Jakob Buchgraber 2016-06-02 18:18:55 +02:00
parent 90323ad5d4
commit c6c74799f4
1 changed files with 15 additions and 0 deletions

View File

@ -144,4 +144,19 @@ final class GrpcHttp2Headers extends AbstractHttp2Headers {
throw new UnsupportedOperationException();
}
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder(getClass().getSimpleName()).append('[');
String separator = "";
for (Entry<CharSequence, CharSequence> e : this) {
CharSequence name = e.getKey();
CharSequence value = e.getValue();
builder.append(separator);
builder.append(name).append(": ").append(value);
separator = ", ";
}
builder.append(']');
return builder.toString();
}
}