commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@gmail.com>
Subject Re: [LANG] Object Merge Functionality
Date Wed, 30 Nov 2016 14:17:02 GMT
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" <anthonymbonafide@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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message