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

9
LINES

< > BotCompany Repo | #1007227 - mapPut - put into map if key & value are not null

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

Libraryless. Click here for Pure Java version (30L/1K).

static <A, B> void mapPut(Map<A, B> map, A key, B value) {
  if (map != null && key != null && value != null) map.put(key, value);
}

ifclass Pair
static <A, B> void mapPut(Map<A, B> map, Pair<A, B> p) {
  if (map != null && p != null) map.put(p.a, p.b);
}
endif

download  show line numbers  debug dex   

Travelled to 10 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1007227
Snippet name: mapPut - put into map if key & value are not null
Eternal ID of this version: #1007227/3
Text MD5: 5ddcc7447445f226b4eb71e91c850de6
Transpilation MD5: 24234ff0e601e07c85894d240c766e26
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-23 20:05:09
Source code size: 270 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 333 / 338
Version history: 2 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1007227 & http://1007227.tinybrain.de