groovy/groovy-core — pull request #341 by marcingrzejszczak (2014-02-28 14:36:04+00:00)
Title: PojoBuilder New Feature Proposal

Added an AST transformation @PojoBuilder that creates for given provided Pojo class "with" methods that allow to set values on a Pojo together with the "build" method that allows to instantiate it.

Example:

POJO - Person
```
class Person {
String firstName
String surName
}
```

PersonBuilder
```
@PojoBuilder(forClass = Person)
class PersonBuilder {

}
```

Building
```
def person = personBuilder.withFirstName("Robert").withSurName("Lewandowski").build()
```

Verification
```
assert person.firstName == "Robert"
assert person.surName == "Lewandowski"
```