mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-02-07 07:09:15 +01:00
make plugin information and plugin condition cloneable
This commit is contained in:
@@ -42,6 +42,7 @@ import sonia.scm.util.Util;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
@@ -56,7 +57,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
*/
|
||||
@XmlRootElement(name = "conditions")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class PluginCondition
|
||||
public class PluginCondition implements Cloneable
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -80,6 +81,28 @@ public class PluginCondition
|
||||
this.arch = arch;
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @since 1.11
|
||||
*/
|
||||
@Override
|
||||
public PluginCondition clone()
|
||||
{
|
||||
PluginCondition clone = new PluginCondition(minVersion, null, arch);
|
||||
|
||||
if (Util.isNotEmpty(os))
|
||||
{
|
||||
clone.setOs(new ArrayList<String>(os));
|
||||
}
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,6 +40,7 @@ import sonia.scm.util.Util;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
@@ -54,9 +55,46 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlRootElement(name = "plugin-information")
|
||||
public class PluginInformation implements Validateable
|
||||
public class PluginInformation implements Validateable, Cloneable
|
||||
{
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
@Override
|
||||
public PluginInformation clone()
|
||||
{
|
||||
PluginInformation clone = new PluginInformation();
|
||||
|
||||
clone.setArtifactId(artifactId);
|
||||
clone.setAuthor(author);
|
||||
clone.setCategory(category);
|
||||
|
||||
if (condition != null)
|
||||
{
|
||||
clone.setCondition(condition.clone());
|
||||
}
|
||||
|
||||
clone.setDescription(description);
|
||||
|
||||
if (Util.isNotEmpty(screenshots))
|
||||
{
|
||||
clone.setScreenshots(new ArrayList<String>(screenshots));
|
||||
}
|
||||
|
||||
clone.setState(state);
|
||||
clone.setUrl(url);
|
||||
clone.setVersion(version);
|
||||
clone.setWiki(wiki);
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user