[jira] [Commented] (BEANUTILS-524) Make BeanUtils copyProperties able to copy Immutable, Mutable and Mixed Java Bean

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (BEANUTILS-524) Make BeanUtils copyProperties able to copy Immutable, Mutable and Mixed Java Bean

ASF GitHub Bot (Jira)

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

Gary D. Gregory commented on BEANUTILS-524:
-------------------------------------------

Darn, I had typed in a long reply and lost it, so I'll cut to the chase.

I propose:
 - No dependency on BULL
 - Add a CopyUtilsBean class that implements a new interface called TBDCopyUtilsBean (IOW the name is To Be Determined.)
 - Define interfaces for ConvertUtilsBean and PropertyUtilsBean called TBDConvertUtilsBean, TBDPropertyUtlisBean
 Ideally:
 - Add a ctor BeanUtilsBean(ConvertUtilsBean, PropertyUtilsBean, CopyUtilsBean)
 - Add a ctor BeanUtilsBean(TBDConvertUtilsBean, TBDPropertyUtilsBean, TBDCopyUtilsBean)
 - Retype guts of BeanUtilsBean to the interfaces

We might not even need the class-based ctor since this is 2.0 and we need not keep binary compatibility.

This means that CopyUtilsBean needs a default implementation, whatever that is, simple as it may be.

Then we can also consider porting the functionality from BULL or not.

 

> 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)