.add(com.google.protobuf.UInt64Value.getDescriptor()) .build(); JsonFormat.Printer jsonPrinter = JsonFormat.printer().usingTypeRegistry(registry); try (PrintWriter jsonPrintWriter = new PrintWriter(outFileJsonServiceConfig, StandardCharsets.UTF_8.name())) {
.add(com.google.protobuf.UInt64Value.getDescriptor()) .build(); JsonFormat.Printer jsonPrinter = JsonFormat.printer().usingTypeRegistry(registry); try (PrintWriter jsonPrintWriter = new PrintWriter(outFileJsonServiceConfig, StandardCharsets.UTF_8.name())) {
public EntityJsonPrinter() { TypeRegistry typeRegistry = TypeRegistry.newBuilder() .add(Entity.getDescriptor()) .build(); jsonPrinter = JsonFormat.printer() .usingTypeRegistry(typeRegistry) .omittingInsignificantWhitespace(); }
/** * Creates a new Writer which writes the messages it sees to the supplied Output. */ public static <T extends Message> Writer<T> create(List<Object> output, JsonFormat.TypeRegistry registry) { return new Writer<>(JsonFormat.printer().usingTypeRegistry(registry), output); }