Libraryless. Click here for Pure Java version (2576L/16K).
static <A, B> Map<A, B> filterByValue(Map<A, B> map, B value) { Map<A, B> m2 = similarEmptyMap(map); for (A key : keys(map)) { B b = map.get(key); if (eq(b, value)) m2.put(key, b); } ret m2; } static <A, B> Map<A, B> lambdaMapLike filterByValue(IPred<B> pred, Map<A, B> map) { ret filterByValuePredicate(pred, map); }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1008064 |
| Snippet name: | filterByValue - filter map by value. also synonym of filterByValuePredicate |
| Eternal ID of this version: | #1008064/4 |
| Text MD5: | 501aa2922b286d65d80bf8ab14f78606 |
| Transpilation MD5: | 7cc641f107e2d7e2307b895ff986d6b0 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-11-30 13:49:28 |
| Source code size: | 354 bytes / 13 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 770 / 885 |
| Version history: | 3 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1009585 - filterMap - filter map by func(A, B) -> Bool. also synonym of getMultipleKeys |