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).

static int getIntOpt(L c, int i) {
  ret toIntOpt(get(c, i));
}

static int getIntOpt(Map map, O key) {
  ret toIntOpt(mapGet(map, key));
}

static int getIntOpt(O o, S field, int defaultValue default 0) {
  ret toIntOpt(getOpt(o, field), defaultValue);
}

static int mapMethodLike getIntOpt(S field, O o, int defaultValue default 0) {
  ret getIntOpt(o, field, defaultValue);
}

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: 153 / 220
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1031805 - getLongOpt - very tolerant