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

12
LINES

< > BotCompany Repo | #1002662 // isTrue - synonym of booleanValue

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

Libraryless. Click here for Pure Java version (2698L/16K).

sbool isTrue(O o) {
  if (o instanceof Boolean)
    ret ((Boolean) o).booleanValue();
  if (o == null) ret false;
  if (o instanceof ThreadLocal) // TODO: remove this
    ret isTrue(((ThreadLocal) o).get());
  fail(getClassName(o));
}

sbool isTrue(Bool b) {
  ret b != null && b.booleanValue();
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002662
Snippet name: isTrue - synonym of booleanValue
Eternal ID of this version: #1002662/6
Text MD5: 93c3b79e27c21d516a8977540940a063
Transpilation MD5: e150a3db9ab5b31c232c1418c5ff8838
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-01-02 17:35:19
Source code size: 308 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 974 / 8152
Version history: 5 change(s)
Referenced in: [show references]