Collection和Map转换
1 List -> Map
设个User类:
public class User { private String userName; private String userId; private String userInfo; public User(){} public User(String userName, String userId, String userInfo) { this.userName = userName; this.userId = userId; this.userInfo = userInfo; } //getter setter }