Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建 LinkedHashMultiMap 的不可变版本。我可以使用 ImmutableMap 和 ImmutableList 推出自己的产品,但想知道是否有办法扩展 Guava 来做到这一点。例如,使用转发或供应商。
目前尚不清楚您是否想要 aListMultimap或 a ,但无论如何SetMultimap您几乎可以肯定分别想要ImmutableListMultimap和。ImmutableSetMultimap像所有不可变集合一样,它仍然会保留与LinkedHashMultimap.
ListMultimap
SetMultimap
ImmutableListMultimap
ImmutableSetMultimap
LinkedHashMultimap
Guava 的不可变集合非常刻意不可扩展。