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()
)
);
本文标题:JSONArray转以某字段为key的Map
本文链接:https://www.haomeiwen.com/subject/rupvnctx.html
网友评论