开发中很多情况都会这样。
转换方式分几种 第一种是 JSON
都使用JDK 1.8 后的 Lambda 表达式 ,强烈推荐!!!
taskFlows.stream().map(e-> JsonUtils.toBean(JSONUtil.toJsonStr(e),ApplyTaskFlowLog.class))
二种是org.springframework.beans 类似迭代器转换
List<ApplyTaskFlowLog> flowLogs = taskFlows.stream().map(e -> {
ApplyTaskFlowLog taskLog = new ApplyTaskFlowLog();
BeanUtils.copyProperties(e, taskLog);
return taskLog;
}).collect(Collectors.toList());