I have an (abstract) class:
- OParameter with a member String key
Now there are also two subclasses of OParameter:
- OStringParameter with a member String value
- OLongParameter with a member long value
By using Protocol Buffers I define the proto files:
The files are independent from each other (no extension is used). As
far as I understand this is how Protocol Buffers should be used. All
classes (OParameter, OStringParameter and OLongParameter) then
implements the writeObject() and readObject() and each class just uses
their Protocol message and sets their members. Like:
- Class OStringParameter.writeObject() builds a message and sets only
its member (value)
- The superclass OParameter.writeObject() builds a message and sets
only its member (key)
The same goes for the readObject().
Okay. So far so good. But now I have a class called OListParameter and
its member (value) is a list of OParameter containing instances of
both types: OStringParameter and OLongParameter.
How do I describe this in a proto file?
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to firstname.lastname@example.org
To unsubscribe from this group, send email to
For more options, visit this group at