We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Original issue created by bordoley on 2012-01-11 at 05:09 AM
Would it be possible to add the following static methods (or similar) to ImmutableMap/Multimap etc:
ImmutableMultimap.of(Iterable<Map.Entry<K,V>>) ImmutableMultimap.Builder.putAll(Iterable<Map.Entry<K,V>>)
Use case would be where you want to transform a Multimap<K1,V> to Multimap<K2,V>
I'm imagining something like:
Multimap<Object, String> in = ....; ImmutableMultimap<String, String> out = ImmutableMultimap.of( Iterables.transform(in.entries(), new Function<Map.Entry<Object,String>, Map.Entry<String,String>>() { @Override public Map.Entry<String, String> apply(Map.Entry<Object, String> input) { return new AbstractMap.SimpleEntry(input.getKey().toString(), input.getValue()); }}));
The text was updated successfully, but these errors were encountered:
Original comment posted by wasserman.louis on 2012-01-11 at 05:13 PM
(No comment entered for this change.)
Status: Duplicate Merged Into: #320
Duplicate
Sorry, something went wrong.
No branches or pull requests
Original issue created by bordoley on 2012-01-11 at 05:09 AM
Would it be possible to add the following static methods (or similar) to ImmutableMap/Multimap etc:
ImmutableMultimap.of(Iterable<Map.Entry<K,V>>)
ImmutableMultimap.Builder.putAll(Iterable<Map.Entry<K,V>>)
Use case would be where you want to transform a Multimap<K1,V> to Multimap<K2,V>
I'm imagining something like:
The text was updated successfully, but these errors were encountered: