package com.ycgis.macall.personalcenter.util;

import com.rs.macall.androidx.basemodel.utils.StringUtil;

import java.util.HashMap;
import java.util.Map;

public class ParamMap {
    private Map<String,String> param ;

    public ParamMap(){
        param = new HashMap<>();
    }

    public ParamMap put(String key,String value){
        if (key == null ||value == null) return this;
        param.put(key.trim(),value.trim());
        return this;
    }


    public String get(String key){
        return get(key,"");
    }
    public String get(String key,String defValue){
        if (key == null) return defValue;
        return param.get(key.trim());
    }

    public Map<String,String> apply(){
        return param;
    }

    public String remove(String key){
        if (StringUtil.isNullOrEmpty(key))return "";
        return param.remove(key.trim());
    }

    public boolean isEmpty(){
        return param.isEmpty();
    }

}
