List of utility methods to do Map to String
String | mapToStr(java.util.Map hm, char sep1, char sep2) map To Str if (hm == null || hm.isEmpty()) return null; StringBuffer buffer = new StringBuffer(); java.util.Iterator<java.util.Map.Entry> iter = hm.entrySet().iterator(); while (iter.hasNext()) { java.util.Map.Entry entry = (java.util.Map.Entry) iter.next(); buffer.append(entry.getKey()); buffer.append(sep1); ... |
String | mapToStr(Map map To Str StringBuilder sb = new StringBuilder(); boolean isFirst = true; sb.append("{"); for (Map.Entry<String, ?> entry : map.entrySet()) { if (isFirst) isFirst = false; else sb.append(","); ... |
String | mapToStr(Map map To Str String str = ""; Set<String> keySet = map.keySet(); Iterator<String> iter = keySet.iterator(); while (iter.hasNext()) { String key = iter.next(); str += key + "=" + map.get(key) + "&"; return str.substring(0, str.length() - 1); ... |
String | mapToString(final Map, ?> m) Converts a Map into a String return m == null ? null : collectionToString(m.entrySet());
|
String | mapToString(final Map Transforms a map to a string containing name-value pairs separated by '&'. final StringBuilder sb = new StringBuilder(); for (Map.Entry<String, String> e : m.entrySet()) { sb.append(e.getKey().replace("&", "&&")).append('='); final String value = e.getValue(); if (value != null) sb.append(e.getValue().replace("&", "&&")); sb.append('&'); sb.setLength(sb.length() - 1); return sb.toString(); |
String | mapToString(final Map map To String String s = ""; for (final Map.Entry<String, String> entry : map.entrySet()) { s += entry.getKey() + ":" + entry.getValue() + ";"; if (s.length() > 0) { s = s.substring(0, s.length() - 1); return s; ... |
String | mapToString(Map map) Converts the given map of objects to string as a comma-separated list. if (map == null) { return "<null>"; } else if (map.isEmpty()) { return "<none>"; } else { StringBuilder s = new StringBuilder(); Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { ... |
String | mapToString(Map map) Outputs entries from a Map to a String . return mapToString(map, "=", ", "); |
String | mapToString(Map map) map To String if (map == null) return "null"; if (map.size() == 0) return "empty"; StringBuilder sb = new StringBuilder(); sb.append("{"); for (Object o : map.entrySet()) { Map.Entry me = (Entry) o; ... |
String | mapToString(Map map) map To String if (map == null) { return null; StringBuffer sBuffer = new StringBuffer(); Iterator keys = map.keySet().iterator(); while (keys.hasNext()) { Object key = keys.next(); sBuffer.append("\n").append(key).append(" = ").append(map.get(key)); ... |