[protobuf] Message.getField(FieldDescriptor) and enum values.

2011-05-23 Thread Jim Mayer
In the Java protocol buffer binding, is there a way to get the Java enum value using protocol buffer reflection? Specifically, I'd like to be able to write something like the following: Object getFieldValue(MessageOrBuilder source, FieldDescriptor field) { Object value =

Re: [protobuf] Re: Message.getField(FieldDescriptor) and enum values.

2011-05-23 Thread Jim Mayer
of... MyJavaEnum.valueOf((EnumValueDescriptor)value) will return the appropriate java enum value. On May 23, 1:42 pm, Jim Mayer j...@pentastich.org wrote: In the Java protocol buffer binding, is there a way to get the Java enum value using protocol buffer reflection? Specifically, I'd like

Re: [protobuf] Re: Message.getField(FieldDescriptor) and enum values.

2011-05-31 Thread Jim Mayer
to do, you don't really need the java enum value... The EnumValueDescriptor is what you use for the value when calling setField(FieldDescriptor field, Object value) for an Enum Field On May 23, 5:09 pm, Jim Mayer j...@pentastich.org wrote: That's exactly the problem. We don't. This issue