[英]Contruct json into Map<String, Object>
我想將以下 json 構造成 Map<String, Object>
{"tm":"3-ticker-payout-history-full-screen","r":"ES","default_tab":"overview","slug":"alt-group","only":["meta","data","thead"]}
以下是我到目前為止所擁有的
Map<String, Object> map = new HashMap<>();
map.put("tm", "3-ticker-payout-history-full-screen");
map.put("slug", "alt-group");
map.put("r", "ES");
map.put("default_tab", "overview");
我如何將"only":["meta","data","thead"]
到哈希圖中?
您可以創建一個List<String>
並將"meta","data","thead"
添加到列表中,然后將List<String>
添加到地圖中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.