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

18
LINES

< > BotCompany Repo | #1024987 // mapGetOrCreate - synonym of getOrCreate

JavaX fragment (include)

1  
static <A, B> B mapGetOrCreate(Map<A, B> map, A key, Class<? extends B> c) {
2  
  ret getOrCreate(map, key, c);
3  
}
4  
5  
6  
7  
// f : func -> B
8  
static <A, B> B mapGetOrCreate(Map<A, B> map, A key, O f) {
9  
  ret getOrCreate(map, key, f);
10  
}
11  
12  
static <A, B> B mapGetOrCreate(Map<A, B> map, A key, IF0<B> f) {
13  
  ret getOrCreate(map, key, (O) f);
14  
}
15  
16  
static <A, B> B nuLike mapGetOrCreate(Class<? extends B> c, Map<A, B> map, A key) {
17  
  ret getOrCreate(c, map, key);
18  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1024987
Snippet name: mapGetOrCreate - synonym of getOrCreate
Eternal ID of this version: #1024987/2
Text MD5: 3fe1da4edbf3bfeff233ba0b12fc79f4
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-27 19:04:00
Source code size: 464 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 315 / 349
Version history: 1 change(s)
Referenced in: [show references]