Here you can find the source of mapToStr(Map
public static String mapToStr(Map<String, Object> map)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static String mapToStr(Map<String, Object> map) { String str = ""; Set<String> keySet = map.keySet(); Iterator<String> iter = keySet.iterator(); while (iter.hasNext()) { String key = iter.next(); str += key + "=" + map.get(key) + "&"; }// w w w . j a v a 2 s . c om return str.substring(0, str.length() - 1); } }