mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-30 19:29:11 +01:00
remove unused setters and use guava style equals, hashCode and toString methods
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -53,6 +53,28 @@ import javax.xml.bind.annotation.XmlElement;
|
||||
public class PluginResources
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
PluginResources() {}
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*
|
||||
* @param scriptResources
|
||||
* @param stylesheetResources
|
||||
*/
|
||||
public PluginResources(Set<String> scriptResources,
|
||||
Set<String> 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<String> scriptResources)
|
||||
{
|
||||
this.scriptResources = scriptResources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param stylesheetResources
|
||||
*/
|
||||
public void setStylesheetResources(Set<String> stylesheetResources)
|
||||
{
|
||||
this.stylesheetResources = stylesheetResources;
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
|
||||
@@ -70,5 +70,5 @@ public enum PluginState
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
int compareValue;
|
||||
private final int compareValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user