当前位置:网站首页>Object object to list collection
Object object to list collection
2022-06-28 05:55:00 【In the past and present】
/**
* Object Object turn List aggregate
*
* @param object Object object
* @param clazz The set that needs to be converted
* @param <T> Generic classes
* @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;
}
边栏推荐
- 什么是WebRTC?
- Oracle 常用基础函数
- 6. 毕业设计温湿度监控系统(ESP8266 + DHT11 +OLED 实时上传温湿度数据给公网服务器并在OLED显示屏上显示实时温湿度)
- UICollectionViewDiffableDataSource及NSDiffableDataSourceSnapshot使用介绍
- Enum
- 深度學習19種損失函數
- @Autowired注解为空的原因
- Syn retransmission caused by IPVS
- Qtcanpool knowledge 07:ribbon
- Solution of dam safety automatic monitoring system for medium and small reservoirs
猜你喜欢

Filecoin hacker song developer competition

Mysql-17- create and manage tables

一看就会 MotionLayout使用的几种方式

pytorch详解

Ethereum Classic的难度计算|猿创征文

Yygh-8-appointment registration

Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance

Capacity scheduling absolute value configuration queue usage and pit avoidance

Binder interview: memory management unit

Lhasa accordion
随机推荐
解决ValueError: Iterable over raw text documents expected, string object received.
YYGH-BUG-02
Binder interview: memory management unit
RL practice (0) - and the platform xinchou winter season [rule based policy]
Small ball playing
数据仓库:DWS层设计原则
Syn retransmission caused by IPVS
若依实现下拉框
JSP connecting Oracle to realize login and registration
FB、WhatsApp群发消息在2022年到底有多热门?
Important basis for ERP software company selection
5G网络整体架构
Animation de ligne
What are the advantages of e-mail marketing? Why do sellers of shopline independent station attach so much importance to it?
Windows环境Redis使用AOF持久化,无法生成AOF文件,生成后无法加载AOF文件内容
Use of JDBC
Lenovo hybrid cloud Lenovo xcloud, new enterprise IT service portal
预训练模型参数不匹配
A full set of excellent SEO tutorials worth 300 yuan [159 lessons]
Lhasa accordion