I have data like this {"Atr1":{"col":1,"row":1}, "Atr2":{"col":1,"row":2}, ...}. the columns and rows are always fixed, so I want to create final attribute in java.
How to initialize Map<String, Map<String, Integer>> and the values.
I have tried the following code, is there a better way?
private final Map<String, HashMap<String, Integer>> FIELD_TO_INDEX = new HashMap<String, HashMap<String, Integer>>() {
        private static final long serialVersionUID = 1L;
        {
            put("Atr1",
                    new HashMap<String,Integer>(){
                        private static final long serialVersionUID = 1L;
                        {
                            put("col",1);
                            put("row",1);
                        }
                    }
            );
            put("Atr2",
                    new HashMap<String,Integer>(){
                private static final long serialVersionUID = 1L;
                {
                    put("col",1);
                    put("row",2);
                }
            }
                    );
            put("Atr3",
                    new HashMap<String,Integer>(){
                private static final long serialVersionUID = 1L;
                {
                    put("col",1);
                    put("row",3);
                }
            }
                    );
        
}
    };
 
 
     
    