equals hascode

git-svn-id: svn://svn.dsv.su.se/scipro/scipro/trunk@518 73ecded7-942e-4092-bab0-0e58ef0ee984
This commit is contained in:
joha-asc 2011-03-29 09:30:29 +00:00
parent 0b28a07a3c
commit 6c13a37e3d

@ -41,6 +41,31 @@ public class Tag extends DomainObject {
public void setTag(String tag) {
this.tag = tag;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Tag other = (Tag) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}