<Map>循环Map,如果key为空字符串,将value改为null

代码:


	Map<String, Object> paramMap = new HashMap<>();
    Iterator<Map.Entry<String, Object>> it = paramMap.entrySet().iterator();
    while(it.hasNext()){
        Map.Entry<String, Object> entry = it.next();
        String key = entry.getKey();
        String value = String.valueOf(entry.getValue());
        if(value.equals("")){
            paramMap.put(key,null);
        }
    }

你可能感兴趣的:(ListMap,java,数据库,前端)