I have a method that iterates over a Map and performs an operation on the value and populates a Map to return.
My question is, how do I convert this to Java 8 (perform the operation without looping)?
Code:
private static Map<String, Object> iterateAndConvertValueXmlToString(Map<String, Object> data) {
Map<String, Object> returnMap = new HashMap<>();
for (Map.Entry<String,Object> entry : data.entrySet()) {
returnMap.put(entry.getKey(), getXmlAsString((String)entry.getValue()));
}
return returnMap;
}