Type: New Feature
Affects Version/s: None
Fix Version/s: 2.3.0-rc-1
When working in Java, I've been using an Eclipse plugin to generate a builder for an immutable class with final fields in it.
There is an example of such generated builder in Grails source code:
The "fluent builder" is known at least from the Effective Java 2nd ed. book by Joshua Bloch .
Some blog posts about the builder pattern:
I'd like to have an AST that creates a "fluent builder" for an immutable class.
For Groovy I'd prefer something like this for the syntax.
Example of the class:
The AST would generated a public inner class Person.Builder with setters, fluent property methods and a build method.
Examples of code using the builder support: