Copy specific fields by using BeanUtils.copyProperties?

前端 未结 5 1799
执笔经年
执笔经年 2020-12-12 14:13

springframework.beans.BeanUtils is very useful to copy objects, and I use the \"ignoreProperties\" option frequently. However, sometimes I want to copy only spe

5条回答
  •  时光说笑
    2020-12-12 14:46

    You may use org.springframework.beans.BeanUtils.copyProperties(Object source, Object target, Class editable) throws BeansException

    Ensure the target implements the interface editable which defines the properties which would be copied.

提交回复
热议问题