{
String first, last
}
@CompileStatic // optional
@ToString(includeSuperProperties = true)
@MapConstructor(pre = { super(args?.first, args?.last);
args = args ?: [:] },
post = { first = first?.toUpperCase() })
class Author extends Person {
String bookName
} assert new Author(first: 'Dierk', last: 'Koenig', bookName: 'ReGinA').toString() == 'Author(ReGinA, DIERK, Koenig)'
assert new Author().toString() == 'Author(null, null, null)' Can decorate map ctor with pre / post- instructions