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

12
LINES

< > BotCompany Repo | #1016837 // staticFinalIntFields - get field names & values including base classes

JavaX fragment (include)

// o can also be a class
static Map<S, Int> staticFinalIntFields(O o) ctex {
  new TreeMap<S, Int> map;
  
  for (Field f : staticFields(o))
    if ((f.getModifiers() & Modifier.FINAL) != 0
      && f.getType() == primitiveIntType()) {
        f.setAccessible(true);
        map.put(f.getName(), (Int) f.get(null));
      }
  ret map;
}

Author comment

Began life as a copy of #1010691

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016837
Snippet name: staticFinalIntFields - get field names & values including base classes
Eternal ID of this version: #1016837/4
Text MD5: beca3972e8a1fc77361b0272f5606d20
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-04 13:37:07
Source code size: 347 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 274 / 308
Version history: 3 change(s)
Referenced in: [show references]