I have this code:
我有这个代码:
public static Map buildMap(Map map){
Map data = new HashMap();
Map mapStorage = new HashMap();
Set<Map.Entry<String, Class<?>>> entryset = map.entrySet();
for (Map.Entry<String, Class<?>> entry : entryset) {
String key = entry.getKey();
Class<?> val = entry.getValue();
if(key.contains("_")){
String mapName = key.substring(0, key.indexOf("_"));
String mapKey = key.substring(key.indexOf("_")+1, key.length());
Class<?> mapValue = val;
boolean mapFound = false;
Set<Map.Entry<String, Map>> entryset1 = mapStorage.entrySet();
for (Map.Entry<String, Map> entry1 : entryset1) {
String key1 = entry1.getKey();
Map val1 = entry1.getValue();
if(key1.equals(mapName)){
val1.put(mapKey, mapValue);
mapFound = true;
}
}
if(!mapFound){
Map m = new HashMap();
m.put(mapKey, mapValue);
mapStorage.put(mapName, m);
}
}else{
data.put(key, val);
}
}
Set<Map.Entry<String, Map>> entryset2 = mapStorage.entrySet();
for (Map.Entry<String, Map> entry2 : entryset2) {
String key = entry2.getKey();
Map val = entry2.getValue();
data.put(key, val);
}
return data;
}
public static Map