lombok的canEqual/equals
public boolean equals(Object o)
{
if (o == this)
return true;
if (!(o instanceof PayType))
return false;
PayType other = (PayType)o;
return other.canEqual(this);
}
public boolean canEqual(Object other)
{
return other instanceof PayType;
}
要是一个类没有属性,那么equals方法就悲剧了。
恰巧,我在一个子类总使用了@Data,覆盖了父类的equlas,然后如上说是。结果这个子类的JcomboBox的下拉框怎么拉,都是第一个item!现在才知道问题在equals啊。。。
重来我的博客,算温锅了 :evil: