Here you can find the source of mapToStringMap(final Object map)
public static Map<String, String> mapToStringMap(final Object map)
//package com.java2s; //License from project: Open Source License import java.util.HashMap; import java.util.Map; public class Main { public static Map<String, String> mapToStringMap(final Object map) { if (!(map instanceof Map<?, ?>)) { throw new IllegalArgumentException( String.format("Cannot cast %s to Map<String, ?>", map.getClass().getName())); }//www .j av a 2 s. c o m Map<String, String> strMap = new HashMap<String, String>(); for (Map.Entry<?, ?> e : ((Map<?, ?>) map).entrySet()) { strMap.put(e.getKey().toString(), e.getValue().toString()); } return strMap; } }