I thought I would be able to do something like:

fooBuilder.getBarBuilder(index).setBlah(123);

But instead I have to explicitly ensure that a BarBuilder with the
given index already exists by adding a line like the following before
the one above:

while (index >= fooBuilder.getBarBuilderCount())
fooBuilder.addBarBuilder();

Is there any way to avoid this? Am I missing an alternative method on
my containing builder, i.e. FooBuilder in my example, that would
automatically create the necessary repeated field builders if an
attempt is made to retrieve one where none already exists for the
given index.

I need to build up a highly nested structure, with the data for this
structure streaming in from source X in a fairly random order - I
don't want to check as I receive each data item that any repeating
containing parents, of the field where this data item should go,
already exist.

I'm just hoping I've missed something but maybe this is an unusual
case and so isn't directly supported - if so fair enough :)

/George

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to