Libraryless. Click here for Pure Java version (2086L/13K).
1 | static <A, B> MultiMap<A, B> mergeMapsToMultiMap(Map<A, B>... maps) { |
2 | ret mergeMapsToMultiMap(asList(maps)); |
3 | } |
4 | |
5 | static <A, B> MultiMap<A, B> mergeMapsToMultiMap(Collection<Map<A, B>> maps) { |
6 | MultiMap<A, B> mm = null; |
7 | for (Map<A, B> m : maps) { |
8 | if (mm == null) mm = emptyMultiMapSimilarToMap(m); |
9 | mm.putAll(m); |
10 | } |
11 | ret uniquifyMultiMapValues(mm); |
12 | } |
Began life as a copy of #1004287
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1023858 |
Snippet name: | mergeMapsToMultiMap - merge maps into a multi map. uniquify values |
Eternal ID of this version: | #1023858/3 |
Text MD5: | ae3598de91da0f8b839fca5c3960605c |
Transpilation MD5: | a350a0eec5f60ed88b9099f74b1f84b6 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-07-10 17:34:13 |
Source code size: | 373 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 204 / 290 |
Version history: | 2 change(s) |
Referenced in: | [show references] |