added equals, hashCode and toString methods to Plugin class

This commit is contained in:
Sebastian Sdorra
2013-01-04 21:23:39 +01:00
parent ee23861add
commit 3b7190f675

View File

@@ -33,6 +33,10 @@
package sonia.scm.plugin;
//~--- non-JDK imports --------------------------------------------------------
import com.google.common.base.Objects;
//~--- JDK imports ------------------------------------------------------------
import java.util.Set;
@@ -53,6 +57,71 @@ import javax.xml.bind.annotation.XmlTransient;
public class Plugin
{
/**
* Method description
*
*
* @param obj
*
* @return
*/
@Override
public boolean equals(Object obj)
{
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final Plugin other = (Plugin) obj;
return Objects.equal(condition, other.condition)
&& Objects.equal(information, other.information)
&& Objects.equal(packageSet, other.packageSet)
&& Objects.equal(path, other.path)
&& Objects.equal(resources, other.resources);
}
/**
* Method description
*
*
* @return
*/
@Override
public int hashCode()
{
return Objects.hashCode(condition, information, packageSet, packageSet,
resources);
}
/**
* Method description
*
*
* @return
*/
@Override
public String toString()
{
//J-
return Objects.toStringHelper(this)
.add("condition", condition)
.add("information", information)
.add("packageSet", packageSet)
.add("path", path)
.add("resources", resources)
.toString();
//J+
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*