I have a custom setter in my Lombok-based POJO:
@Data
@Builder
public class User {
private static final PasswordEncoder ENCODER = new BCryptPasswordEncod
You are using setPassword rather than the builder's set method.
Here is what worked for me:
import lombok.Builder;
import lombok.Data;
@Builder
@Data
public class User {
private String username;
private String password;
public static class UserBuilder {
private String password;
public UserBuilder password(String password ) {
this.password ="ENCRIYP " + password;
return this;
}
}
public static void main(String[] args) {
System.out.println(User.builder().username("This is my username").password("Password").build().toString());
}
}
The result was:
User(username=This is my username, password=ENCRIYP Password)