public int hashCode() { int result = this.name != null ? this.name.hashCode() : 0; result = 31 * result + (this.key != null ? this.key.hashCode() : 0); 。。。每个属性的hashcode return result; }