【Lombok】IDEA配置以及使用

1.在IDEA添加插件

(没有的 点击search in market。然后进行安装 并重启IDEA)

2.添加依赖(不用maven的 去手动搜索jar包 导入)

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.10</version>
</dependency>

3.为你的实体类添加注解 

说三个很重要的注解

@Data      为所有字段添加set get方法
@AllArgsConstructor  有参构造器(全部参数)
@NoArgsConstructor  无参构造器

4.使用

 

 

原文地址:https://www.cnblogs.com/cckong/p/14328977.html