Java is not as convenient as js to get attribute fields. You have to use reflection
There is no other way to obtain the properties and values of two objects through reflection and then traverse
A convenient way is to convert the object into a map, then traverse the attributes, and finally convert the map back to the object. This process can be done with json-related tools such as gson or fastjson
Java is not as convenient as js to get attribute fields. You have to use reflection
There is no other way to obtain the properties and values of two objects through reflection and then traverse
A convenient way is to convert the object into a map, then traverse the attributes, and finally convert the map back to the object. This process can be done with json-related tools such as gson or fastjson