当前位置:网站首页>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 直接查看
![@RequiredArgsConstructor反编译](https://img-blog.csdnimg.cn/img_convert/209699dd479bc6743cc7f192d78246bc.png)
边栏推荐
- 螺旋矩阵_数组 | leecode刷题笔记
- Android interview questions and answer analysis of major factories in the first half of 2022 (continuously updated...)
- [store mall project 01] environment preparation and testing
- typescript53 - generic constraints
- Vant3 - click on the corresponding name name to jump to the next page corresponding to the location of the name of the TAB bar
- 2022 中国算力大会发布“创新先锋”优秀成果
- Thinkphp commonly used techniques
- Sticker Spelling - Memory Search / Shape Pressure DP
- 一个项目的整体测试流程有哪几个阶段?测试方法有哪些?
- 《The Google File System》新说
猜你喜欢
随机推荐
FeatureNotFound( bs4.FeatureNotFound: Couldn‘t find a tree builder with the features you requested:
vxe-table 从页面批量删除数据 (不动数据库里的数据)
【Untitled】
持续投入商品研发,叮咚买菜赢在了供应链投入上
在Activity中获取另一个XML文件的控件
2022 China Computing Power Conference released the excellent results of "Innovation Pioneer"
Getting started with MATLAB 3D drawing command plot3
typescript57 - Array generic interface
Use nodejs switch version (no need to uninstall and reinstall)
Array_Sliding window | leecode brushing notes
Analysis of usage scenarios of mutex, read-write lock, spin lock, and atomic operation instructions xaddl and cmpxchg
nodejs安装及环境配置
TensoFlow学习记录(二):基础操作
一个注解替换synchronized关键字:分布式场景下实现方法加锁
虚拟机CentOS7中无图形界面安装Oracle
jmeter分布式压测
可变字符串
【虚拟化生态平台】虚拟化平台搭建
一个项目的整体测试流程有哪几个阶段?测试方法有哪些?
观察者模式