Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
p x
earlywarning
Commits
c0a57e04
Commit
c0a57e04
authored
Oct 28, 2025
by
p x
Browse files
1
parent
f92c773b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/cusc/adas/v2x/utils/Parse.java
View file @
c0a57e04
...
...
@@ -510,22 +510,23 @@ public class Parse {
// public static void convoterBean( Object source , Object target) throws IllegalArgumentException, IllegalAccessException, ClassNotFoundException, InstantiationException, NoSuchFieldException, SecurityException {
public
static
void
convoterBean
(
Object
source
,
Object
target
)
{
Field
[]
fields
=
source
.
getClass
().
getDeclaredFields
();
Field
tField
=
null
;
try
{
Field
[]
fields
=
source
.
getClass
().
getDeclaredFields
();
// List<Field> fList = new ArrayList<>();
List
<
Field
>
fList
=
Arrays
.
asList
(
fields
);
List
<
Field
>
fList
=
Arrays
.
asList
(
fields
);
// for (Field field : fields) {
// if (field.isAnnotationPresent(Order.class)) {
// fList.add(field);
// }
// }
Collections
.
sort
(
fList
,
new
Comparator
<
Field
>()
{
@Override
public
int
compare
(
Field
f1
,
Field
f2
)
{
return
f1
.
getAnnotation
(
Order
.
class
).
value
()
-
f2
.
getAnnotation
(
Order
.
class
).
value
();
}
});
Field
tField
=
null
;
try
{
Collections
.
sort
(
fList
,
new
Comparator
<
Field
>()
{
@Override
public
int
compare
(
Field
f1
,
Field
f2
)
{
return
f1
.
getAnnotation
(
Order
.
class
).
value
()
-
f2
.
getAnnotation
(
Order
.
class
).
value
();
}
});
// Field[] fields = source.getClass().getDeclaredFields();
//获取目标对象指定的属性
//List<Field> fList = new ArrayList<>();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment