0
我有一個multimap。從Multimap中的鍵獲得JSONArray值
Multimap<String,JSONArray> map = ArrayListMultimap.create();
我想獲得所有基於關鍵值。但是,當我嘗試,我收到以下錯誤:
Exception details: java.lang.ClassCastException:
com.google.common.collect.AbstractMultimap$RandomAccessWrappedList cannot be
cast to org.json.JSONArray
java.lang.ClassCastException:
com.google.common.collect.AbstractMultimap$RandomAccessWrappedList cannot be
cast to org.json.JSONArray
我試圖做的事:
for (final String str : map.keySet()) {
final JSONArray jsonArr = (JSONArray) map.get(str);
//do something
}
有人能想出如何讓jsonArray每個鍵集?
'skillSetMap'是什麼類型?你如何填充它? – shmosel
@shmosel對不起,這只是一個map.corrected問題。 – SMP
只是一個地圖或多圖?你瞭解multimaps的工作原理嗎? – shmosel