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

5
LINES

< > BotCompany Repo | #1019488 // applyFunctionToMapValue - transform value of one map key, modifies & returns original map

JavaX fragment (include)

1  
static <A, B> Map<A, B> applyFunctionToMapValue(A key, O f, Map<A, B> map) {
2  
  if (map.containsKey(key))
3  
    map.put(key, (B) callF(f, map.get(key)));
4  
  ret map;
5  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1019488
Snippet name: applyFunctionToMapValue - transform value of one map key, modifies & returns original map
Eternal ID of this version: #1019488/2
Text MD5: 2b067228d7b13c205018fb29b53bc83f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-10 15:10:57
Source code size: 167 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 298 / 330
Version history: 1 change(s)
Referenced in: [show references]