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

5
LINES

< > BotCompany Repo | #1026195 // replaceKey

JavaX fragment (include)

1  
static <A, B> void replaceKey(Map<A, B> map, A oldKey, A newKey) {
2  
  if (map == null || !map.containsKey(oldKey)) ret;
3  
  map.put(newKey, map.get(oldKey));
4  
  map.remove(oldKey);
5  
}

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: #1026195
Snippet name: replaceKey
Eternal ID of this version: #1026195/2
Text MD5: eb93b6f4ceb5a0180c3d2f3223611e9e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-29 01:11:34
Source code size: 182 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 171 / 212
Version history: 1 change(s)
Referenced in: [show references]