diff --git a/scm-core/src/main/java/sonia/scm/repository/BrowserResult.java b/scm-core/src/main/java/sonia/scm/repository/BrowserResult.java index f2c49bbe53..7230b2ab48 100644 --- a/scm-core/src/main/java/sonia/scm/repository/BrowserResult.java +++ b/scm-core/src/main/java/sonia/scm/repository/BrowserResult.java @@ -33,6 +33,10 @@ package sonia.scm.repository; +//~--- non-JDK imports -------------------------------------------------------- + +import com.google.common.base.Objects; + //~--- JDK imports ------------------------------------------------------------ import java.util.Iterator; @@ -80,6 +84,47 @@ public class BrowserResult implements Iterable //~--- methods -------------------------------------------------------------- + /** + * {@inheritDoc} + * + * + * @param obj + * + * @return + */ + @Override + public boolean equals(Object obj) + { + if (obj == null) + { + return false; + } + + if (getClass() != obj.getClass()) + { + return false; + } + + final BrowserResult other = (BrowserResult) obj; + + return Objects.equal(revision, other.revision) + && Objects.equal(tag, other.tag) + && Objects.equal(branch, other.branch) + && Objects.equal(files, other.files); + } + + /** + * {@inheritDoc} + * + * + * @return + */ + @Override + public int hashCode() + { + return Objects.hashCode(revision, tag, branch, files); + } + /** * Method description * @@ -99,6 +144,25 @@ public class BrowserResult implements Iterable return it; } + /** + * {@inheritDoc} + * + * + * @return + */ + @Override + public String toString() + { + //J- + return Objects.toStringHelper(this) + .add("revision", revision) + .add("tag", tag) + .add("branch", branch) + .add("files", files) + .toString(); + //J+ + } + //~--- get methods ---------------------------------------------------------- /**