java stream 将List转换成Map

userList.stream().collect(Collectors.toMap(User::getId, User::getName));
userList.stream()

你可能感兴趣的:(stream,stream,lambda,java)