Issue #1177 implement hashCode and equals for cross section
Former-commit-id:77965aaee6
[formerly77965aaee6
[formerly cc91594ca8f82f322e36ab6feebe7f2ddeef60d1]] Former-commit-id:25a935f2e0
Former-commit-id:692c46fcce
This commit is contained in:
parent
219c939169
commit
2d9aef2805
1 changed files with 32 additions and 0 deletions
|
@ -282,4 +282,36 @@ public class CrossSectionResourceData extends AbstractRequestableResourceData {
|
|||
blackListedTimes.add(cloned);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result
|
||||
+ ((parameter == null) ? 0 : parameter.hashCode());
|
||||
result = prime * result + ((source == null) ? 0 : source.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (!super.equals(obj))
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
CrossSectionResourceData other = (CrossSectionResourceData) obj;
|
||||
if (parameter == null) {
|
||||
if (other.parameter != null)
|
||||
return false;
|
||||
} else if (!parameter.equals(other.parameter))
|
||||
return false;
|
||||
if (source == null) {
|
||||
if (other.source != null)
|
||||
return false;
|
||||
} else if (!source.equals(other.source))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue