I have a container that tracks Hosts, Files, and parts of each file:
private static Map<String, Map<String, ArrayList<FileShard>>> globalFileShardMap = new HashMap<String, Map<String, ArrayList<FileShard>>>();
I want to put a new entry into this, and am doing so like:
// filename and shard are known
ArrayList<FileShard> initShard = new ArrayList<FileShard>();
initShard.add(shard);
Map<String, ArrayList<FileShard>> initMap = new HashMap<String, ArrayList<FileShard>>();
initMap.put(filename,initShard);
globalFileShardMap.put(Node.getLocal().getHostname(), initMap);
Is there a way to condense this to a single line, and pass in the new inner Map as a parameter to globalFileShardMap.put
?