eclipse 配置lombok,注解生成getter,setter,equals,hashCode,toString
程序员文章站
2022-06-16 09:38:04
...
lombok 可以再编译过程中生成getter,setter,equals,hashCode,toString,构造函数等方法
简称
lombok简介
https://www.jianshu.com/p/365ea41b3573
主页:
下载
https://projectlombok.org/download
maven下载
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.20</version>
<scope>provided</scope>
</dependency>
eclipse安装插件后,才能编译出注解标识的方法
1.把lombok-1.16.20.jar拷到eclipse.exe同级目录
2.修改eclipse.ini,在最后加入
-Xbootclasspath/a:lombok-1.16.20.jar
-javaagent:lombok-1.16.20.jar
3.重启eclipse
样例
@Getter
@Setter
@EqualsAndHashCode(callSuper=false,of="id")
@ToString(callSuper=true)
public class Organization extends BaseEntity {
}
eclipse生成boolean类型getter,setter,is开头的问题
http://happyqing.iteye.com/blog/2410579
下一篇: php中Snoopy类用法实例