当前位置:网站首页>lombok注解@RequiredArgsConstructor的使用
lombok注解@RequiredArgsConstructor的使用
2022-08-04 01:28:00 【不会打字314】
lombok注解@RequiredArgsConstructor的使用
前置说明
lombok 提供了很多的注解 , 但是我们平时使用的主机就是那几个
@Data
@Setter
@Getter
@ToString
…
使用 idea 打开 lombok 的源码包

之前看帖子 , 看见案例使用 @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();
}
}
查看反编译的源码 , 可以通过 idea 直接查看
lectList();
}
}
查看反编译的源码 , 可以通过 idea 直接查看

边栏推荐
- GNSS【0】- 专题
- pygame 中的transform模块
- esp32发布机器人电池电压到ros2(micro-ros+CoCube)
- 【虚拟户生态平台】虚拟化平台安装时遇到的坑
- IDEA02:配置SQL Server2019数据库
- Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
- VR panorama shooting online exhibition hall, 3D panorama brings you an immersive experience
- 2022 China Computing Power Conference released the excellent results of "Innovation Pioneer"
- JS 从零教你手写节流throttle
- typescript56 - generic interface
猜你喜欢
随机推荐
typescript51 - basic use of generics
esp32发布机器人电池电压到ros2(micro-ros+CoCube)
The 600MHz band is here, will it be the new golden band?
哎,又跟HR在小群吵了一架!
nodejs+express实现数据库mysql的访问,并展示数据到页面上
C语言:学生管理系统(链表版)
敏捷交付的工程效能治理
Summary of GNSS Articles
typescript55 - generic constraints
电子组装行业对MES管理系统的需求分析
如何用C语言代码实现商品管理系统开发
TensoFlow学习记录(二):基础操作
电子制造企业部署WMS仓储管理系统的好处是什么
Apache DolphinScheduler新一代分布式工作流任务调度平台实战-中
特征值与特征向量
循环绕过问题
DDTL:远距离的域迁移学习
600MHz频段来了,它会是新的黄金频段吗?
WMS仓储管理系统能解决电子行业哪些仓库管理问题
VR全景拍摄线上展馆,3D全景带你沉浸体验









