Customised Setter and Getter in Lombok

Viewed 9308

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.

1 Answers
Related