There's no such API. You would need to write a loop to find a match.

On Tue, Jun 27, 2017 at 12:17 PM Steven Seeley <[email protected]> wrote:

>
> 3:05 PM (less than a minute ago)
> Hi guys,
>
> I've been trying to implement a means to compare two different protobuf
> messages using a mapping of their "json path", and I've mostly got it
> figured out, but one edge case is causing me a lot of frustration.
>
> In my protobuf definition, I have something like
>
> message Foo {
>   repeated RepeatedField = 1;
> }
>
> message RepeatedField {
>   oneof field_type {
>     FieldType1 field1 = 1;
>     FieldType2 field2 = 2;
>     FieldType3 field3 = 3;
>   }
>
> }
>
>
> I would just like to know, if given the FieldDescriptor for RepeatedField,
> does the Java API provide an easy way to grab the first field in the list
> matches a desired field_type?
>
> Thanks!
> -Steve
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to