tk.hongkailiu.test.app.xml.entity.Company Maven / Gradle / Ivy
The newest version!
package tk.hongkailiu.test.app.xml.entity;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.util.Set;
public class Company {
private Set staffSet;
public Set getStaffSet() {
return staffSet;
}
public void setStaffSet(Set staffSet) {
this.staffSet = staffSet;
}
// @Override
// public int hashCode(){
// return HashCodeBuilder.reflectionHashCode(this);
// }
//
// @Override
// public boolean equals(final Object obj){
// return EqualsBuilder.reflectionEquals(this, obj);
// }
@Override public int hashCode() {
return new HashCodeBuilder().append(staffSet).toHashCode();
}
@Override public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj.getClass() != getClass()) {
return false;
}
Company other = (Company) obj;
return new EqualsBuilder()
//.appendSuper(super.equals(obj))
.append(staffSet, other.staffSet).isEquals();
}
@Override public String toString() {
return ToStringBuilder.reflectionToString(this);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy