当前位置:网站首页>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 直接查看

边栏推荐
- Quickly build a website with static files
- Use nodejs switch version (no need to uninstall and reinstall)
- typescript55 - generic constraints
- 螺旋矩阵_数组 | leecode刷题笔记
- boot issue
- typescript53 - generic constraints
- Array_Sliding window | leecode brushing notes
- KunlunBase 1.0 is released!
- Analysis: What makes the Nomad Bridge hack unique
- Installation and configuration of nodejs+npm
猜你喜欢
随机推荐
持续投入商品研发,叮咚买菜赢在了供应链投入上
JS 从零教你手写节流throttle
typescript50-交叉类型和接口之间的类型说明
thinkphp 常用技巧
快速入门EasyX图形编程
nodejs切换版本使用(不需要卸载重装)
Jmeter cross-platform operation CSV files
LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之三:两次优化
typescript48 - type compatibility between functions
持续投入商品研发,叮咚买菜赢在了供应链投入上
可变字符串
Slipper —— 虚点,最短路
阿里云技术专家邓青琳:云上跨可用区容灾和异地多活最佳实践
【store商城项目01】环境准备以及测试
Flink jdbc connector 源码改造sink之 clickhouse多节点轮询写与性能分析
持续投入商品研发,叮咚买菜赢在了供应链投入上
typescript58-泛型类
电子组装行业对MES管理系统的需求分析
nodejs安装及环境配置
观察者模式









