Added mediumName to hashCode() and equals()

This commit is contained in:
dankito 2024-10-09 19:08:43 +02:00
parent 05322aface
commit 8dc2174081
3 changed files with 2 additions and 4 deletions

View File

@ -18,7 +18,6 @@ open class MobilePhoneTanMedium(
if (other !is MobilePhoneTanMedium) return false
if (!super.equals(other)) return false
if (mediumName != other.mediumName) return false
if (concealedPhoneNumber != other.concealedPhoneNumber) return false
if (phoneNumber != other.phoneNumber) return false
if (smsDebitAccount != other.smsDebitAccount) return false
@ -28,7 +27,6 @@ open class MobilePhoneTanMedium(
override fun hashCode(): Int {
var result = super.hashCode()
result = 31 * result + (mediumName.hashCode())
result = 31 * result + (concealedPhoneNumber?.hashCode() ?: 0)
result = 31 * result + (phoneNumber?.hashCode() ?: 0)
result = 31 * result + (smsDebitAccount?.hashCode() ?: 0)

View File

@ -27,7 +27,6 @@ open class TanGeneratorTanMedium(
if (cardType != other.cardType) return false
if (validFrom != other.validFrom) return false
if (validTo != other.validTo) return false
if (mediumName != other.mediumName) return false
return true
}
@ -39,7 +38,6 @@ open class TanGeneratorTanMedium(
result = 31 * result + (cardType?.hashCode() ?: 0)
result = 31 * result + (validFrom?.hashCode() ?: 0)
result = 31 * result + (validTo?.hashCode() ?: 0)
result = 31 * result + (mediumName?.hashCode() ?: 0)
return result
}

View File

@ -29,6 +29,7 @@ open class TanMedium(
if (mediumClass != other.mediumClass) return false
if (status != other.status) return false
if (mediumName != other.mediumName) return false
return true
}
@ -36,6 +37,7 @@ open class TanMedium(
override fun hashCode(): Int {
var result = mediumClass.hashCode()
result = 31 * result + status.hashCode()
result = 31 * result + mediumName.hashCode()
return result
}