List of utility methods to do Map to Properties
Properties | mapToProperties(Map params) map To Properties Properties p = new Properties(); for (Iterator iterator = params.keySet().iterator(); iterator.hasNext();) { String name = (String) iterator.next(); String value = (String) params.get(name); if (value != null) { p.setProperty(name, value); return p; |
String | mapToProperties(Map Convert string of comma separated properties to a map. StringBuilder propertyBuilder = new StringBuilder(); boolean hasAtLeastOneKey = false; for (String key : propertyMap.keySet()) { if (hasAtLeastOneKey) { propertyBuilder.append(", "); if (!key.isEmpty()) { hasAtLeastOneKey = true; ... |
String[] | mapToProperties(Map Converts a map into an array of strings. if (map == null) return null; String[] properties = new String[map.size() * 2]; int counter = 0; for (Map.Entry<String, String> entry : map.entrySet()) { properties[counter++] = entry.getKey(); properties[counter++] = entry.getValue(); return properties; |