Java Utililty Methods HashMap Convert

List of utility methods to do HashMap Convert

Description

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

Method

Object[][]hashMapToArray(HashMap map)
Converts a HashMap to a 2-column array {key, value}
return mapToArray(map);
StringHashMapToParamsString(HashMap params)
Hash Map To Params String
String output = "";
for (String key : params.keySet()) {
    output += key + ":" + params.get(key) + " ";
return output.trim();
StringhashMapToString(HashMap map)
Create a string representation of hash map as key="value" key="value" ...
StringBuffer text = new StringBuffer();
boolean isFirst = true;
for (Map.Entry<String, ?> e : map.entrySet()) {
    if (!isFirst)
        text.append(' ');
    text.append(e.getKey()).append("=\"").append(e.getValue().toString()).append('"');
    isFirst = false;
return text.toString();
ArrayList>toArrayListHashMapStrObj(Object object)
replacement of casting as from Object to ArrayList<HashMap<String, Object>> without annoying warning.
if (object == null) {
    return null;
return (ArrayList<HashMap<String, Object>>) object;