Gson之map解析

独自等待 2015-10-20

需求:

把json字符串解析成map

实现:

Gson gson = new GsonBuilder().enableComplexMapKeySerialization()
		.create();
String param = "xxxxxxx";
Map<String, Map<String, List<MpAppInfo>>> inParams = gson.fromJson(
		param,
		new TypeToken<Map<String, Map<String, List<MpAppInfo>>>>() {
		}.getType());

解决了泛型和key-value序列化

相关推荐

nalanrumeng / 0评论 2020-04-09