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?