use of com.google.protobuf.MapEntry in project sonarqube by SonarSource.
the class ProtobufJsonFormat method writeMap.
private static void writeMap(Collection<MapEntry> mapEntries, JsonWriter writer) {
writer.beginObject();
for (MapEntry mapEntry : mapEntries) {
// Key fields are always double-quoted in json
writer.name(mapEntry.getKey().toString());
Descriptors.FieldDescriptor valueDescriptor = mapEntry.getDescriptorForType().findFieldByName("value");
writeFieldValue(valueDescriptor, mapEntry.getValue(), writer);
}
writer.endObject();
}
Aggregations