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

8
LINES

< > BotCompany Repo | #1034293 // tempMapPut - put into map if key & value are not null

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (46L) is out of date.

// assumes map never contains null values
static <A, B> AutoCloseable tempMapPut(Map<A, B> map, A key, B value) {
  if (map != null && key != null && value != null) {
    B old = map.put(key, value);
    ret -> mapPutOrRemove(map, key, old);
  }
  null;
}

Author comment

Began life as a copy of #1007227

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034293
Snippet name: tempMapPut - put into map if key & value are not null
Eternal ID of this version: #1034293/2
Text MD5: 488b50c69a510b6884ed13702300e91d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-01 03:22:05
Source code size: 264 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 126 / 184
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1034294 - tempMapPutAll
#1035147 - tempPut - put into map with undo as AutoCloseable