Skip to content

Commit

Permalink
Implemented equals() and hashCode() for SimpleSingletonExportedInstan…
Browse files Browse the repository at this point in the history
…ceImpl
  • Loading branch information
gastaldi committed Aug 11, 2015
1 parent f7539bc commit 5289dae
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,41 @@ public Addon getSourceAddon()
{
return addon;
}

@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((addon == null) ? 0 : addon.hashCode());
result = prime * result + ((type == null) ? 0 : type.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;
SimpleSingletonExportedInstanceImpl other = (SimpleSingletonExportedInstanceImpl) obj;
if (addon == null)
{
if (other.addon != null)
return false;
}
else if (!addon.equals(other.addon))
return false;
if (type == null)
{
if (other.type != null)
return false;
}
else if (!type.equals(other.type))
return false;
return true;
}
}

0 comments on commit 5289dae

Please sign in to comment.