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 + } }