I have following object annotated with @Value from Lombok:
@Value
public class Foo {
private final boolean bar;
private final boolean baz;
private final boolean boo;
}
I try to instantiate Foo from groovy test:
new Foo(bar: true, baz: false, boo: true)
but I get warning:
Constructor 'Foo' cannot be applied to '()'
and during runtime following error:
Cannot set readonly property: bar for a class: Foo
is there a way to use named constructor in groovy that will call constructor with all arguments instead of calling empty constructor and then trying to set fields?