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

边栏推荐
- 【虚拟化生态平台】虚拟化平台esxi挂载USB硬盘
- Thinkphp commonly used techniques
- 特征值与特征向量
- 如何通过单步调试的方式找到引起 Fiori Launchpad 路由错误的原因试读版
- nodejs+express realizes the access to the database mysql and displays the data on the page
- C语言:学生管理系统(链表版)
- Google Earth Engine - Calculates the effective width of rivers using publicly available river data
- 通用的测试用例编写大全(登录测试/web测试等)
- 【QT小记】QT中信号和槽的基本使用
- VR全景拍摄线上展馆,3D全景带你沉浸体验
猜你喜欢

nodejs+npm的安装与配置

企业虚拟偶像产生了实质性的价值效益

Eight things to pay attention to in spot silver

GraphQL背后处理及执行过程是什么

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

LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之三:两次优化

Array_Sliding window | leecode brushing notes

工程制图复习题

电子组装行业对MES管理系统的需求分析

七夕佳节即将来到,VR全景云游为你神助攻
随机推荐
如何用C语言代码实现商品管理系统开发
[store mall project 01] environment preparation and testing
typescript48-函数之间的类型兼容性
nodejs+express realizes the access to the database mysql and displays the data on the page
Demand analysis of MES management system in electronic assembly industry
Apache DolphinScheduler actual combat task scheduling platform - a new generation of distributed workflow
简单的线性表的顺序表示实现,以及线性表的链式表示和实现、带头节点的单向链表,C语言简单实现一些基本功能
Deng Qinglin, Alibaba Cloud Technical Expert: Best Practices for Disaster Recovery across Availability Zones and Multiple Lives in Different Locations on the Cloud
Vant3 - click on the corresponding name name to jump to the next page corresponding to the location of the name of the TAB bar
Android interview questions and answer analysis of major factories in the first half of 2022 (continuously updated...)
esp32发布机器人电池电压到ros2(micro-ros+CoCube)
IDEA02:配置SQL Server2019数据库
typescript50 - type specification between cross types and interfaces
Vant3—— 点击对应的name名称跳转到下一页对应的tab栏的name的位置
特征值与特征向量
typescript54-泛型约束
Slipper —— 虚点,最短路
typescript58-泛型类
《Greenplum构建实时数据仓库实践》简介
【虚拟化生态平台】虚拟化平台搭建