From 06478bd5483d79ce4e0c3022b1bcf5c340579c46 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Mon, 11 Nov 2024 18:45:56 +0800 Subject: [PATCH] =?UTF-8?q?[6.7.3]=20[fix]=20[line=20=E5=94=AF=E4=B8=80?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=8F=98=E6=9B=B4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/db/bean/LineDataBean.kt | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/repository/db/bean/LineDataBean.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/repository/db/bean/LineDataBean.kt index 301dcfad63..7be426037c 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/repository/db/bean/LineDataBean.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/repository/db/bean/LineDataBean.kt @@ -41,17 +41,7 @@ data class LineDataBean( const val lineDataTable: String = "line_data_table" } - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (javaClass != other?.javaClass) return false - other as LineDataBean - - if (lineId != other.lineId) return false - if (lineName != other.lineName) return false - - return true - } fun getLineIdAndName(function: (lineId:Long,lineName:String) -> Unit) { lineId?.let {id-> @@ -60,4 +50,24 @@ data class LineDataBean( } } } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as LineDataBean + + if (lineId != other.lineId) return false + if (lineName != other.lineName) return false + if (endStationName != other.endStationName) return false + + return true + } + + override fun hashCode(): Int { + var result = lineId?.hashCode() ?: 0 + result = 31 * result + (lineName?.hashCode() ?: 0) + result = 31 * result + (endStationName?.hashCode() ?: 0) + return result + } }