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

7
LINES

< > BotCompany Repo | #1026134 // orderedMapPutOrCreate - make LinkedHashMap if null

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

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

1  
static <A, B> Map<A, B> orderedMapPutOrCreate(Map<A, B> map, A key, B value) {
2  
  if (key != null && value != null) {
3  
    if (map == null) map = new LinkedHashMap;
4  
    map.put(key, value);
5  
  }
6  
  ret map;
7  
}

Author comment

Began life as a copy of #1024478

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: #1026134
Snippet name: orderedMapPutOrCreate - make LinkedHashMap if null
Eternal ID of this version: #1026134/1
Text MD5: f0dcb193004f02739a40e3070a7db08a
Transpilation MD5: 52e21b4da458012a4d0dab436c3f411a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-26 21:33:48
Source code size: 210 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 233 / 343
Referenced in: [show references]