1.Lombok介绍
官网介绍:
Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java.Never write another getter or equals method again, with one annotation your class has a fully featured builder, Automate your logging variables, and much more.
翻译是:
Lombok是一个Java库,能自动插入编辑器并构建工具,简化Java开发。通过添加注解的方式,不用再写getter或equels方法,同时可以自动化日志变量,或更多。
2.IDEA安装Lombok,进入Settings->Plugins,搜索Lombok,点击Installed即可,安装完,提示重启,就OK了。
文章图片
3.添加Maven依赖及使用
3.1依赖包
org.projectlombok
lombok
1.18.4
provided
【IDEA中Lombok使用】3.2在一个实体bean中添加注解,可以添加@Data,@Getter,@Setter等。
![IDEA中Lombok使用](https://img.it610.com/image/info8/aadae0b1d47b48059711f71047fe8dbc.jpg)
文章图片
3.3效果
![IDEA中Lombok使用](https://img.it610.com/image/info8/2b7736830d62451c93df1fdeeaed7e3c.jpg)
文章图片
推荐阅读
- activemq笔记
- MyEclipse中防止代码格式化时出现换行的情况的设置
- JAVA 8 lambda 表达式实现按某个属性值查找对象集合中符合条件的对象
- tomcat启动时报invalid LOC header (bad signature)错误
- docker中运行zabbix/zabbix-web-nginx-mysql镜象,前端页面显示时间不准确的问题(差5个小时)
- java.lang.NoSuchMethodError: 'feign.Request$Body feign.Request.requestBody()
- maven must be "pom" but is "jar" 填坑记
- npm 报错(permission denied Please try running this command again as root/Administrator.)
- 基于Crawler4j + jsoup实现爬虫