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

15
LINES

< > BotCompany Repo | #1031604 // getIntOpt - very tolerant

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

Libraryless. Click here for Pure Java version (2849L/17K).

1  
static int getIntOpt(L c, int i) {
2  
  ret toIntOpt(get(c, i));
3  
}
4  
5  
static int getIntOpt(Map map, O key) {
6  
  ret toIntOpt(mapGet(map, key));
7  
}
8  
9  
static int getIntOpt(O o, S field, int defaultValue default 0) {
10  
  ret toIntOpt(getOpt(o, field), defaultValue);
11  
}
12  
13  
static int mapMethodLike getIntOpt(S field, O o, int defaultValue default 0) {
14  
  ret getIntOpt(o, field, defaultValue);
15  
}

Author comment

Began life as a copy of #1008949

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031604
Snippet name: getIntOpt - very tolerant
Eternal ID of this version: #1031604/3
Text MD5: 8d25b6395b188b4f3c3d981e4e8b4be1
Transpilation MD5: 83ca66ef2c8523332bfde1ce9cfbfea0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-22 09:21:19
Source code size: 392 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 154 / 223
Version history: 2 change(s)
Referenced in: [show references]