当前位置:网站首页>Detailed explanation of @accessories annotation of Lombok plug-in
Detailed explanation of @accessories annotation of Lombok plug-in
2022-07-02 16:52:00 【Promise__ shallow】
About @Accessors
@Accessors Annotations are used to configure lombok How to generate and display getters and setters Methods [email protected] Annotations can be annotated on classes or attributes
@Accessors There are three properties
- fluent
- chain
- prefix
A detailed explanation of these three attributes
fluent
fluent For a Boolean value , If true Generated get/set There is no way set/get Prefix , The default is false
for example :
@Accessors(flunet = true)
public class MyClass {
@Getter
private int num;
}
- 1.
- 2.
- 3.
- 4.
- 5.
Generated get Method is num(), instead of getNum()
chain
chain For a Boolean value , If true Generated set Method returns this, by false Generated set The method is void type . The default is false, Except when fluent by true when ,chain The default is true.
This is more commonly used , because set Method returns this object , Commonly used to realize chain programming , Such as
user.setName(" Zhang San ").setAge(12).setHeight(175)
- 1.
prefix
prefix For a series of string type , You can specify a prefix , Generate get/set Method will remove the specified prefix
for example :
@Accessors(prefix = "m")
public class MyClass {
@Getter
private int mNum;
}
- 1.
- 2.
- 3.
- 4.
- 5.
Generated get Method is getNum(), instead of getMNum()
边栏推荐
- Cloud native cicd framework: Tekton
- Global and Chinese market of jacquard looms 2022-2028: Research Report on technology, participants, trends, market size and share
- LeetCode 1. 两数之和
- Global and Chinese markets of stainless steel surgical suture 2022-2028: Research Report on technology, participants, trends, market size and share
- unity Hub 登录框变得很窄 无法登录
- 618 reprise en profondeur: la méthode gagnante de la famille Haier Zhi
- July 1st gift: Yi Jingjie's "hundred day battle" ended perfectly, and the database of Guiyang bank was sealed in advance
- Which software is good for machine vision?
- Penetration tool - intranet permission maintenance -cobalt strike
- Yyds dry goods inventory has not revealed the artifact? Valentine's Day is coming. Please send her a special gift~
猜你喜欢
Résumé de l'entrevue de Dachang Daquan
Executive engine module of high performance data warehouse practice based on Impala
Lampe respiratoire PWM
PCL 点云镜像变换
PWM controlled steering gear
PCL point cloud image transformation
How to solve the failure of printer driver installation of computer equipment
How to choose the right kubernetes storage plug-in? (09)
Typescript array out of order output
pwm呼吸燈
随机推荐
MySQL port
C语言中sprintf()函数的用法
Global and Chinese markets for slotting milling machines 2022-2028: Research Report on technology, participants, trends, market size and share
Yolov5 practice: teach object detection by hand
Aujourd'hui dans l'histoire: Alipay lance le paiement par code à barres; La naissance du père du système de partage du temps; La première publicité télévisée au monde...
Mathematical analysis_ Notes_ Chapter 6: Riemann integral of univariate function
Ranger (I) preliminary perception
pwm呼吸燈
Rock PI Development Notes (II): start with rock PI 4B plus (based on Ruixing micro rk3399) board and make system operation
LeetCode 5. Longest Palindromic Substring
Leetcode1380: lucky numbers in matrix
只是巧合?苹果iOS16的神秘技术竟然与中国企业5年前产品一致!
DGraph: 大规模动态图数据集
Mysql database mysqldump why there is no statement to create a database
618深度复盘:海尔智家的制胜方法论
中国信通院《数据安全产品与服务图谱》,美创科技实现四大板块全覆盖
How to solve the failure of printer driver installation of computer equipment
小鹏P7雨天出事故安全气囊没有弹出 官方回应:撞击力度未达到弹出要求
sql解决连续登录问题变形-节假日过滤
路由模式:hash和history模式