[bramble] Implement equals() and hashCode() for AuthorView

This commit is contained in:
Torsten Grote
2018-10-30 15:02:15 -03:00
parent 6c5e8ce4cf
commit 7c202189a2
2 changed files with 56 additions and 0 deletions

View File

@@ -35,4 +35,18 @@ public class AuthorInfo {
return alias;
}
@Override
public int hashCode() {
int hashCode = status.ordinal();
if (alias != null) hashCode += alias.hashCode();
return hashCode;
}
@Override
public boolean equals(Object o) {
if (!(o instanceof AuthorInfo)) return false;
AuthorInfo info = (AuthorInfo) o;
return status == info.status &&
(alias == null ? info.alias == null : alias.equals(info.alias));
}
}