List of utility methods to do Properties
void | mergePropertiesIntoMap(Properties props, Map map) Merge the given Properties instance into the given Map, copying all properties (key-value pairs) over. if (map == null) { throw new IllegalArgumentException("Map must not be null"); if (props != null) { for (Enumeration en = props.propertyNames(); en.hasMoreElements();) { String key = (String) en.nextElement(); Object value = props.getProperty(key); if (value == null) { ... |
void | mergePropertiesIntoMap(Properties props, Map map) merge Properties Into Map if (map == null) { throw new IllegalArgumentException("Map must not be null"); } else { if (props != null) { Enumeration en = props.propertyNames(); while (en.hasMoreElements()) { String key = (String) en.nextElement(); map.put(key, props.getProperty(key)); ... |
void | mergeSystemProperties(Properties properties) Add properties to the system properties. if (properties == null) return; Enumeration enumeration = properties.propertyNames(); while (enumeration.hasMoreElements()) { String name = (String) enumeration.nextElement(); if (System.getProperty(name) == null) { String value = properties.getProperty(name); System.setProperty(name, value); ... |
Object | propertiesToJson(Properties properties) properties To Json Map<String, String> jsonObj = new HashMap<String, String>(); if (properties != null) { Set<String> keys = properties.stringPropertyNames(); for (String key : keys) { jsonObj.put(key, properties.getProperty(key)); return jsonObj; ... |
Map | propertiesToMap(Properties props) properties To Map Map<String, String> map = new HashMap<>(); for (String key : props.stringPropertyNames()) { String value = props.getProperty(key); map.put(key, value); return map; |
void | putAll(final Map put All for (Enumeration<?> e = p.propertyNames(); e.hasMoreElements();) {
String s = (String) e.nextElement();
props.put(s, p.getProperty(s));
|
void | putAll(Properties properties, Map Copies all elements from properties into the given result .
for (Enumeration<Object> keys = properties.keys(); keys.hasMoreElements();) {
String key = (String) keys.nextElement();
result.put(key, properties.getProperty(key));
|
Properties | putPrefixToProperties(String prefix, Properties pro) put Prefix To Properties Enumeration en; Properties res = new Properties(); en = pro.propertyNames(); for (; en.hasMoreElements();) { String nom = (String) en.nextElement(); res.setProperty(prefix + nom, pro.getProperty(nom)); return res; ... |
void | removeDots(Properties props) remove Dots Enumeration keys = props.keys(); HashMap hash = new HashMap(); boolean done = false; for (; keys.hasMoreElements();) { String key = (String) keys.nextElement(); if (key.indexOf('.') != -1) { int len = key.length(); int newLen = 0; ... |
Map | search(List search Map<String, String> collect = properties.stream().filter(line -> line.split("=")[0].contains(term)) .map(line -> { Map<String, String> stringStringHashMap = new HashMap<>(); stringStringHashMap.put(line.split("=")[0], line.split("=")[1]); return stringStringHashMap; }).reduce((stringStringMap, stringStringMap2) -> { stringStringMap.putAll(stringStringMap2); return stringStringMap; ... |