当前位置:网站首页>Use of lombok annotation @RequiredArgsConstructor
Use of lombok annotation @RequiredArgsConstructor
2022-08-04 01:32:00 【Can't type 314】
lombok注解@RequiredArgsConstructor的使用
前置说明
lombok 提供了很多的注解 , But those are the hosts we usually use
@Data
@Setter
@Getter
@ToString
…
使用 idea 打开 lombok 的源码包
之前看帖子 , see case use @RequiredArgsConstructor 进行依赖注入
于是测试一下
测试案例
HelloController.java
使用@RequiredArgsConstructor依赖注入
@RestController
@RequiredArgsConstructor
public class HelloController {
final StringRedisTemplate stringRedisTemplate;
@RequestMapping("/hello")
public Map hello() {
stringRedisTemplate.opsForValue().set("k1", "v1");
Map<String, String> result = new HashMap<>();
result.put("hello", "world");
return result;
}
final PersonDao personDao;
@GetMapping("/ssm")
public List<PersonEntity> listPerson() {
return personDao.selectList();
}
}
Check out the decompiled source code , 可以通过 idea 直接查看
lectList();
}
}
Check out the decompiled source code , 可以通过 idea 直接查看

边栏推荐
- 优秀的测试/开发程序员,是怎样修炼的?步步为营地去执行......
- How to find the cause of Fiori Launchpad routing errors by single-step debugging
- DDTL:远距离的域迁移学习
- WMS仓储管理系统能解决电子行业哪些仓库管理问题
- Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
- 网络带宽监控,带宽监控工具哪个好
- KunlunBase 1.0 发布了!
- VR panorama shooting online exhibition hall, 3D panorama brings you an immersive experience
- 贴纸拼词 —— 记忆化搜索 / 状压DP
- nodejs installation and environment configuration
猜你喜欢
网络带宽监控,带宽监控工具哪个好
Jmeter cross-platform operation CSV files
Analysis of usage scenarios of mutex, read-write lock, spin lock, and atomic operation instructions xaddl and cmpxchg
Quickly build a website with static files
持续投入商品研发,叮咚买菜赢在了供应链投入上
nodejs切换版本使用(不需要卸载重装)
What warehouse management problems can WMS warehouse management system solve in the electronics industry?
企业虚拟偶像产生了实质性的价值效益
《Greenplum构建实时数据仓库实践》简介
Use nodejs switch version (no need to uninstall and reinstall)
随机推荐
ASP.NET 获取数据库的数据并写入到excel表格中
[store mall project 01] environment preparation and testing
LeetCode third topic (the Longest Substring Without Repeating Characters) trilogy # 3: two optimization
持续投入商品研发,叮咚买菜赢在了供应链投入上
多线程 之 JUC 学习篇章一 创建多线程的步骤
.NET Static Code Weaving - Rougamo Release 1.1.0
Google Earth Engine - Calculates the effective width of rivers using publicly available river data
typescript50 - type specification between cross types and interfaces
typescript58 - generic classes
【QT小记】QT中信号和槽的基本使用
5.scrapy中间件&分布式爬虫
字符串的排列
可变字符串
一篇文章看懂JS闭包,从执行上下文角度解析有趣的闭包
pygame 中的transform模块
114. How to find the cause of Fiori Launchpad routing error by single-step debugging
分析:Nomad Bridge黑客攻击的独特之处
GNSS文章汇总
字符串变形
What warehouse management problems can WMS warehouse management system solve in the electronics industry?