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

13
LINES

< > BotCompany Repo | #1032560 // getMultipleKeys_ordered

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

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

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

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

Author comment

Began life as a copy of #1017713

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1032560
Snippet name: getMultipleKeys_ordered
Eternal ID of this version: #1032560/1
Text MD5: 1a6e620019071887e4b66fa7c9b90238
Transpilation MD5: 5527c7e103294d14dd1e63972ce203cb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-22 23:16:44
Source code size: 449 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 154 / 223
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)