implement equals, hashCode and toString

This commit is contained in:
Sebastian Sdorra
2012-03-04 19:50:39 +01:00
parent 410ce2fb4d
commit e67776b53b

View File

@@ -31,6 +31,10 @@
package sonia.scm;
//~--- non-JDK imports --------------------------------------------------------
import com.google.common.base.Objects;
//~--- JDK imports ------------------------------------------------------------
import javax.xml.bind.annotation.XmlAccessType;
@@ -44,6 +48,63 @@ import javax.xml.bind.annotation.XmlAccessorType;
public class ClassOverride implements Validateable
{
/**
* Method description
*
*
* @param obj
*
* @return
*/
@Override
public boolean equals(Object obj)
{
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final ClassOverride other = (ClassOverride) obj;
return Objects.equal(bind, other.bind) && Objects.equal(to, other.to);
}
/**
* Method description
*
*
* @return
*/
@Override
public int hashCode()
{
return Objects.hashCode(bind, to);
}
/**
* Method description
*
*
* @return
*/
@Override
public String toString()
{
//J-
return Objects.toStringHelper(this)
.add("bind", bind)
.add("to", to)
.toString();
//J+
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*