Updated DictionaryEntry to override the default Java equals method.
This commit is contained in:
parent
ef8ce148ef
commit
f88f1ded44
1 changed files with 4 additions and 2 deletions
|
@ -84,7 +84,9 @@ public class DictionaryEntry {
|
||||||
this.practiceWord = practiceWord;
|
this.practiceWord = practiceWord;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(DictionaryEntry entry) {
|
@Override
|
||||||
return entry.getEnglish().equals(this.getEnglish()) && entry.getWelsh().equals(this.getWelsh()) && entry.getWordType().equals(this.getWordType());
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue