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

边栏推荐
猜你喜欢

工程制图复习题(带答案)

js中常用的几种遍历处理数据的方法梳理

敏捷交付的工程效能治理

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

nodejs+express realizes the access to the database mysql and displays the data on the page

【OpenCV】-重映射
通用的测试用例编写大全(登录测试/web测试等)

2022年上半年各大厂Android面试题整理及答案解析(持续更新中......)

typescript54 - generic constraints

Demand analysis of MES management system in electronic assembly industry
随机推荐
计算首屏时间
114. How to find the cause of Fiori Launchpad routing error by single-step debugging
Analysis: What makes the Nomad Bridge hack unique
XSS - Bypass for loop filtering
Array_Sliding window | leecode brushing notes
简单的线性表的顺序表示实现,以及线性表的链式表示和实现、带头节点的单向链表,C语言简单实现一些基本功能
Google Earth Engine - Calculates the effective width of rivers using publicly available river data
MongoDB数据接入实践
typescript52 - simplify generic function calls
【Untitled】
typescript53-泛型约束
2022 中国算力大会发布“创新先锋”优秀成果
Electronics manufacturing enterprise deployment WMS what are the benefits of warehouse management system
typescript58-泛型类
html select标签赋值数据库查询结果
【虚拟化生态平台】虚拟化平台esxi挂载USB硬盘
字符串变形
分析:Nomad Bridge黑客攻击的独特之处
[store mall project 01] environment preparation and testing
typescript51 - basic use of generics