I want to convert any protocol buffer to json.
My protocol buffer looks as below.
```
syntax = "proto3";
message A {
int32 id = 1;
}
message B {
int32 id = 2;
}
message C {
int32 id = 3;
}
```
I am converting each of them as follows using JsonFormat:
```
String jsonString;
A.Builder Abuilder = A.newBuilder();
JsonFormat.parser().ignoringUnknownFields().merge(jsonString, builder);
A a = Abuilder.build();
Similarly for B
B.Builder Bbuilder = B.newBuilder();
JsonFormat.parser().ignoringUnknownFields().merge(jsonString, builder);
B b = Bbuilder.build()
```
I wanted to know if I can write a generic method using template or java generics or using ```com.google.protobuf.Message``` so that I don't have to write the same method for each of my protocol buffer.