当前位置:网站首页>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
边栏推荐
- Find the factorial of a positive integer within 16, that is, the class of n (0= < n < =16). Enter 1111 to exit.
- The most understandable f-string tutorial in history, collecting this one is enough
- (C language) 3 small Codes: 1+2+3+ · · +100=? And judge whether a year is a leap year or a normal year? And calculate the circumference and area of the circle?
- Read the Flink source code and join Alibaba cloud Flink group..
- Test shift left and right
- 自然语言处理系列(一)——RNN基础
- Leetcode122 the best time to buy and sell stocks II
- [geek challenge 2019] upload
- 小程序链接生成
- CONDA common command summary
猜你喜欢

HOW TO CREATE AN INTERACTIVE CORRELATION MATRIX HEATMAP IN R

使用Sqoop把ADS层数据导出到MySQL

How to Easily Create Barplots with Error Bars in R

YYGH-BUG-05

File operation (detailed!)
![[QT] Qt development environment installation (QT version 5.14.2 | QT download | QT installation)](/img/18/f0c9ef6250a717f8e66c95da4de08c.jpg)
[QT] Qt development environment installation (QT version 5.14.2 | QT download | QT installation)

YYGH-BUG-04

HOW TO ADD P-VALUES TO GGPLOT FACETS

堆(优先级队列)

SVO2系列之深度滤波DepthFilter
随机推荐
甜心教主:王心凌
mysql表的增删改查(进阶)
PyTorch搭建LSTM实现服装分类(FashionMNIST)
On data preprocessing in sklearn
【工控老马】西门子PLC Siemens PLC TCP协议详解
YYGH-BUG-04
drools执行String规则或执行某个规则文件
Pytorch builds LSTM to realize clothing classification (fashionmnist)
Larvel modify table fields
MSI announced that its motherboard products will cancel all paper accessories
Input a three digit number and output its single digit, ten digit and hundred digit.
SVO2系列之深度滤波DepthFilter
CDA数据分析——AARRR增长模型的介绍、使用
(C language) input a line of characters and count the number of English letters, spaces, numbers and other characters.
(C language) 3 small Codes: 1+2+3+ · · +100=? And judge whether a year is a leap year or a normal year? And calculate the circumference and area of the circle?
Leetcode122 买卖股票的最佳时机 II
[C language] convert decimal numbers to binary numbers
BEAUTIFUL GGPLOT VENN DIAGRAM WITH R
From scratch, develop a web office suite (3): mouse events
xss-labs-master靶场环境搭建与1-6关解题思路