为什么@getter的lombok传播字段注释@notnull?
我的问题很简单,答案可能会更简单,但是到目前为止我还没有找到任何东西。
LOMBOK 1.18.24(迄今为止的最后一个)将注释“ @notnull”传播到其生成的Getter方法上,因为我使用.class文件上的分解符:
sstatic.net/agyva.png“ rel =“ noreferrer”>
我尝试使用lombok.config
如下(但没有成功):
lombok.copyableAnnotations- = javax.validation.constraints.notnull
和如下(也没有成功):
清除LOMBOK.ADDNULLANTATITATION
简而言之,我希望Lombok 不要传播它。 如何避免@getter传播字段注释 @javax.validation.constraints.notnull到各自的Getter?
My question is simple and the answer could be simpler but I haven't found anything so far.
Lombok 1.18.24 (last so far) propagates annotation "@NotNull" to its generated getter method, as I checked out using a decompiler over the .class file:
It is funny because other annotations such as @javax.validation.constraints.NotEmpty, it does not propagate. It is my solution so far.
I tried to use lombok.config
as follows (but no success):
lombok.copyableAnnotations -= javax.validation.constraints.NotNull
and as follows (no success either):
clear lombok.addNullAnnotations
In short, I would like Lombok does not propagate it. How to avoid @Getter propagates field annotation @javax.validation.constraints.NotNull to respective getter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论