Updated DictionaryEntry to override the default Java equals method.

This commit is contained in:
top19 2020-04-29 12:05:43 +01:00
parent ef8ce148ef
commit f88f1ded44

View file

@ -84,7 +84,9 @@ public class DictionaryEntry {
this.practiceWord = practiceWord;
}
public boolean equals(DictionaryEntry entry) {
return entry.getEnglish().equals(this.getEnglish()) && entry.getWelsh().equals(this.getWelsh()) && entry.getWordType().equals(this.getWordType());
@Override
public boolean equals(Object entry) {
DictionaryEntry otherEntry = (DictionaryEntry) entry;
return otherEntry.getEnglish().equals(this.getEnglish()) && otherEntry.getWelsh().equals(this.getWelsh()) && otherEntry.getWordType().equals(this.getWordType());
}
}