public boolean equals(Object obj) {
if (this == obj)//参数对象与自己的地址相同,表示为同一个对象
return true;
if (obj == null)//参数对象为一个NULL,不需要比较直接返回false
return false;
if (getClass() != obj.getClass())//参数对象与自己不是同一个类
return false;
IndexTop other = (IndexTop) obj;//将两个对象的属性进行比较判断是否为同一个对象
if (indexTopDetails == null) {
if (other.indexTopDetails != null)
return false;
} else if (!indexTopDetails.equals(other.indexTopDetails))
return false;
if (indexTopH == null) {
if (other.indexTopH != null)
return false;
} else if (!indexTopH.equals(other.indexTopH))
return false;
if (indexTopId == null) {
if (other.indexTopId != null)
return false;
} else if (!indexTopId.equals(other.indexTopId))
return false;
if (indexTopImgAddr == null) {
if (other.indexTopImgAddr != null)
return false;
} else if (!indexTopImgAddr.equals(other.indexTopImgAddr))
return false;
return true;
}
07-24
07-24