JAVA:BeanUtil中setProperty与copyProperty有啥区别???

如题。简简单单两句话就能问明白,为啥还得凑到20字。

慕容708150
浏览 641回答 2
2回答

大话西游666

这个简单呢,对属性copy,或者设置值之类的,一般用于vo与model的转换...

当年话下

这两个是完全不同的接口啊,功能不一样的: public static void copyProperties(Object dest, Object orig) throws IllegalAccessException, InvocationTargetException Copy property values from the origin bean to the destination bean for all cases where the property names are the same. public static void setProperty(Object bean, String name, Object value) throws IllegalAccessException, InvocationTargetException Set the specified property value, performing type conversions as required to conform to the type of the destination property.
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java