list 对象转listmap
时间: 2023-11-24 07:51:08 浏览: 104
以下是Java中将List对象转换为List
List<ApiBase> apiBaseList = apiBaseMapper.selectAll();
List<Map<String, Object>> apiMapList = apiBaseList.stream().map(it -> {
Map<String, Object> apiMap = new HashMap<>();
apiMap.put("id", it.getId());
apiMap.put("name", it.getName());
return apiMap;
}).collect(Collectors.toList());
以上代码中,我们首先获取了一个List
相关推荐
















