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

7
LINES

< > BotCompany Repo | #1008061 // mapPutIfChange - put into map if key & value are not null & there is some change

JavaX fragment (include)

static <A, B> bool mapPutIfChange(Map<A, B> map, A key, B value) {
  if (map != null && key != null && value != null && neq(map.get(key), value)) {
    map.put(key, value);
    true;
  }
  false;
}

Author comment

Began life as a copy of #1007227

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: #1008061
Snippet name: mapPutIfChange - put into map if key & value are not null & there is some change
Eternal ID of this version: #1008061/1
Text MD5: 7529725137c3a9f8183c2cdf3c78ab1c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-23 13:13:57
Source code size: 203 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 406 / 434
Referenced in: [show references]