I have worked on the Amazon AWS Java SDK recently and one of the useful methods I found in its implementation was the withX. this is essentially a setter for the field X which returns the updated object.
It is very useful for chaining updates to an object when you want to use the default constructor to initialize all other fields.
Something like the code below where field A and D have values overridden an other fields get initialized by the default constructor.
new RandomObject().withFieldA("A Value").withFieldD("D Value");
--
You received this message because you are subscribed to the Google
Groups group for http://projectlombok.org/
To post to this group, send email to project...@googlegroups.com
To unsubscribe from this group, send email to
project-lombo...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/project-lombok?hl=en