Better hashCode methods.

This commit is contained in:
akwizgran
2012-12-14 22:11:29 +00:00
parent 47749c3c0d
commit 13df22f69a
5 changed files with 12 additions and 9 deletions

View File

@@ -26,6 +26,11 @@ public class Transport {
return properties;
}
@Override
public int hashCode() {
return id.hashCode() ^ properties.hashCode();
}
@Override
public boolean equals(Object o) {
if(o instanceof Transport) {
@@ -34,9 +39,4 @@ public class Transport {
}
return false;
}
@Override
public int hashCode() {
return id.hashCode();
}
}