Hi All,
I am part of a project where we are facing a serious problem of restructuring the existing dictionaries of Hashmap. The code looks like :
Map<
String, Map<String, String>> level1 = new HashMap<String, Map<String, String>>();
Map<String, Map<String, Map<String, String>>> level2 = new HashMap<String, Map<String, Map<String, String>>>();
This is used for generating reports and there are certain condition on this maps to check if XXX is present in these dictionaries then add that column/part on report.
Client wants to get rid of these dictionaries of Hashmap, basically they are looking for a good design.
I tried to provide a wrapper class around these structure like:
class Level1 extends Map<String, String>{}
class Level2 extends Map<String, Level1>{}
with this code looks good and and there is no need to change other part of existing code, but we are looking for some better solution.
If anyone can suggest better approach or design would be great help.
Thank you in advance.