I want to make a small change, deep in tree of Java protocol buffer objects.
I can use the .getBuilder()
method to make a new object that is a clone of an o
Another option is (I think; it's been a while):
Foo.Builder fooBuilder = foo.toBuilder();
fooBuilder.getBarBuilder().getBazBuilder().getQuuxBuilder()
.setNewThing(newThing);
newFoo = fooBuilder.build();
Note that this isn't any more efficient; you're still making copies of foo, bar, baz, and quux.