Lombok中@Data注解不生成指定的getter/setter

注解中加上AccessLevel.NONE,如下:

@Data
public class HcLoginResponse {

    private String token;

    @Getter(AccessLevel.NONE)
    @Setter(AccessLevel.NONE)
    private AuthType authType;

    public HcLoginResponse(AuthType authType) {
        this.authType = authType;
    }

}
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享