diff --git a/scm-core/src/main/java/sonia/scm/plugin/PluginRepository.java b/scm-core/src/main/java/sonia/scm/plugin/PluginRepository.java index eba67110c5..c546788d09 100644 --- a/scm-core/src/main/java/sonia/scm/plugin/PluginRepository.java +++ b/scm-core/src/main/java/sonia/scm/plugin/PluginRepository.java @@ -33,6 +33,10 @@ package sonia.scm.plugin; +//~--- non-JDK imports -------------------------------------------------------- + +import com.google.common.base.Objects; + //~--- JDK imports ------------------------------------------------------------ import java.io.Serializable; @@ -53,7 +57,7 @@ public class PluginRepository implements Serializable * Constructs ... * */ - public PluginRepository() {} + PluginRepository() {} /** * Constructs ... @@ -93,21 +97,7 @@ public class PluginRepository implements Serializable final PluginRepository other = (PluginRepository) obj; - if ((this.id == null) - ? (other.id != null) - : !this.id.equals(other.id)) - { - return false; - } - - if ((this.url == null) - ? (other.url != null) - : !this.url.equals(other.url)) - { - return false; - } - - return true; + return Objects.equal(id, other.id) && Objects.equal(url, other.url); } /** @@ -119,16 +109,7 @@ public class PluginRepository implements Serializable @Override public int hashCode() { - int hash = 7; - - hash = 37 * hash + ((this.id != null) - ? this.id.hashCode() - : 0); - hash = 37 * hash + ((this.url != null) - ? this.url.hashCode() - : 0); - - return hash; + return Objects.hashCode(id, url); } /** @@ -140,11 +121,8 @@ public class PluginRepository implements Serializable @Override public String toString() { - StringBuilder out = new StringBuilder("PluginRepository{id="); - - out.append(id).append(", url=").append(url).append(")"); - - return out.toString(); + return Objects.toStringHelper(this).add("id", id).add("url", + url).toString(); } //~--- get methods ---------------------------------------------------------- @@ -171,30 +149,6 @@ public class PluginRepository implements Serializable return url; } - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param id - */ - public void setId(String id) - { - this.id = id; - } - - /** - * Method description - * - * - * @param url - */ - public void setUrl(String url) - { - this.url = url; - } - //~--- fields --------------------------------------------------------------- /** Field description */ diff --git a/scm-core/src/main/java/sonia/scm/plugin/PluginResources.java b/scm-core/src/main/java/sonia/scm/plugin/PluginResources.java index a9b2faa1a1..b039c291f5 100644 --- a/scm-core/src/main/java/sonia/scm/plugin/PluginResources.java +++ b/scm-core/src/main/java/sonia/scm/plugin/PluginResources.java @@ -53,6 +53,28 @@ import javax.xml.bind.annotation.XmlElement; public class PluginResources { + /** + * Constructs ... + * + */ + PluginResources() {} + + /** + * Constructs ... + * + * + * @param scriptResources + * @param stylesheetResources + */ + public PluginResources(Set scriptResources, + Set stylesheetResources) + { + this.scriptResources = scriptResources; + this.stylesheetResources = stylesheetResources; + } + + //~--- methods -------------------------------------------------------------- + /** * Method description * @@ -133,30 +155,6 @@ public class PluginResources return stylesheetResources; } - //~--- set methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param scriptResources - */ - public void setScriptResources(Set scriptResources) - { - this.scriptResources = scriptResources; - } - - /** - * Method description - * - * - * @param stylesheetResources - */ - public void setStylesheetResources(Set stylesheetResources) - { - this.stylesheetResources = stylesheetResources; - } - //~--- fields --------------------------------------------------------------- /** Field description */ diff --git a/scm-core/src/main/java/sonia/scm/plugin/PluginState.java b/scm-core/src/main/java/sonia/scm/plugin/PluginState.java index 635b408b06..39803d3455 100644 --- a/scm-core/src/main/java/sonia/scm/plugin/PluginState.java +++ b/scm-core/src/main/java/sonia/scm/plugin/PluginState.java @@ -70,5 +70,5 @@ public enum PluginState //~--- fields --------------------------------------------------------------- /** Field description */ - int compareValue; + private final int compareValue; }