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

边栏推荐
- typescript48-函数之间的类型兼容性
- GNSS[0]- Topic
- 持续投入商品研发,叮咚买菜赢在了供应链投入上
- 计算首屏时间
- Deng Qinglin, Alibaba Cloud Technical Expert: Best Practices for Disaster Recovery across Availability Zones and Multiple Lives in Different Locations on the Cloud
- 阿里云技术专家邓青琳:云上跨可用区容灾和异地多活最佳实践
- 快速入门EasyX图形编程
- 观察者模式
- redis中常见的问题(缓存穿透,缓存雪崩,缓存击穿,redis淘汰策略)
- Installation and configuration of nodejs+npm
猜你喜欢
随机推荐
Electronics manufacturing enterprise deployment WMS what are the benefits of warehouse management system
Observability:你所需要知道的关于 Syslog 的一些知识
LDO investigation
Demand analysis of MES management system in electronic assembly industry
typescript48 - type compatibility between functions
分析:Nomad Bridge黑客攻击的独特之处
jmeter distributed stress test
Tanabata festival coming, VR panoramic look god assists for you
【虚拟化生态平台】虚拟化平台esxi挂载USB硬盘
【无标题】
nodejs installation and environment configuration
【虚拟户生态平台】虚拟化平台安装时遇到的坑
【OpenCV】-重映射
typescript56 - generic interface
boot issue
Thinkphp commonly used techniques
观察者模式
Slipper —— 虚点,最短路
网页三维虚拟展厅为接入元宇宙平台做基础
敏捷交付的工程效能治理









