TSK-664: added hash and equals methods to KeyDomain.
This commit is contained in:
parent
c750e00b32
commit
afdf6cbaff
|
@ -53,23 +53,30 @@ public class KeyDomain {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj)
|
if (this == obj) {
|
||||||
return true;
|
return true;
|
||||||
if (obj == null)
|
}
|
||||||
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
if (getClass() != obj.getClass())
|
}
|
||||||
|
if (getClass() != obj.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
KeyDomain other = (KeyDomain) obj;
|
KeyDomain other = (KeyDomain) obj;
|
||||||
if (domain == null) {
|
if (domain == null) {
|
||||||
if (other.domain != null)
|
if (other.domain != null) {
|
||||||
return false;
|
return false;
|
||||||
} else if (!domain.equals(other.domain))
|
}
|
||||||
|
} else if (!domain.equals(other.domain)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
if (other.key != null)
|
if (other.key != null) {
|
||||||
return false;
|
return false;
|
||||||
} else if (!key.equals(other.key))
|
}
|
||||||
|
} else if (!key.equals(other.key)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue