当前位置:网站首页>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()
边栏推荐
- How to choose the right kubernetes storage plug-in? (09)
- Typescript array out of order output
- Written by unity Jason
- 易语言abcd排序
- Take you ten days to easily complete the go micro service series (I)
- Mysql database mysqldump why there is no statement to create a database
- Recalling the college entrance examination and becoming a programmer, do you regret it?
- Global and Chinese market of discharge machines 2022-2028: Research Report on technology, participants, trends, market size and share
- The median salary of TSMC's global employees is about 460000, and the CEO is about 8.99 million; Apple raised the price of iPhone in Japan; VIM 9.0 releases | geek headlines
- uboot的作用和功能
猜你喜欢

Yyds dry inventory company stipulates that all interfaces use post requests. Why?

外企高管、连续创业者、瑜伽和滑雪高手,持续迭代重构的程序人生

Unity uses ugui to set a simple multi-level horizontal drop-down menu (no code required)

Go zero micro service practical series (VIII. How to handle tens of thousands of order requests per second)

unity Hub 登录框变得很窄 无法登录

What is normal distribution? What is the 28 law?

Résumé de l'entrevue de Dachang Daquan

Summary of monthly report | list of major events of moonbeam in June

LeetCode 1. 两数之和

曆史上的今天:支付寶推出條碼支付;分時系統之父誕生;世界上第一支電視廣告...
随机推荐
PCL 点云镜像变换
【云原生】简单谈谈海量数据采集组件Flume的理解
According to the atlas of data security products and services issued by the China Academy of information technology, meichuang technology has achieved full coverage of four major sectors
⌈ 2022 ⌋ how to use webp gracefully in projects
电脑管理员权限在哪里可以打开
Library management system (Shandong Agricultural University Curriculum Design)
Global and Chinese market of discharge machines 2022-2028: Research Report on technology, participants, trends, market size and share
Unity Json 编写
隐私计算技术创新及产业实践研讨会:学习
机器学习-感知机模型
Yyds dry goods inventory has not revealed the artifact? Valentine's Day is coming. Please send her a special gift~
618 deep resumption: Haier Zhijia's winning methodology
Mathematical analysis_ Notes_ Chapter 5: univariate differential calculus
Typescript array out of order output
[fluent] dart data type boolean type (boolean type definition | logical operation)
电脑设备打印机驱动安装失败如何解决
Headline | Asian control technology products are selected in the textile and clothing industry digital transformation solution key promotion directory of Textile Federation
渗透工具-内网权限维持-Cobalt strike
AcWing 300. Task arrangement
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...