Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1017713 // getMultipleKeys

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (56L/1K).

static <A, B> Map<A, B> getMultipleKeys(Map<A, B> map, A... keys) {
  Map<A, B> map2 = similarEmptyMap(map);
  if (map != null && keys != null) for (A key : keys)
    map2.put(key, map.get(key));
  ret map2;
}

static <A, B> Map<A, B> getMultipleKeys(Map<A, B> map, Iterable<A> keys) {
  Map<A, B> map2 = similarEmptyMap(map);
  if (map != null && keys != null) for (A key : keys)
    map2.put(key, map.get(key));
  ret map2;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1017713
Snippet name: getMultipleKeys
Eternal ID of this version: #1017713/2
Text MD5: 71376698d0bdc09c9b01fce59d9881a1
Transpilation MD5: ec915f5c7deffa0407fe130c56825553
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-10 18:36:27
Source code size: 439 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 285 / 326
Version history: 1 change(s)
Referenced in: [show references]