import javax.persistence.Transient;
import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontacts.model.contact.UserContact;
+import org.mxchange.jcontacts.model.utils.ContactUtils;
import org.mxchange.jcoreutils.Comparables;
import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
import org.mxchange.jusercore.model.user.status.UserAccountStatus;
// Checkparameter and return 0 if equal
if (null == user) {
// Should not happen
- throw new NullPointerException("user is null"); //NOI18N
- } else if (user.equals(this)) {
+ throw new NullPointerException("Parameter 'user' is null"); //NOI18N
+ } else if (Objects.equals(this, user)) {
// Same object
return 0;
}
// Init comparitors
final int comparitors[] = {
// First contact
- this.getUserContact().compareTo(user.getUserContact()),
+ ContactUtils.compare(this.getUserContact(), user.getUserContact()),
// ... then user name
this.getUserName().compareTo(user.getUserName())
};
if (!Objects.equals(this.getUserName(), user.getUserName())) {
return false;
+ } else if (!Objects.equals(this.getUserAccountStatus(), user.getUserAccountStatus())) {
+ return false;
} else if (!Objects.equals(this.getUserConfirmKey(), user.getUserConfirmKey())) {
return false;
- } else if (!Objects.equals(this.getUserAccountStatus(), user.getUserAccountStatus())) {
+ } else if (!Objects.equals(this.getUserId(), user.getUserId())) {
return false;
- } else if (!Objects.equals(this.getUserContact(), user.getUserContact())) {
+ } else if (!Objects.equals(this.getUserMustChangePassword(), user.getUserMustChangePassword())) {
+ return false;
+ } else if (!Objects.equals(this.getUserName(), user.getUserName())) {
return false;
} else if (!Objects.equals(this.getUserProfileMode(), user.getUserProfileMode())) {
return false;
+ } else if (!Objects.equals(this.getUserContact(), user.getUserContact())) {
+ return false;
}
return true;
int hash = 5;
hash = 83 * hash + Objects.hashCode(this.getUserName());
- hash = 83 * hash + Objects.hashCode(this.getUserConfirmKey());
hash = 83 * hash + Objects.hashCode(this.getUserAccountStatus());
- hash = 83 * hash + Objects.hashCode(this.getUserContact());
+ hash = 83 * hash + Objects.hashCode(this.getUserConfirmKey());
+ hash = 83 * hash + Objects.hashCode(this.getUserId());
+ hash = 83 * hash + Objects.hashCode(this.getUserMustChangePassword());
hash = 83 * hash + Objects.hashCode(this.getUserProfileMode());
+ hash = 83 * hash + Objects.hashCode(this.getUserContact());
return hash;
}