【发布时间】:2019-05-12 23:30:04
【问题描述】:
基于此Question...
我有这个代码:
List<IdDTO> ids = collectionEntityDTO.stream().map(EntityDTO::getId).collect(Collectors.toList());
List<Long> codes = ids.stream().map(IdDTO::getCode).collect(Collectors.toList());
Long[] arrayCodes = codes.toArray(new Long[0]);
如何以这种简单的方式做到这一点?
【问题讨论】:
标签: java java-8 java-stream