added category and screenshots to plugin information

This commit is contained in:
Sebastian Sdorra
2011-11-06 14:43:57 +01:00
parent 0df83ac0aa
commit ebc314a189

View File

@@ -40,6 +40,10 @@ import sonia.scm.util.Util;
//~--- JDK imports ------------------------------------------------------------ //~--- JDK imports ------------------------------------------------------------
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
/** /**
@@ -73,8 +77,16 @@ public class PluginInformation implements Validateable
final PluginInformation other = (PluginInformation) obj; final PluginInformation other = (PluginInformation) obj;
if ((this.condition != other.condition) if ((this.screenshots != other.screenshots)
&& ((this.condition == null) ||!this.condition.equals(other.condition))) && ((this.screenshots == null)
||!this.screenshots.equals(other.screenshots)))
{
return false;
}
if ((this.category == null)
? (other.category != null)
: !this.category.equals(other.category))
{ {
return false; return false;
} }
@@ -93,6 +105,12 @@ public class PluginInformation implements Validateable
return false; return false;
} }
if ((this.condition != other.condition)
&& ((this.condition == null) ||!this.condition.equals(other.condition)))
{
return false;
}
if ((this.description == null) if ((this.description == null)
? (other.description != null) ? (other.description != null)
: !this.description.equals(other.description)) : !this.description.equals(other.description))
@@ -145,33 +163,39 @@ public class PluginInformation implements Validateable
@Override @Override
public int hashCode() public int hashCode()
{ {
int hash = 5; int hash = 7;
hash = 83 * hash + ((this.condition != null) hash = 61 * hash + ((this.screenshots != null)
? this.condition.hashCode() ? this.screenshots.hashCode()
: 0); : 0);
hash = 83 * hash + ((this.artifactId != null) hash = 61 * hash + ((this.category != null)
? this.category.hashCode()
: 0);
hash = 61 * hash + ((this.artifactId != null)
? this.artifactId.hashCode() ? this.artifactId.hashCode()
: 0); : 0);
hash = 83 * hash + ((this.author != null) hash = 61 * hash + ((this.author != null)
? this.author.hashCode() ? this.author.hashCode()
: 0); : 0);
hash = 83 * hash + ((this.description != null) hash = 61 * hash + ((this.condition != null)
? this.condition.hashCode()
: 0);
hash = 61 * hash + ((this.description != null)
? this.description.hashCode() ? this.description.hashCode()
: 0); : 0);
hash = 83 * hash + ((this.groupId != null) hash = 61 * hash + ((this.groupId != null)
? this.groupId.hashCode() ? this.groupId.hashCode()
: 0); : 0);
hash = 83 * hash + ((this.name != null) hash = 61 * hash + ((this.name != null)
? this.name.hashCode() ? this.name.hashCode()
: 0); : 0);
hash = 83 * hash + ((this.state != null) hash = 61 * hash + ((this.state != null)
? this.state.hashCode() ? this.state.hashCode()
: 0); : 0);
hash = 83 * hash + ((this.url != null) hash = 61 * hash + ((this.url != null)
? this.url.hashCode() ? this.url.hashCode()
: 0); : 0);
hash = 83 * hash + ((this.version != null) hash = 61 * hash + ((this.version != null)
? this.version.hashCode() ? this.version.hashCode()
: 0); : 0);
@@ -202,6 +226,17 @@ public class PluginInformation implements Validateable
return author; return author;
} }
/**
* Method description
*
*
* @return
*/
public String getCategory()
{
return category;
}
/** /**
* Method description * Method description
* *
@@ -261,6 +296,17 @@ public class PluginInformation implements Validateable
return name; return name;
} }
/**
* Method description
*
*
* @return
*/
public List<String> getScreenshots()
{
return screenshots;
}
/** /**
* Method description * Method description
* *
@@ -331,6 +377,17 @@ public class PluginInformation implements Validateable
this.author = author; this.author = author;
} }
/**
* Method description
*
*
* @param category
*/
public void setCategory(String category)
{
this.category = category;
}
/** /**
* Method description * Method description
* *
@@ -375,6 +432,17 @@ public class PluginInformation implements Validateable
this.name = name; this.name = name;
} }
/**
* Method description
*
*
* @param screenshots
*/
public void setScreenshots(List<String> screenshots)
{
this.screenshots = screenshots;
}
/** /**
* Method description * Method description
* *
@@ -416,6 +484,9 @@ public class PluginInformation implements Validateable
/** Field description */ /** Field description */
private String author; private String author;
/** Field description */
private String category;
/** Field description */ /** Field description */
private PluginCondition condition; private PluginCondition condition;
@@ -428,6 +499,11 @@ public class PluginInformation implements Validateable
/** Field description */ /** Field description */
private String name; private String name;
/** Field description */
@XmlElement(name = "screenshot")
@XmlElementWrapper(name = "screenshots")
private List<String> screenshots;
/** Field description */ /** Field description */
private PluginState state; private PluginState state;