PageModel add id

This commit is contained in:
hmm 2014-08-21 13:20:21 +08:00
parent 87a16b3ee5
commit 41f7dd7b42
2 changed files with 26 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "page")
public class PageModel {
private String id;
private List<BatchModel> batches;
@XmlElementWrapper(name = "batches")
@ -20,8 +21,20 @@ public class PageModel {
public void setBatches(List<BatchModel> batches) {
this.batches = batches;
}
@XmlElement
public String getId() {
return id;
}
public PageModel() {
public void setId(String id) {
this.id = id;
}
public PageModel(){
this.setBatches(new ArrayList<BatchModel>());
}
public PageModel(String id) {
this.id = id;
this.setBatches(new ArrayList<BatchModel>());
}
}

View File

@ -56,20 +56,29 @@ public class UsePluginModel {
public UsePluginModel() {
}
public static UsePluginModel createUsePlugin(String id, String name,
public static UsePluginModel createUsePlugin(String id, String name,String nickName,
List<ParameterModel> initParameters) {
UsePluginModel result = new UsePluginModel();
result.setId(id);
result.setName(name);
result.setNickName(id);
result.setNickName(nickName);
result.setParameters(initParameters);
return result;
}
public UsePluginModel(String id, String name,
List<ParameterModel> parameters) {
this.setId(id);
this.setName(name);
this.setNickName(name+"_"+id);
if (parameters == null) {
parameters = new LinkedList<ParameterModel>();
}
this.setParameters(parameters);
}
public UsePluginModel(String id, String name,String nickName,
List<ParameterModel> parameters) {
this.setId(id);
this.setName(name);
this.setNickName(id);
if (parameters == null) {
parameters = new LinkedList<ParameterModel>();