本文共 162 字,大约阅读时间需要 1 分钟。
List userList=new ArrayList<>();//把实体里面的Id单独抽取出来 Map userInfoMap= userList.stream().collect(Collectors.toMap(User::getId, Function.identity()));
转载地址:http://rswb.baihongyu.com/