java-web - JAVA语言如何实现ES6 Object.assign,两个属性相同的对象增量更新字段信息,最好最快的实现方式?
PHP中文网
PHP中文网 2017-04-18 10:53:06
0
1
989

对象比较复杂,对象拥有其他对象,最好的实现方式是什么

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
黄舟

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template