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

边栏推荐
- 【正则表达式】笔记
- - heavy OpenCV 】 【 mapping
- typescript55 - generic constraints
- 快速入门EasyX图形编程
- C 学生管理系统_分析
- Linux安装mysql最简单教程(一次成功)
- How to copy baby from Taobao (or Tmall store) through API interface to Pinduoduo interface code docking tutorial
- 电子制造企业部署WMS仓储管理系统的好处是什么
- 工程制图名词解释-重点知识
- nodejs+express实现数据库mysql的访问,并展示数据到页面上
猜你喜欢
随机推荐
Analysis: What makes the Nomad Bridge hack unique
VR panorama shooting online exhibition hall, 3D panorama brings you an immersive experience
jmeter distributed stress test
typescript57 - Array generic interface
nodejs+express realizes the access to the database mysql and displays the data on the page
工程制图名词解释-重点知识
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
网页三维虚拟展厅为接入元宇宙平台做基础
C 学生管理系统_添加学生
GNSS[0]- Topic
appium软件自动化测试框架
特征值与特征向量
工程制图平面投影练习
Google Earth Engine - Calculates the effective width of rivers using publicly available river data
数组_滑动窗口 | leecode刷题笔记
LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之三:两次优化
Installation and configuration of nodejs+npm
Apache DolphinScheduler actual combat task scheduling platform - a new generation of distributed workflow
取模运算(MOD)
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.