Lombok @Data annotation will dumbly add setter and getter of fields on the annotated class.
how to add condition based setter in lombok?
public void setName(final String name){
this.name = StringUtils.trimToEmpty(name);
}
is there any support in lombok like this @Setter(condition = StringUtils.isEmpty)
i have searched in lombok doc's i see no explanation regarding my issue.
you can just add another setter, it will override lombok's implenmention
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With