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

11
LINES

< > BotCompany Repo | #1005720 // allNonStaticFields - get field names including base classes

JavaX fragment (include)

static Set<S> allNonStaticFields(O o) {
  new TreeSet<S> fields;
  Class _c = _getClass(o);
  do {
    for (Field f : _c.getDeclaredFields())
      if ((f.getModifiers() & Modifier.STATIC) == 0)
        fields.add(f.getName());
    _c = _c.getSuperclass();
  } while (_c != null);
  return fields;
}

Author comment

Began life as a copy of #1005271

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005720
Snippet name: allNonStaticFields - get field names including base classes
Eternal ID of this version: #1005720/1
Text MD5: 068c22ea1aa22aa8c0eee9aa6cb5ab16
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-04 15:56:57
Source code size: 309 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 514 / 611
Referenced in: [show references]