取出属性为集合
List<String> stateNameList = dictEntityList.stream().map(DictEntity::getName).collect(Collectors.toList());
取出属性为数组
Long[] ids = dictEntityList.stream().map(DictEntity::getId).toArray(Long[]::new);
集合去重
dictEntityList.stream().distinct().collect(Collectors.toList());
原创文章,作者:6024010,如若转载,请注明出处:https://blog.ytso.com/243865.html