1 | static <A, B> B randomValue(Map<A, B> map) {
|
2 | if (map == null) null; |
3 | A key = random(keys(map)); |
4 | ret key == null ? null : map.get(key); |
5 | } |
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: | #1014175 |
| Snippet name: | randomValue - random value from a map |
| Eternal ID of this version: | #1014175/2 |
| Text MD5: | 8cb90bc79a8a140ad076471226f61b4c |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-04-15 14:49:14 |
| Source code size: | 145 bytes / 5 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 693 / 703 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |