commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinicius Carvalho <>
Subject existis question
Date Wed, 27 Oct 2004 22:55:17 GMT
Hi there! I'd like to search a collection for a given dto.

I have a collection of DTOs userDTO for eg. This collection is filled 
like this:

userDTO = delegate.findUser(id);


ok, this is filled as users puts ids in a text-field and submits it. 
Now, if the user put an id that's already been sent I'd like to not put 
more elements in my collection
so I did this:

userDTO = delegate.findUser(id);
boolean exists = CollectionUtils.exists(users, 

problem is, it always return false. I know different objects have 
different hashcodes, but I was wondering if the exists would handle this 
for me. Any ideas for this problem?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message