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

12
LINES

< > BotCompany Repo | #1025410 // nonStaticNonPrimitiveNonTransientFieldObjects

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

Libraryless. Click here for Pure Java version (2132L/13K).

1  
static L<Field> nonStaticNonPrimitiveNonTransientFieldObjects(O o) {
2  
  if (o == null) null;
3  
  new L<Field> fields;
4  
  Class _c = _getClass(o);
5  
  do {
6  
    for (Field f : _c.getDeclaredFields())
7  
      if ((f.getModifiers() & (Modifier.STATIC | Modifier.TRANSIENT)) == 0 && !isPrimitiveType(f.getType()))
8  
        fields.add(makeAccessible(f));
9  
    _c = _c.getSuperclass();
10  
  } while (_c != null);
11  
  return fields;
12  
}

Author comment

Began life as a copy of #1018910

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025410
Snippet name: nonStaticNonPrimitiveNonTransientFieldObjects
Eternal ID of this version: #1025410/3
Text MD5: 3a38ba059e8aa779ed6f5130becd7510
Transpilation MD5: 761eda01e4771ef42450e573628eb257
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-28 18:21:40
Source code size: 422 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 241 / 339
Version history: 2 change(s)
Referenced in: [show references]