There's prob a better way of doing this, so perhaps someone can point this
out.
I have several different messages each containing data specific to them.
However, each one of these messages also contains an instance of another
proto message. So for example:
message InEveryClass{
int id = 1;
}
message A{
InEveryClass info = 1;
............
}
message B{
InEveryClass info = 1;
..........
}
I'm sending A and B across the network, by packing them into an Any message.
I know upon receipt of these bytes they will ALWAYS have an InEveryClass
field.
Currently, when I receive the bytes, I do something similar to this.
Any any = Any.parseFrom(bytes);
Now, I would like to be able to get the InEveryClass field withouth having
to unpack this Any to a specific class. Is that possible, or do I need to
type check it and unpack in order to get the InEveryClass field?
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/c71592bb-d8b9-4dc1-b289-99d3e2e1f5b8%40googlegroups.com.