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

8
LINES

< > BotCompany Repo | #1025151 // objectToMap_nonTransient_singleClass

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

Libraryless. Click here for Pure Java version (2067L/14K).

1  
static <A> Map<S, O> nuLike objectToMap_nonTransient_singleClass(Class<A> c, A o) {
2  
  new TreeMap<S, O> map;
3  
  if (c != null) for (Field f : c.getDeclaredFields())
4  
    if ((f.getModifiers() & (Modifier.STATIC|Modifier.TRANSIENT)) == 0) pcall {
5  
      map.put(f.getName(), f.get(o));
6  
    }
7  
  ret map;
8  
}

Author comment

Began life as a copy of #1024566

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: #1025151
Snippet name: objectToMap_nonTransient_singleClass
Eternal ID of this version: #1025151/7
Text MD5: 02d65266025a0a36282996bffb1c48fb
Transpilation MD5: 686501278a460de69a1ab718bbd5bc36
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-09 22:07:42
Source code size: 307 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 247 / 345
Version history: 6 change(s)
Referenced in: [show references]