JSONArray转以某字段为key的Map
2019-12-19 本文已影响0人
何佳阳
Map collect = menuQueue.stream().collect(
Collectors.toMap(
i -> {
JSONObject a= (JSONObject)i;
String k = a.getString("index");
return k;
},
Function.identity()
)
);
Map collect = menuQueue.stream().collect(
Collectors.toMap(
i -> {
JSONObject a= (JSONObject)i;
String k = a.getString("index");
return k;
},
Function.identity()
)
);