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

5
LINES

< > BotCompany Repo | #1008151 // mapPut2 - put into map if key & value are not null or delete key if value is null

JavaX fragment (include)

1  
static <A, B> void mapPut2(Map<A, B> map, A key, B value) {
2  
  if (map != null && key != null)
3  
    if (value != null) map.put(key, value);
4  
    else map.remove(key);
5  
}

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: #1008151
Snippet name: mapPut2 - put into map if key & value are not null or delete key if value is null
Eternal ID of this version: #1008151/1
Text MD5: f45118df2cb6cad5a2c0760473304a56
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-28 13:37:02
Source code size: 169 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 473 / 507
Referenced in: [show references]