Skip to content

Commit

Permalink
Implemented equals() and hashCode() for MavenBuildSystemImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Nov 11, 2014
1 parent dabe6a0 commit e1bc461
Showing 1 changed file with 31 additions and 0 deletions.
Expand Up @@ -27,7 +27,10 @@
import org.jboss.forge.addon.resource.Resource;

/**
* Implementation of the {@link MavenBuildSystem} interface
*
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
* @author <a href="ggastald@redhat.com">George Gastaldi</a>
*/
public class MavenBuildSystemImpl implements MavenBuildSystem
{
Expand Down Expand Up @@ -102,4 +105,32 @@ public int priority()
{
return 0;
}

@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
return result;
}

@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (!(obj instanceof MavenBuildSystemImpl))
return false;
MavenBuildSystemImpl other = (MavenBuildSystemImpl) obj;
if (getType() == null)
{
if (other.getType() != null)
return false;
}
else if (!getType().equals(other.getType()))
return false;
return true;
}

}

0 comments on commit e1bc461

Please sign in to comment.