Re: [protobuf] How to find whether one specific field of protocol a message isRequired or isOptional?

2013-03-27 Thread Feng Xiao
On Wed, Mar 27, 2013 at 2:36 AM, PraYes wrote: > I needed to find out one specific field of protocol a message isRequired > or isOptional? > > how to use below class to find them? any example? > Easy, for a specific field: message.getDescriptorForType().findFieldByName("some_field").isOptional()

[protobuf] How to find whether one specific field of protocol a message isRequired or isOptional?

2013-03-27 Thread PraYes
I needed to find out one specific field of protocol a message isRequired or isOptional? how to use below class to find them? any example? *com.google.protobuf.Descriptors.FieldDescriptor* https://developers.google.com/protocol-buffers/docs/reference/java/index -- You received this message be