I have a small counter-argument about the toBuilder that I have been struggling
with:
You have 2 types of domain objects: write and read. For example:
Flavor flavor = api.list().first(); // <-- Only generated by parsing service
gson
vs
api.create(CreateFlavor.builder().name("2").build()); // <-- Always generated
by the user using the builder
Specifically, you can't meaningfully do
Flavor flavor = api.list().first();
api.create(flavor.toBuilder().name("some new name").build()); // as the service
will return additional properties and the two domain objects are conceptually
different.
Which is why I think this might be confusing. If you managed to follow that
reasoning, I'd like to hear some thoughts on it :)
We should probably just provide it as it's an easy convenience method that
might be useful in some cases?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/178#issuecomment-73346304