You should be able to pass a builder to some method, and have the method
modify some value of the builder just fine.

Modifying a value in a sub-message is a bit more inconvenient, but still
doable. If you have some type Bar in type Foo like:
message Bar {
  optional int32 a = 1;
  optional int32 b = 2;
}

message Foo {
  optional Bar bar = 1;
}

Foo.Builder builder;
builder.setBar(builder.getBar().toBuilder().setA(...).build());

Would that work for you?

On Wed, Dec 16, 2009 at 9:24 AM, Mark <[email protected]> wrote:

> I wish I could pass a builder object to a method and have the method
> modify either a value of the builder or a value of a sub-message in
> the builder!
>
> I came across this thread, which described exactly the problem I have.
> The Car/Engine example in the thread is perfectly illustrative of my
> scenario.
>
>
> http://groups.google.com/group/protobuf/browse_thread/thread/1699791071e92c83/fc77205a755721f0
>
> Has anyone else been in this same situation? What have you done to
> ameliorate the problem?
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<protobuf%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>
>

--

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


Reply via email to