当前位置:网站首页>Lombok common notes
Lombok common notes
2022-07-26 18:41:00 【JiawenZhang97】
List of articles
One 、Lombok What is it?
Lombok It is a method to reduce code through annotation Java library , For example, reduce by annotation get,set Method , Construction method, etc .
Two 、 How to install
stay pom.xml Add the following dependencies to the file :
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
3、 ... and 、 Commonly used annotations
| annotation | explain |
|---|---|
| @Data | Annotation on class ; Providing all properties of the class getting and setting Method , It also provides equals、canEqual、hashCode、toString Method |
| @Setter | Comment on attribute ; Provide... For properties setting Method |
| @Setter | Comment on attribute ; Provide... For properties getting Method |
| @Log4j | Annotation on class ; Provide a... For the class Properties, log Of log4j Log object |
| @NoArgsConstructor | Annotation on class ; Provides a parameterless construction method for a class |
| @AllArgsConstructor | Annotation on class ; Provide a construction method of all parameters for the class |
| @Cleanup : | You can turn off the stream |
| @Builder | The annotated class adds a constructor pattern |
| @Synchronized | Add a synchrolock |
| @SneakyThrows | Equate to try/catch Capture exception |
| @NonNull | If you add this annotation to the parameter Parameter is null A null pointer exception will be thrown |
| @Value | Notes and @Data similar , The difference is that it will default all member variables to private final modification , And will not generate set Method . |
边栏推荐
- MySQL 遇到过死锁问题吗,你是如何解决的?
- Netease game R & D Engineer Intern (client side)
- Visual VM positioning oom, fullgc usage
- Interface test scheme (interface test idea)
- MPLS experiment
- Linear regression -- Taking an arithmetic sequence as an example
- PS_1_认识主界面_新建文档(分辨率)_打开保存(序列动画)
- How the test team conducts QA specification
- During the oppo interview, 16 questions were thrown over. I was stupid
- Linked list - merge two sorted lists
猜你喜欢

The first day of Oracle (review and sort out the common knowledge points of development)

455. 分发饼干【双指针 ++i、++j】

Oracle第二天(视图、索引、plsql、游标、存储过程和存储函数、触发器、jdbc访问存储过程和存储函数)

深入理解为什么不要使用System.out.println()

Neural network learning (2) introduction 2

MySQL练习题初级45题(统一表)

Meta Cambria handle exposure, active tracking + multi tactile feedback scheme
![[ Kitex 源码解读 ] 服务发现](/img/70/c74ede02b794e586d629876d2b2376.png)
[ Kitex 源码解读 ] 服务发现

Leetcode 50 day question brushing plan (day 1 - add two numbers 11.00-12.30)

云服务器mySQL提示报错
随机推荐
如何组装一个注册中心
LeetCode_ 1005_ Maximized array sum after K negations
继续卷技术 埋头苦学,越学越会
Continue to work hard on your skills, and the more you learn, the more you will learn
还在用Xshell?推荐这个更现代的终端连接工具
NFT数字藏品开发:数字藏品助力企业发展
PS_1_认识主界面_新建文档(分辨率)_打开保存(序列动画)
PS_ 1_ Know the main interface_ New document (resolution)_ Open save (sequence animation)
剑指offer 正则表达式匹配
神经网络学习(2)前言介绍二
【英雄哥七月集训】第 25天: 树状数组
J9 number theory: how to avoid the trap of stepping on thunder?
Hello World
链表-两个链表的第一个公共结点
网易游戏研发工程师实习生(客户端方向)一面
Duplicate gallerycms character length limit short domain name bypass
Safer, healthier and without endurance anxiety, Wei brand latte dht-phev is here
Visual VM positioning oom, fullgc usage
flex布局
第一个ABAP ALV报表程序构建流程