TSK-411: fixed hashCode and equals for Workbasket.

This commit is contained in:
Holger Hagen 2018-04-18 16:08:54 +02:00 committed by Martin Rojas Miguel Angel
parent be5b4179b3
commit 7dc1cd0456
1 changed files with 101 additions and 1 deletions

View File

@ -218,10 +218,23 @@ public class WorkbasketImpl implements Workbasket {
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((created == null) ? 0 : created.hashCode());
result = prime * result + ((custom1 == null) ? 0 : custom1.hashCode());
result = prime * result + ((custom2 == null) ? 0 : custom2.hashCode());
result = prime * result + ((custom3 == null) ? 0 : custom3.hashCode());
result = prime * result + ((custom4 == null) ? 0 : custom4.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((domain == null) ? 0 : domain.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((key == null) ? 0 : key.hashCode());
result = prime * result + ((modified == null) ? 0 : modified.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((orgLevel1 == null) ? 0 : orgLevel1.hashCode());
result = prime * result + ((orgLevel2 == null) ? 0 : orgLevel2.hashCode());
result = prime * result + ((orgLevel3 == null) ? 0 : orgLevel3.hashCode());
result = prime * result + ((orgLevel4 == null) ? 0 : orgLevel4.hashCode());
result = prime * result + ((owner == null) ? 0 : owner.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
}
@ -233,10 +246,52 @@ public class WorkbasketImpl implements Workbasket {
if (obj == null) {
return false;
}
if (!(obj instanceof WorkbasketImpl)) {
if (getClass() != obj.getClass()) {
return false;
}
WorkbasketImpl other = (WorkbasketImpl) obj;
if (created == null) {
if (other.created != null) {
return false;
}
} else if (!created.equals(other.created)) {
return false;
}
if (custom1 == null) {
if (other.custom1 != null) {
return false;
}
} else if (!custom1.equals(other.custom1)) {
return false;
}
if (custom2 == null) {
if (other.custom2 != null) {
return false;
}
} else if (!custom2.equals(other.custom2)) {
return false;
}
if (custom3 == null) {
if (other.custom3 != null) {
return false;
}
} else if (!custom3.equals(other.custom3)) {
return false;
}
if (custom4 == null) {
if (other.custom4 != null) {
return false;
}
} else if (!custom4.equals(other.custom4)) {
return false;
}
if (description == null) {
if (other.description != null) {
return false;
}
} else if (!description.equals(other.description)) {
return false;
}
if (domain == null) {
if (other.domain != null) {
return false;
@ -258,6 +313,13 @@ public class WorkbasketImpl implements Workbasket {
} else if (!key.equals(other.key)) {
return false;
}
if (modified == null) {
if (other.modified != null) {
return false;
}
} else if (!modified.equals(other.modified)) {
return false;
}
if (name == null) {
if (other.name != null) {
return false;
@ -265,6 +327,44 @@ public class WorkbasketImpl implements Workbasket {
} else if (!name.equals(other.name)) {
return false;
}
if (orgLevel1 == null) {
if (other.orgLevel1 != null) {
return false;
}
} else if (!orgLevel1.equals(other.orgLevel1)) {
return false;
}
if (orgLevel2 == null) {
if (other.orgLevel2 != null) {
return false;
}
} else if (!orgLevel2.equals(other.orgLevel2)) {
return false;
}
if (orgLevel3 == null) {
if (other.orgLevel3 != null) {
return false;
}
} else if (!orgLevel3.equals(other.orgLevel3)) {
return false;
}
if (orgLevel4 == null) {
if (other.orgLevel4 != null) {
return false;
}
} else if (!orgLevel4.equals(other.orgLevel4)) {
return false;
}
if (owner == null) {
if (other.owner != null) {
return false;
}
} else if (!owner.equals(other.owner)) {
return false;
}
if (type != other.type) {
return false;
}
return true;
}