Libraryless. Click here for Pure Java version (3894L/23K).
1 | static Set<Field> fieldObjectsInFieldOrder(Class c, Set<Field> fields) { |
2 | try { |
3 | var byName = mapToKey(f -> f.getName(), fields); |
4 | new LinkedHashSet<Field> out; |
5 | fOr (S name : getFieldOrder(c)) { |
6 | Field f = byName.get(name); |
7 | if (f != null) { |
8 | byName.remove(name); |
9 | out.add(f); |
10 | } |
11 | } |
12 | addAll(out, fields); |
13 | ret out; |
14 | } catch print { |
15 | ret fields; |
16 | } |
17 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033221 |
Snippet name: | fieldObjectsInFieldOrder |
Eternal ID of this version: | #1033221/3 |
Text MD5: | 9e97c7b9ca44e91bc240d45445c9a134 |
Transpilation MD5: | 7c360c0db09bc8335d3a81a441e70fc5 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-16 05:24:25 |
Source code size: | 419 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 242 / 334 |
Version history: | 2 change(s) |
Referenced in: | [show references] |