Java Utililty Methods HashMap to String

List of utility methods to do HashMap to String

Description

The list of methods to do HashMap to String are organized into topic(s).

Method

StringtoString(HashMap map)
to String
StringBuilder sb = new StringBuilder("[");
for (Entry<Integer, Long> entry : map.entrySet()) {
    sb.append(entry.getKey() + ":" + entry.getValue() + " ");
sb.append("]");
return sb.toString();
String[]toStringArray(HashMap syms)
Convert a HashMap to string array
String[] res = new String[syms.size()];
for (String sym : syms.keySet()) {
    res[syms.get(sym)] = sym;
return res;
StringtoStringLong(HashMap map)
to String Long
String display = "[";
for (Map.Entry<Long, Long> entry : map.entrySet()) {
    display += entry.getKey() + " : " + entry.getValue() + ", ";
display = display.substring(0, display.length() - 2) + "]";
return display;