Here you can find the source of mapToString(final Map
public static String mapToString(final Map<String, String> map)
//package com.java2s; // Licensed to the Apache Software Foundation (ASF) under one import java.util.Map; public class Main { public static String mapToString(final Map<String, String> map) { String s = ""; for (final Map.Entry<String, String> entry : map.entrySet()) { s += entry.getKey() + ":" + entry.getValue() + ";"; }// ww w .ja v a 2s .c om if (s.length() > 0) { s = s.substring(0, s.length() - 1); } return s; } }