commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julien Aymé <julien.a...@gmail.com>
Subject Re: Bean merge
Date Wed, 15 Dec 2010 09:30:49 GMT
Hi,
you could see the issue BEANUTILS-304 :
https://issues.apache.org/jira/browse/BEANUTILS-304

Or you could enhance BeanUtils class  by duplicating copyProperties
method into a new copyNonNullProperties method
(which would copy all non-null properties from src into dest).

Then the merge algorithm would be something like this:
Bean mergeInto = new Bean();
BeanUtils.copyProperties(defaultValuesBean, mergeInto);
BeanUtils.copyNonNullProperties(srcBean, mergeInto);

This way, the new mergeInto bean will have all the non null properties
of the src bean and the other properties of the defaultValuesBean.

HTH,
Regards,

Julien

2010/12/14 Mateus Brum <mateushenriquebrum@gmail.com>:
> Is there some implementation of bean merge in BeanUtils?
> If not how do I propose such implementation?
> Thanks.
>
> --
> *Mateus Henrique Brum*
> *Desenvolvedor de Softwares Corporativos*
> *NOVO CELULAR : (12) 8200-0919*
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message