当前位置:网站首页>Lombok common annotations
Lombok common annotations
2022-07-02 12:09:00 【A cat wandering in the middle of the night】
Chapter one lombok Commonly used annotations
List of articles
Link to the original text https://zhhll.icu/2021/ Third party tools /lombok/1.lombok Commonly used annotations /
lombok Commonly used annotations
lombok rely on
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.18</version>
<scope>provided</scope>
</dependency>
lombok annotation
- @Getter/@Setter: On the action class , Generate... For all member variables getter/setter Method ; Act on member variables , The getter/setter Method
- @ToString: Act on a class , Override the default toString() Method , Can pass of Properties restrict the display of certain fields , adopt exclude Properties exclude certain fields
- @EqualsAndHashCode: Act on a class , Override the default equals and hashCode
- @NonNull: It is mainly used in member variables and parameters , Logo cannot be empty , Otherwise, a null pointer exception is thrown
- @NoArgsConstructor, @RequiredArgsConstructor, @AllArgsConstructor: Act on a class , Used to generate constructors . Yes staticName、access Equal attribute ,staticName Once the property is set , The instance will be generated in a static way ,access Property to restrict access [email protected] Generate parameterless constructors ;@RequiredArgsConstructor Generation contains final and @NonNull Constructor of member variable of annotation ;@AllArgsConstructor Generate full parameter constructors
- @Data: Act on a class , Is a collection of the following annotations :@ToString @EqualsAndHashCode @Getter @Setter @RequiredArgsConstructor
- @Builder: Act on a class , Turn classes into builder mode
- @Log: Act on a class , Generate log variables . Implement products for different logs , There are different notes , Such as @Slf4j、@Log4j2 etc.
- @Cleanup: Close resources automatically , For the realization of java.io.Closeable The object of the interface is valid , Such as : Typical IO Stream object
- @SneakyThrows: You can catch the detected exception and throw
- @Synchronized: Act on method level , Can replace synchronize Keywords or lock lock
边栏推荐
- Power Spectral Density Estimates Using FFT---MATLAB
- GGPLOT: HOW TO DISPLAY THE LAST VALUE OF EACH LINE AS LABEL
- mysql表的增删改查(进阶)
- 深入理解PyTorch中的nn.Embedding
- Larvel modify table fields
- GGPUBR: HOW TO ADD ADJUSTED P-VALUES TO A MULTI-PANEL GGPLOT
- Flesh-dect (media 2021) -- a viewpoint of material decomposition
- mysql索引和事务
- 5g era, learning audio and video development, a super hot audio and video advanced development and learning classic
- K-Means Clustering Visualization in R: Step By Step Guide
猜你喜欢

Jenkins用户权限管理

Jenkins user rights management

Pytorch builds LSTM to realize clothing classification (fashionmnist)

Mish shake the new successor of the deep learning relu activation function

CDA数据分析——AARRR增长模型的介绍、使用

【2022 ACTF-wp】

ThreadLocal的简单理解

堆(優先級隊列)

File operation (detailed!)

PyTorch搭建LSTM实现服装分类(FashionMNIST)
随机推荐
CDA数据分析——AARRR增长模型的介绍、使用
How does Premiere (PR) import the preset mogrt template?
SVO2系列之深度滤波DepthFilter
Orb-slam2 data sharing and transmission between different threads
PyTorch nn.RNN 参数全解析
GGHIGHLIGHT: EASY WAY TO HIGHLIGHT A GGPLOT IN R
Le tutoriel F - String le plus facile à comprendre de l'histoire.
Differences between nodes and sharding in ES cluster
Leetcode922 sort array by parity II
输入一个三位的数字,输出它的个位数,十位数、百位数。
史上最易懂的f-string教程,收藏这一篇就够了
Leetcode14 最长公共前缀
Deep understanding of P-R curve, ROC and AUC
This article takes you to understand the operation of vim
【C语言】十进制数转换成二进制数
Lekao: contents of the provisions on the responsibility of units for fire safety in the fire protection law
CDH存在隐患 : 该角色的进程使用的交换内存为xx兆字节。警告阈值:200字节
HOW TO CREATE AN INTERACTIVE CORRELATION MATRIX HEATMAP IN R
From scratch, develop a web office suite (3): mouse events
ORB-SLAM2不同线程间的数据共享与传递