Java Map to String mapToString(Map map)

Here you can find the source of mapToString(Map map)

Description

Convert a map to a string of key/val pairs of the form key1=val1, separated by semicolons.

License

Creative Commons License

Parameter

Parameter Description
map the map to convert

Return

the string

Declaration

public static String mapToString(Map<String, String> map) 

Method Source Code

//package com.java2s;

import java.util.Map;

public class Main {
    /**//w  ww .  ja  v  a 2  s.c o  m
     * Convert a map to a string of key/val pairs of the form key1=val1, separated by semicolons.
     *
     * @param map the map to convert
     * @return the string
     */
    public static String mapToString(Map<String, String> map) {
        String ret = "";
        for (String key : map.keySet()) {
            ret += key + "=" + map.get(key) + "; ";
        }
        return ret;
    }
}

Related

  1. mapToString(Map map)
  2. mapToString(Map criteria)
  3. mapToString(Map map)
  4. mapToString(Map map)
  5. mapToString(Map map)
  6. MapToString(Map map)
  7. mapToString(Map map)
  8. mapToString(Map parameterMap)
  9. mapToString(Map map, String splitter)