我有一個List<String> abc
集合。我需要將它轉換爲Map<String, TreeSet<String>
,其中鍵是abc
的排序字符串,並且此排序前的字符串被添加到TreeSet。 有可能使用Collectors.toMap()
?列表到地圖 - Collectors.toMap()
ex。僞代碼: List<String> abc = ["ala","laa","qwe"]
Map<String, TreeSet<String> = {key = "aal" , values in treeset = "ala" , "laa" key = "eqw" values in treeset = "qwe"}
你能提供什麼樣的列表包含和什麼地圖包含示例值? – developer
對應於'abc'鍵的'TreeSet'值應該是多少? – nullpointer
已添加僞代碼。 –