* Default constructor
*/
public LoginUser () {
- // Default is invisible
- this.userProfileMode = ProfileMode.INVISIBLE;
}
/**
this.userContact = userContact;
}
+ @Override
+ public int compareTo (final User user) {
+ // Checkparameter and return 0 if equal
+ if (null == user) {
+ // Should not happen
+ throw new NullPointerException("user is null"); //NOI18N
+ } else if (Objects.equals(this, user)) {
+ // Same object
+ return 0;
+ }
+
+ // There can only be one user per user name
+ return this.getUserName().compareTo(user.getUserName());
+ }
+
@Override
public boolean equals (final Object object) {
if (null == object) {
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-public interface User extends Serializable {
+public interface User extends Comparable<User>, Serializable {
/**
* Getter for account status