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


< > BotCompany Repo | #1018901 - getList - getOpt with cast to List

JavaX fragment (include)

static L getList(Map map, O key) {
  ret map == null ? null : (L) map.get(key);

static L getList(L l, int idx) {
  ret (L) get(l, idx);

static L getList(O o, O key) {
  if (o instanceof Map) ret getList((Map) o, key);
  if (key instanceof S)
    ret (L) getOpt(o, (S) key);
  throw fail("Not a string key: " + getClassName(key));

static L mapMethodLike getList(S name, O o) {
  ret getList(o, name);

Author comment

Began life as a copy of #1001954

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, whxojlpjdney

No comments. add comment

Snippet ID: #1018901
Snippet name: getList - getOpt with cast to List
Eternal ID of this version: #1018901/3
Text MD5: 9db0d291fba89a0407ad50c6dfa7ceac
Author: stefan
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-20 14:19:26
Source code size: 427 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 171 / 202
Version history: 2 change(s)
Referenced in: [show references]

Formerly at &