/** * 根据 map的value值获取key值 * @param map * @param value * @return */ public static String getKeyFromValue(Map<String, String> map, String value) { String mKey = ""; Set<String> keySet = map.keySet(); for (String key : keySet) { if ( value.equals(map.get(key)) ) { mKey = key; } } return mKey; }
标签:map,java,String,value,keySet,key,mKey From: https://www.cnblogs.com/bluestorm/p/17457937.html