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)

static <A, B> B mapGetOrCreate(Map<A, B> map, A key, Class<? extends B> c) {
  ret getOrCreate(map, key, c);
}



// f : func -> B
static <A, B> B mapGetOrCreate(Map<A, B> map, A key, O f) {
  ret getOrCreate(map, key, f);
}

static <A, B> B mapGetOrCreate(Map<A, B> map, A key, IF0<B> f) {
  ret getOrCreate(map, key, (O) f);
}

static <A, B> B nuLike mapGetOrCreate(Class<? extends B> c, Map<A, B> map, A key) {
  ret getOrCreate(c, map, key);
}

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: 228 / 271
Version history: 1 change(s)
Referenced in: [show references]