对象比较复杂,对象拥有其他对象,最好的实现方式是什么
黄舟2017-04-18 10:55:06
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