当前位置:网站首页>Object对象转 List集合
Object对象转 List集合
2022-06-28 05:44:00 【今昔在】
/**
* Object对象转 List集合
*
* @param object Object对象
* @param clazz 需要转换的集合
* @param <T> 泛型类
* @return
*/
public static <T> List<T> changeList(Object object,Class<T> clazz){
try {
List<T> result = new ArrayList<>();
if (object instanceof List<?>){
for (Object o : (List<?>) object) {
String string = JSONObject.toJSONString(o);
T t = JSONObject.parseObject(string, clazz);
result.add(t);
}
return result;
}
return null;
}catch (Exception e){
e.printStackTrace();
log.error(e.getMessage());
}
return null;
}
边栏推荐
- 【C语言练习——打印空心正方形及其变形】
- numpy. reshape, numpy. Understanding of transfer
- 联想混合云Lenovo xCloud,新企业IT服务门户
- Oracle基础知识总结
- Application of Beidou No.3 short message terminal in dam safety monitoring scheme
- pytorch详解
- @Autowired注解为空的原因
- Data warehouse: financial / banking theme layer division scheme
- 6. graduation design temperature and humidity monitoring system (esp8266 + DHT11 +oled real-time upload temperature and humidity data to the public network server and display the real-time temperature
- Syn retransmission caused by IPVS
猜你喜欢
![[CAD drawing Video] AutoCAD 2014 master's way](/img/19/7013333c028d7db02e356661b9ffc3.jpg)
[CAD drawing Video] AutoCAD 2014 master's way

Binder面试之:内存管理单元

Gee learning notes 3- export table data

Create NFS based storageclass on kubernetes

什么是WebRTC?
![A full set of excellent SEO tutorials worth 300 yuan [159 lessons]](/img/d7/7e522143b1e6b3acf14a0894f50d26.jpg)
A full set of excellent SEO tutorials worth 300 yuan [159 lessons]

函数栈帧的创建和销毁

5G网络整体架构

小球弹弹乐

Interpretation of cloud native microservice technology trend
随机推荐
线条动画
Oracle 常用基础函数
学术搜索相关论文
YYGH-7-用户管理
FB、WhatsApp群发消息在2022年到底有多热门?
Mysql-16-subquery
Filecoin hacker song developer competition
bash install. SH ******** error
数据中台:一篇带你深入浅出了解数据中台
1404. number of steps to reduce binary representation to 1
上海域格ASR CAT1 4g模块2路保活低功耗4G应用
JS中的链表(含leetcode例题)<持续更新~>
数据中台:数据治理的七把利剑
Filecoin黑客松开发者大赛
MySQL 45 talk | 05 explain the index in simple terms (Part 2)
基于Kotlin+JetPack实现的MVVM框架的示例
Data warehouse: DWS layer design principle
Mysql-17- create and manage tables
Important basis for ERP software company selection
Shanghai Yuge ASR CAT1 4G module 2-way low power 4G application