Skip to content
Snippets Groups Projects
Commit 34da8d28 authored by jakubs's avatar jakubs
Browse files

SP-295 BIS-190 - add hashcode and equals to objectId classes

SVN: 27485
parent f399ccab
No related branches found
No related tags found
No related merge requests found
...@@ -65,4 +65,39 @@ public abstract class ObjectIdentifierId implements IObjectId ...@@ -65,4 +65,39 @@ public abstract class ObjectIdentifierId implements IObjectId
return getIdentifier(); return getIdentifier();
} }
@Override
public int hashCode()
{
return ((identifier == null) ? 0 : identifier.hashCode());
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
ObjectIdentifierId other = (ObjectIdentifierId) obj;
if (identifier == null)
{
if (other.identifier != null)
{
return false;
}
} else if (!identifier.equals(other.identifier))
{
return false;
}
return true;
}
} }
...@@ -65,4 +65,39 @@ public abstract class ObjectPermIdId implements IObjectId ...@@ -65,4 +65,39 @@ public abstract class ObjectPermIdId implements IObjectId
return getPermId(); return getPermId();
} }
@Override
public int hashCode()
{
return ((permId == null) ? 0 : permId.hashCode());
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
ObjectPermIdId other = (ObjectPermIdId) obj;
if (permId == null)
{
if (other.permId != null)
{
return false;
}
} else if (!permId.equals(other.permId))
{
return false;
}
return true;
}
} }
...@@ -65,4 +65,39 @@ public abstract class ObjectTechIdId implements IObjectId ...@@ -65,4 +65,39 @@ public abstract class ObjectTechIdId implements IObjectId
return getTechId().toString(); return getTechId().toString();
} }
@Override
public int hashCode()
{
return ((techId == null) ? 0 : techId.hashCode());
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
ObjectTechIdId other = (ObjectTechIdId) obj;
if (techId == null)
{
if (other.techId != null)
{
return false;
}
} else if (!techId.equals(other.techId))
{
return false;
}
return true;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment