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

5
LINES

< > BotCompany Repo | #1010780 // mapPutIfChange2 - put into map if key & value are not null & there is some change; return previous value if change

JavaX fragment (include)

1  
static <A, B> B mapPutIfChange2(Map<A, B> map, A key, B value) {
2  
  if (map != null && key != null && value != null && neq(map.get(key), value))
3  
    ret map.put(key, value);
4  
  null;
5  
}

Author comment

Began life as a copy of #1008061

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: #1010780
Snippet name: mapPutIfChange2 - put into map if key & value are not null & there is some change; return previous value if change
Eternal ID of this version: #1010780/4
Text MD5: 85ec7593dde6569349cdd4151818f081
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-02 22:47:44
Source code size: 186 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 403 / 432
Version history: 3 change(s)
Referenced in: [show references]