Guava Optional LinkedHashMultimap version?

I want to create an immutable version of LinkedHashMultiMap. I can roll my own using ImmutableMap and ImmutableList, but wondering if there is a way to extend Guava for this. For example, using Forwarding or Supplier.

+3
java immutability multimap guava


source to share


1 answer


It's not clear if you want ListMultimap

or SetMultimap

, but you will almost certainly want to ImmutableListMultimap

and ImmutableSetMultimap

accordingly anyway. Like all immutable collections, it will still preserve the insertion order exactly the same as LinkedHashMultimap

.



Guava's unmatched collections are very intentionally non-extensible.

+4


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics