Currently, @DefaultValue
is limited to constructor arguments.
This prevents auto generating constructor with lombok.
If @DefaultValue
can be assigned to fields, immutable properties class can be written like this:
```java @Getter @AllArgsConstructor @ConfigurationProperties(prefix = "my") @ConstructorBinding public class MyProperties {
@DefaultValue("Foo")
private final String name;
}
Comment From: snicoll
I have some sympathy for that but enabling @DefaultValue
on field opens up the possibility of the annotation to be used in non-lombok classes and I am not keen to do that.
Thanks for the suggestion anyway.