Lombok注解@Data的aBc转换为setABc()的问题

182 阅读1分钟

如果VO中存在aBcdef的字段,使用@Data自动生成的settergetter方法不符合驼峰规则 例如


@Data
public class Stu{

    private String mAge;
    
    // 使用@Data注解自动生成的set方法,不符合驼峰规则
    public void setMAge(String mAge){
        this.mAge = mAge;
    }
    
    // 使用@Data注解自动生成的get方法会变成,不符合驼峰规则
    public String getMAge(){
        return this.mAge;
    }
    
    
    // 符合驼峰规则
    public void setmAge(String mAge){
        this.mAge = mAge;
    }
    
    // 符合驼峰规则
    public String getmAge(){
        return this.mAge;
    }
    
}