I want to populate a HashMap using the Properties class. I want to load the entries in the .propeties file and then copy it into
HashMap
Properties
.propeties
Java 8 Style:
Properties properties = new Properties(); // add some properties here Map map = new HashMap(); map.putAll(properties.entrySet() .stream() .collect(Collectors.toMap(e -> e.getKey().toString(), e -> e.getValue().toString())));