当前位置:网站首页>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 . |
边栏推荐
- Flask 封装七牛云
- Linked list - merge two sorted lists
- Linked list - the first common node of two linked lists
- Linked list - the penultimate K nodes
- MPLS实验
- Redis master-slave replication, read-write separation, sentinel mode
- Redis persistent rdb/aof
- 此章节用于补充3
- Vector CANape - How to Send Receive CAN Message in CANape
- Some tips for printing logs
猜你喜欢

PyQt5快速开发与实战 3.5 菜单栏与工具栏

分布式链路追踪Jaeger在Golang中的使用

Neural network learning (2) introduction 2

NFT数字藏品系统开发:上线即售罄,网民“秒杀”数字藏品

SSM练习第五天

The second set of 2020 American Asian individual match

Linked list - the first common node of two linked lists

Oracle day 2 (Views, indexes, PLSQL, cursors, stored procedures and stored functions, triggers, JDBC access stored procedures and stored functions)

Duplicate gallerycms character length limit short domain name bypass

During the oppo interview, 16 questions were thrown over. I was stupid
随机推荐
How about the employment prospects of Russian translation? How to do a good job of Russian translation
[kitex source code interpretation] service discovery
Summary of some problems encountered in developing WinForm (continuous updating)
MySQL练习题初级45题(统一表)
如何做好测试用例设计
Sudden! Arm stops cooperating with Huawei! How big is the impact on Huawei?
Module 8 job message data MySQL table design
SSM练习第五天
455. Distribute cookies [double pointer ++i, ++j]
继续卷技术 埋头苦学,越学越会
Visual VM 定位OOM,FullGC使用方法
Arm China responded to the "disconnection of Huawei supply" incident! Ren Zhengfei said "no impact"!
Oracle day 2 (Views, indexes, PLSQL, cursors, stored procedures and stored functions, triggers, JDBC access stored procedures and stored functions)
常用功能的测试用例
MySQL 遇到过死锁问题吗,你是如何解决的?
14.梯度检测、随机初始化、神经网络总结
Greedy - 455. Distribute cookies
LeetCode_ 1005_ Maximized array sum after K negations
The third day of SSM practice_ Paging assistant_ Security framework
数据库索引的原理,为什么要用 B+树,为什么不用二叉树?