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

5
LINES

< > BotCompany Repo | #1024976 // mapPut_noOverwrite - put into map if key & value are not null & key not there

JavaX fragment (include)

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

Author comment

Began life as a copy of #1007227

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: #1024976
Snippet name: mapPut_noOverwrite - put into map if key & value are not null & key not there
Eternal ID of this version: #1024976/1
Text MD5: 00af586fa4a259ce691a5b265906808c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-31 22:17:33
Source code size: 181 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 222 / 267
Referenced in: [show references]