capnproto / capnproto-java

Cap'n Proto in pure Java
Other
391 stars 86 forks source link

Q: Random Access Fields #102

Open yaarix opened 3 years ago

yaarix commented 3 years ago

Hi, Im probably missing something, but im not sure i understand how random access of fields work in the java api (or in capnproto in general) lets say i have the following schema:

struct Message {
  id @0 :UInt32;
  field1 @1 :Text;
  field2 @2 :Text;
  field3 @2 :Text;
  field4 @2 :Text;
  }

And during runtime, i might need to access only field1, and field3. how do i do that? is it just magically happens when i do: Message.getField1()?

Thanks!