@SuppressWarnings({ "rawtypes", "unchecked" })
public static Map<String, Map<Integer, String>> getNodeAlarmInfoConfig(String filePath) {
InputStream is = JsonTest.class.getResourceAsStream("/META-INF/test.json");
String result;
try {
result = IOUtils.toString(is);
} catch (IOException e) {
e.printStackTrace();
return new HashMap<>();
}
Map<String, Map<Integer, String>> config = new HashMap<>();
HashMap map = new Gson().fromJson(result, HashMap.class);
Set<Map.Entry> entrySet = map.entrySet();
for (Map.Entry entry : entrySet) {
String key = (String) entry.getKey();
Map<Integer, String> innerMap = new HashMap<>();
for (Object obj : (List) entry.getValue()) {
Double innerKey = (Double) (((Map) obj).get("key"));
innerMap.put(innerKey.intValue(), (String) ((Map) obj).get("value"));
}
config.put(key, innerMap);
}
return config;
}