Re: [appfuse-user] add user with the same username to Set

2009-03-09 Thread Matt Raible
We use equals() to determine equality. http://static.appfuse.org/appfuse-data/appfuse-data-common/xref/org/appfuse/model/User.html Matt On Mon, Mar 9, 2009 at 6:07 AM, JC Fabian wrote: > take a look at how the User class implements the compareTo method(I believe > it implements the Comparable i

Re: [appfuse-user] add user with the same username to Set

2009-03-09 Thread JC Fabian
take a look at how the User class implements the compareTo method(I believe it implements the Comparable interface). That is how Sets determine whether an object added to it is "meaningfully equivalent" to another object in the set or not. Try reading about the Comparable interface to get a more so

[appfuse-user] add user with the same username to Set

2009-03-09 Thread maker su
Hi there, I create a action with a field : private Set users = new HashSet(); I add 2 users with differenet email to the Set: user = new User(); user.setUsername("Unknown"); user.setEmail("a...@gmail.com"); getUsers().add(user); user = new User(); user.setUsername("Unknown"); user.