본문 바로가기
IT 자료

java list map <string, string> to <string, object>

by 성곤 2021. 1. 27.
반응형

java list map <string, string> to <string, object>

 

 

	public List<Map<String, Object>> convert(List<Map<String, String>> paramList){
		
		List<Map<String, Object>> ret = new ArrayList<Map<String, Object>>();
		
		for (Map<String, String> map: paramList) { 
			
		    Map<String, Object> newMap = new HashMap<String, Object>();
		    
		    for (Entry<String, String> entry: map.entrySet()) {
		        newMap.put(entry.getKey(), entry.getValue());
		    }
		    ret.add(newMap);
		}
		
		return ret;
	}
반응형