List of utility methods to do Properties to Map
Map | toMap(Properties properties) Returns a Map<String, String> out of a Java Properties object.
Map<String, String> result = new HashMap<String, String>(properties.size()); for (Map.Entry<Object, Object> parameter : properties.entrySet()) { String value = null; if (parameter.getValue() != null) { value = parameter.getValue().toString(); result.put(parameter.getKey().toString(), value); return result; |
Map | toMap(Properties properties) to Map Map<String, String> result = new HashMap<String, String>(properties.size()); for (String key : properties.stringPropertyNames()) { result.put(key, properties.getProperty(key)); return result; |
Map | toMap(Properties props) to Map return new HashMap(props); |
Map | toMap(Properties props) to Map return props == null ? new HashMap<String, String>() : new HashMap<String, String>((Map) props); |
Map | toMap(Properties props) to Map HashMap<String, V> result = new HashMap<>(); for (String name : props.stringPropertyNames()) { result.put(name, (V) props.getProperty(name)); return result; |
Map | toMap(Properties props) to Map Set<String> names = props.stringPropertyNames(); HashMap<String, Object> map = new HashMap<String, Object>(names.size()); for (String name : names) { map.put(name, props.getProperty(name)); return map; |
Map | toMap(Properties props, String prefix) to Map Map<String, String> map = new HashMap<>(); for (String key : props.stringPropertyNames()) { if (key.startsWith(prefix)) { map.put(key.substring(prefix.length()), props.getProperty(key)); return map; |
Map | toMap(Properties sourceProperties) Make a Map<String, String> from the supplied Properties, copying all the keys and values. if (sourceProperties == null) { return null; Map<String, String> configMap = new HashMap<String, String>(); Iterator<?> iter = sourceProperties.keySet().iterator(); while (iter.hasNext()) { String key = (String) iter.next(); configMap.put(key, sourceProperties.getProperty(key)); ... |