[ 
https://issues.apache.org/jira/browse/BEANUTILS-524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16986912#comment-16986912
 ] 

Melloware edited comment on BEANUTILS-524 at 12/3/19 1:45 PM:
--------------------------------------------------------------

No what I am thinking is you will need an Interfaces in Commons BeanUtils for 
CopyUtils.  Then in BU the current Copy method will implements a CopyUtilsBean. 
and in BULL you will create one just like above in the BULL code that 
implements the same CopyUtils interface.

Then in the signature of BeanUtilsBean you will pass it a CopyUtils instance 
either the one from BULL or the one from BU (default).  That way you are 
passing in either your custom one or the default current behavior from 
BeanUtils.

However that will mean you will need an optional dependency in your BULL 
library like the following to have the BU interface.
{code:xml}
<dependency>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-beanutils2</artifactId>
  <version>2.0.0</version>
  <optional>true</optional>
</dependency>
{code}


was (Author: melloware):
No what I am thinking is you will need an Interfaces in Commons BeanUtils for 
CopyUtils.  Then in BU the current Copy method will implements a CopyUtilsBean. 
and in BULL you will create one just like above in the BULL code that 
implements the same CopyUtils interface.

Then in the signature of BeanUtilsBean you will pass it a CopyUtils instance 
either the one from BULL or the one from BU (default).  That way you are 
passing in either your custom one or the default current behavior from 
BeanUtils.

However that will mean you will need an optional dependency in your BULL 
library like...
{code:xml}
<dependency>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-beanutils2</artifactId>
  <version>2.0.0</version>
  <optional>true</optional>
</dependency>
{code}

> Make BeanUtils copyProperties able to copy Immutable, Mutable and Mixed Java 
> Bean
> ---------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-524
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-524
>             Project: Commons BeanUtils
>          Issue Type: New Feature
>          Components: Locale BeanUtils / Converters
>            Reporter: Fabio Borriello
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> h4. Overview
> the copyProperties method in the BeanUtils class, is able to copy only public 
> properties or the ones with a public setter method.
> it would be really useful if this functionality can be extended in order to 
> copy any kind of Java Bean: Mutable, Immutable, Mixed.
> h4. Solution 
> Evaluate  the possibility to use, behind the scenes, an open source library 
> that is able to copy Mutable, Immutable and Mixed Java Bean. The library In 
> object is [BULL|https://github.com/HotelsDotCom/bull]. 
> This would also make able to copy nested objects.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to