Collection和Map转换

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
}
hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » Collection和Map转换