From c37b33a5ac4e1abf6c2bd4206089560a2a4a1733 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Thu, 17 Oct 2024 09:58:58 +0800 Subject: [PATCH] =?UTF-8?q?[6.7.0]=20[fix]=20[=E9=87=8D=E5=86=99equals]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/och/data/bean/BusStationBean.java | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/OCH/common/data/src/main/java/com/mogo/och/data/bean/BusStationBean.java b/OCH/common/data/src/main/java/com/mogo/och/data/bean/BusStationBean.java index 9eb42612bb..9d3d67b970 100644 --- a/OCH/common/data/src/main/java/com/mogo/och/data/bean/BusStationBean.java +++ b/OCH/common/data/src/main/java/com/mogo/och/data/bean/BusStationBean.java @@ -144,24 +144,40 @@ public class BusStationBean { public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; + BusStationBean that = (BusStationBean) o; return siteId == that.siteId && seq == that.seq - && Double.compare(that.gcjLon, gcjLon) == 0 - && Double.compare(that.gcjLat, gcjLat) == 0 - && Double.compare(that.lon, lon) == 0 - && Double.compare(that.lat, lat) == 0 + && Double.compare(gcjLon, that.gcjLon) == 0 + && Double.compare(gcjLat, that.gcjLat) == 0 + && Double.compare(lon, that.lon) == 0 + && Double.compare(lat, that.lat) == 0 && drivingStatus == that.drivingStatus - && leaving == that.leaving + && leaving == that.leaving && isPlayTts == that.isPlayTts && pointType == that.pointType - && name.equals(that.name) - && videoList.equals(that.videoList) - && (nameKr == null || nameKr.equals(that.nameKr)); + && Objects.equals(name, that.name) + && Objects.equals(nameKr, that.nameKr) + && Objects.equals(introduction, that.introduction) + && Objects.equals(videoList, that.videoList); } @Override public int hashCode() { - return Objects.hash(siteId, name, nameKr, seq, gcjLon, gcjLat, lon, lat, drivingStatus, leaving,pointType); + int result = siteId; + result = 31 * result + Objects.hashCode(name); + result = 31 * result + Objects.hashCode(nameKr); + result = 31 * result + seq; + result = 31 * result + Double.hashCode(gcjLon); + result = 31 * result + Double.hashCode(gcjLat); + result = 31 * result + Double.hashCode(lon); + result = 31 * result + Double.hashCode(lat); + result = 31 * result + drivingStatus; + result = 31 * result + Boolean.hashCode(leaving); + result = 31 * result + Objects.hashCode(introduction); + result = 31 * result + Boolean.hashCode(isPlayTts); + result = 31 * result + pointType; + result = 31 * result + Objects.hashCode(videoList); + return result; } @Override @@ -177,9 +193,9 @@ public class BusStationBean { ", lat=" + lat + ", drivingStatus=" + drivingStatus + ", leaving=" + leaving + + ", introduction='" + introduction + '\'' + ", isPlayTts=" + isPlayTts + ", pointType=" + pointType + - ", introduction='" + introduction + '\'' + ", videoList=" + videoList + '}'; }