当前位置:网站首页>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()
边栏推荐
- July 1st gift: Yi Jingjie's "hundred day battle" ended perfectly, and the database of Guiyang bank was sealed in advance
- 基于Impala的高性能数仓实践之执行引擎模块
- Global and Chinese markets for disposable insulin pumps 2022-2028: Research Report on technology, participants, trends, market size and share
- L'explosion de John utilise l'encodage d'entrée par défaut: UTF - 8 Loaded 1 password Hash (bcrypt [blowfish 32 / 64 X3])
- AcWing 300. Task arrangement
- 深度学习图像数据自动标注[通俗易懂]
- Global and Chinese market of switching valves 2022-2028: Research Report on technology, participants, trends, market size and share
- LeetCode 5. Longest Palindromic Substring
- Data security industry series Salon (III) | data security industry standard system construction theme Salon
- LeetCode 4. 寻找两个正序数组的中位数(hard)
猜你喜欢

Analyzing more than 7million R & D needs, it is found that these eight programming languages are the most needed in the industry!

Take you ten days to easily complete the go micro service series (I)

Unity使用UGUI设置一个简单多级水平方向下拉菜单(不需要代码)

七一献礼:易鲸捷 “百日会战”完美收官 贵阳银行数据库提前封板

TCP congestion control details | 2 background

DGraph: 大规模动态图数据集

曆史上的今天:支付寶推出條碼支付;分時系統之父誕生;世界上第一支電視廣告...

La boîte de connexion du hub de l'unit é devient trop étroite pour se connecter

pwm呼吸灯

台积电全球员工薪酬中位数约46万,CEO约899万;苹果上调日本的 iPhone 售价 ;Vim 9.0 发布|极客头条...
随机推荐
Global and Chinese markets for airport baggage claim conveyors 2022-2028: technology, participants, trends, market size and share Research Report
Global and Chinese market of desktop hot melt equipment 2022-2028: Research Report on technology, participants, trends, market size and share
[fluent] dart data type boolean type (boolean type definition | logical operation)
TCP拥塞控制详解 | 2. 背景
LeetCode 6. Z 字形变换 (N字形变换)
Data security industry series Salon (III) | data security industry standard system construction theme Salon
SQL solves the problem of continuous login deformation holiday filtering
AcWing 300. Task arrangement
SSM integration exception handler and project exception handling scheme
[cloud native] briefly talk about the understanding of flume, a massive data collection component
LeetCode 5. 最长回文子串
Headline | Asian control technology products are selected in the textile and clothing industry digital transformation solution key promotion directory of Textile Federation
Analysis of how to prevent virus in industrial computer
System Verilog implements priority arbiter
学生选课系统(山东农业大学课程设计)
Download blender on Alibaba cloud image station
Global and Chinese markets for carbon dioxide laser cutting heads 2022-2028: Research Report on technology, participants, trends, market size and share
Take you ten days to easily complete the go micro service series (I)
What is the difference between self attention mechanism and fully connected graph convolution network (GCN)?
Unity uses ugui to set a simple multi-level horizontal drop-down menu (no code required)