You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There’s Multimaps.asMap to transform a SetMultimap<K, V> to a Map<K, Set<V>>, but there’s no Multimaps.asMap to transform an ImmutableSetMultimap<K, V> to a Map<K, ImmutableSet<V>>, it seems.
Have you considered adding this method? Is it already available somehow?
Currently I copy the content into a new ImmutableSetMultimap, which seems unnecessary: Multimaps.asMap(myImmutableSetMultimap).entrySet().stream().collect(ImmutableMap.toImmutableMap((e) -> e.getKey(), (e) -> ImmutableSet.copyOf(e.getValue())))
The text was updated successfully, but these errors were encountered:
We talked about this at least once. The main complication I recall is that it's not source-compatible: A call to asMap(immutableSetMultimap) would change return types as you've indicated, and the new type might not work where the old does. It's still a possibility -- maybe under another method name? -- we're just not sure.
There’s
Multimaps.asMap
to transform aSetMultimap<K, V>
to aMap<K, Set<V>>
, but there’s noMultimaps.asMap
to transform anImmutableSetMultimap<K, V>
to aMap<K, ImmutableSet<V>>
, it seems.Have you considered adding this method? Is it already available somehow?
Currently I copy the content into a new
ImmutableSetMultimap
, which seems unnecessary:Multimaps.asMap(myImmutableSetMultimap).entrySet().stream().collect(ImmutableMap.toImmutableMap((e) -> e.getKey(), (e) -> ImmutableSet.copyOf(e.getValue())))
The text was updated successfully, but these errors were encountered: