I have a Map of Maps that looks like this:
Map<String, Map<String, Object>> data;
I want to update the inner map.
Should I do the following everytime I want to update the innermap or is there any other direct/better way of accomplishing it?
Map<String, Object> innerMap = data.get("outer_key");
innerMap.put("inner_key", value);
data.put("outer_key", innerMap);
I think you may have a typo in there and I’m assuming
inneris actuallyinnerMap. I would probably change it a bit to account fornullvalues in the outer map: