Skip to content

Commit

Permalink
FORGE-2316: Added equals() and hashCode() to StackBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Jan 13, 2016
1 parent 1c64ec3 commit 5d4318c
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,41 @@ public Set<Class<? extends ProjectFacet>> getBundledFacets()
{
return facets;
}

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

0 comments on commit 5d4318c

Please sign in to comment.