Commits

Sebastian Sdorra committed cb0759f

added equals, hashCode and toString methods to PluginResources class

Comments (0)

Files changed (1)

scm-core/src/main/java/sonia/scm/plugin/PluginResources.java

 
 package sonia.scm.plugin;
 
+//~--- non-JDK imports --------------------------------------------------------
+
+import com.google.common.base.Objects;
+
 //~--- JDK imports ------------------------------------------------------------
 
 import java.util.Set;
    * Method description
    *
    *
+   * @param obj
+   *
+   * @return
+   */
+  @Override
+  public boolean equals(Object obj)
+  {
+    if (obj == null)
+    {
+      return false;
+    }
+
+    if (getClass() != obj.getClass())
+    {
+      return false;
+    }
+
+    final PluginResources other = (PluginResources) obj;
+
+    return Objects.equal(scriptResources, other.scriptResources)
+      && Objects.equal(stylesheetResources, other.stylesheetResources);
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @return
+   */
+  @Override
+  public int hashCode()
+  {
+    return Objects.hashCode(scriptResources, stylesheetResources);
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @return
+   */
+  @Override
+  public String toString()
+  {
+    //J-
+    return Objects.toStringHelper(this)
+                  .add("scriptResources", scriptResources)
+                  .add("stylesheetResources", stylesheetResources)
+                  .toString();
+    //J+
+  }
+
+  //~--- get methods ----------------------------------------------------------
+
+  /**
+   * Method description
+   *
+   *
    * @return
    */
   public Set<String> getScriptResources()