There should be multiple existing open source Java libraries to do this
type of thing. Shameless* plug: one such is my own
https://github.com/mbenson/therian .

Agree this is out of scope for [lang] and that [beanutils] would be more
appropriate.

Matt

* Maybe there was a little shame.

On Nov 29, 2016 6:11 PM, "Anthony Bonafide" <anthonymbonaf...@gmail.com>
wrote:

Hello All,

     I was wondering if there is functionality within the commons-lang
library to merge two or more objects together. The desired functionality
would be, given a source and target object copy all the fields from the
source to the target where the destination’s fields are null. This is
similar to the behavior of Object.assign
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/
Reference/Global_Objects/Object/assign>
found
in javascript. I think this is useful when dealing with hierarchies where
 objects inherit defaults from other objects higher in the hierarchy. If
this feature does not exist and you think it is useful, I would like to
submit a pull request. Any thoughts?


Thank you,


Anthony Bonafide

Reply via email to