The Builder interface has a method setField() which takes a FieldDescriptor
and a value. You can pass the FieldDescriptor for an extension to set an
extension, and pass the message object as the value. You can get the
FieldDescriptor from ExtensionRegistry or from
GeneratedExtension.getDescriptor
Hi,
I'm just starting using Protocol Buffers for Java for a network
protocol.
Here is how I designed my proto file:
request.proto:
message Message {
enum Type {
AUTH = 100;
CHAT = 101;
...
}
required Type type = 1;