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

13
LINES

< > BotCompany Repo | #1020913 // indexByFieldCI - returns CI map

JavaX fragment (include)

1  
static <A> Map<S, A> indexByFieldCI(Iterable<A> c, S field) {
2  
  Map<S, A> map = ciMap();
3  
  for (A a : c) {
4  
    S val = getString(a, field);
5  
    if (val != null)
6  
      map.put(val, a);
7  
  }
8  
  ret map;
9  
}
10  
11  
static <A> Map<S, A> mapMethodLike indexByFieldCI(S field, Iterable c) {
12  
  ret indexByFieldCI(c, field);
13  
}

Author comment

Began life as a copy of #1002467

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020913
Snippet name: indexByFieldCI - returns CI map
Eternal ID of this version: #1020913/1
Text MD5: f51ccd56bdb8943f150611468ca5dcd7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-09 21:18:53
Source code size: 320 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 213 / 251
Referenced in: [show references]