List of utility methods to do Properties
void | setProperty(Properties props, String keyword, Object value) set Property if (props != null) { String s = (value != null ? value.toString() : null); props.setProperty(keyword, s != null ? s : ""); |
List | stringPropertyNames(Properties props, String prefix) string Property Names if (prefix.endsWith(".")) { prefix = prefix.substring(0, prefix.length() - 1); List<String> keys = new LinkedList<>(); for (String key : props.stringPropertyNames()) { if (key.equals(prefix) || key.startsWith(prefix + ".")) { keys.add(key); Collections.sort(keys); return keys; |
Properties | stringToProperties(String str) This method converts a comma-separated String (with whitespace optionally allowed after the comma) representing properties to a Properties object. Properties result = new Properties(); String[] props = str.trim().split(",\\s*"); for (String term : props) { int divLoc = term.indexOf("="); String key; String value; if (divLoc >= 0) { key = term.substring(0, divLoc); ... |
Properties | toProperties(Map to Properties Properties properties = new Properties(); properties.putAll(parse); return properties; |
Map | transformPropertiesToParams(Map Transform properties to Map of parameters. Map<String, Object> params = new HashMap<>(); for (Map.Entry<String, String> entry : properties.entrySet()) { params.put(entry.getKey(), entry.getValue()); return params; |