On Thu, 6 Mar 2003 [EMAIL PROTECTED] wrote:

> Date: Thu, 6 Mar 2003 13:50:58 -0500
> From: [EMAIL PROTECTED]
> Reply-To: Jakarta Commons Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: BeanUtils
>
> I'm using the BeanUtils class to compare different properties from 2
> objects.  Let's assume I have the following setup:
>
> Class1{
>       private Name name = null;
>       // list contains Strings
>       private List list = null;
>       private String description = null;
>
>       // corresponding setter and getter methods....
>
> }
>
> If I have 2 instance of Class1 and I want to compare them to see if they
> are equal, does the BeanUtils class provide a way to look into the "Name"
> and "List" object to see if they contain the same values?  I know it works
> well with String objects, but I don't see any way that it can work with
> other objects.
>

BeanUtils doesn't have any specific code for this use case, although a
"compare all the properties that two beans have in common" method would be
nice.

If the instances are of the same class, though, why don't you just
override the equals() method and do the appropriate comparisons there?

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to