[英]lombok @AllArgsConstructor constructor
I am new to lombok. 我是龙目岛的新手。 I have defined the below model using lombok. 我使用lombok定义了以下模型。 However when I try to create a object of the model with parameters, it gives an error stating Paramterized connstructor is not defined
. 但是,当我尝试使用参数创建模型的对象时,它给出了一个错误,指出Paramterized connstructor is not defined
。 From what I have read, @AllArgsConstructor
, @NoArgsConstructor
should create both a paramterized and default constructor. 从我所读的内容中, @AllArgsConstructor
, @NoArgsConstructor
应该创建参数化的和默认的构造函数。 I am able to access my parameters so I am sure lombok is setup correctly. 我可以访问我的参数,因此可以确保正确安装了lombok。
Am I missing something here? 我在这里想念什么吗?
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SomeObjectModel {
@JsonProperty("task")
State task;
@JsonProperty("time")
long time;
@JsonProperty("bool")
boolean bool;
}
Thanks 谢谢
You need to install Lombok in your IDE (based on your post tags seems that you are using Eclipse) 您需要在您的IDE中安装Lombok(基于您的帖子标记似乎您正在使用Eclipse)
Steps: 脚步:
I hope it helps!!! 希望对您有所帮助!!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.