[fix]
[重写equals]
This commit is contained in:
yangyakun
2024-10-17 09:58:58 +08:00
parent 8240937497
commit c37b33a5ac

View File

@@ -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 +
'}';
}