Implemented case insensitive search display of remittee name (so that e.g. for 'John Doe' and 'JOHN DOE' not two different entries are displayed)

This commit is contained in:
dankito 2020-05-23 16:36:19 +02:00
parent 3e2b4757df
commit 17b3066044
1 changed files with 19 additions and 0 deletions

View File

@ -11,6 +11,25 @@ data class Remittee(
internal constructor() : this("", "", "") // for object deserializers
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is Remittee) return false
if (name.equals(other.name, true)) return false
if (iban != other.iban) return false
if (bic != other.bic) return false
return true
}
override fun hashCode(): Int {
var result = name.toLowerCase().hashCode()
result = 31 * result + (iban?.hashCode() ?: 0)
result = 31 * result + (bic?.hashCode() ?: 0)
return result
}
override fun toString(): String {
return name
}