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

边栏推荐
猜你喜欢

即席查询——Presto

typescript56-泛型接口

typescript48-函数之间的类型兼容性

Vant3 - click on the corresponding name name to jump to the next page corresponding to the location of the name of the TAB bar

html select标签赋值数据库查询结果

Android interview questions and answer analysis of major factories in the first half of 2022 (continuously updated...)

Flink jdbc connector 源码改造sink之 clickhouse多节点轮询写与性能分析

typescript52 - simplify generic function calls

The 600MHz band is here, will it be the new golden band?
观察者模式
随机推荐
GNSS[0]- Topic
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
Jmeter cross-platform operation CSV files
this巩固训练,从两道执行题加深理解闭包与箭头函数中的this
redis中常见的问题(缓存穿透,缓存雪崩,缓存击穿,redis淘汰策略)
如何用C语言代码实现商品管理系统开发
typescript54-泛型约束
JS 保姆级贴心,从零教你手写实现一个防抖debounce方法
.NET Static Code Weaving - Rougamo Release 1.1.0
Apache DolphinScheduler新一代分布式工作流任务调度平台实战-中
typescript52-简化泛型函数调用
nodejs+npm的安装与配置
JS 从零教你手写节流throttle
通用的测试用例编写大全(登录测试/web测试等)
Array_Sliding window | leecode brushing notes
【虚拟化生态平台】虚拟化平台esxi挂载USB硬盘
Flink jdbc connector 源码改造sink之 clickhouse多节点轮询写与性能分析
MongoDB数据接入实践
thinkphp 常用技巧
互斥锁、读写锁、自旋锁,以及原子操作指令xaddl、cmpxchg的使用场景剖析