1 package org.kuali.rice.krms.dto;
2
3 import org.kuali.rice.krms.api.repository.term.TermDefinitionContract;
4 import org.kuali.rice.krms.api.repository.term.TermParameterDefinitionContract;
5 import org.kuali.rice.krms.api.repository.term.TermSpecificationDefinition;
6 import org.kuali.rice.krms.api.repository.term.TermSpecificationDefinitionContract;
7
8 import java.io.Serializable;
9 import java.util.ArrayList;
10 import java.util.List;
11
12
13
14
15
16
17
18
19 public class TermEditor implements TermDefinitionContract, Serializable {
20
21 private String id;
22 private TermSpecificationDefinitionContract specification;
23 private String description;
24 private List<TermParameterEditor> parameters;
25 private Long versionNumber;
26
27 public TermEditor(){
28 super();
29 }
30
31 public TermEditor(TermDefinitionContract contract){
32 this.id = contract.getId();
33
34 this.description = contract.getDescription();
35 if(contract.getParameters() != null){
36 parameters = new ArrayList<TermParameterEditor>();
37 for (TermParameterDefinitionContract parameter : contract.getParameters()){
38 parameters.add(new TermParameterEditor(parameter));
39 }
40 }
41 this.setSpecification(contract.getSpecification());
42 this.versionNumber = contract.getVersionNumber();
43 }
44
45 public void setId(String id) {
46 this.id = id;
47 }
48
49 public void setSpecification(TermSpecificationDefinitionContract specification) {
50 this.specification = specification;
51 }
52
53 public void setDescription(String description) {
54 this.description = description;
55 }
56
57 public void setParameters(List<TermParameterEditor> parameters) {
58 this.parameters = parameters;
59 }
60
61 public void setVersionNumber(Long versionNumber) {
62 this.versionNumber = versionNumber;
63 }
64
65 @Override
66 public TermSpecificationDefinitionContract getSpecification() {
67 return this.specification;
68 }
69
70 @Override
71 public String getDescription() {
72 return this.description;
73 }
74
75 @Override
76 public List<? extends TermParameterDefinitionContract> getParameters() {
77 return this.parameters;
78 }
79
80 public List<TermParameterEditor> getEditorParameters() {
81 return this.parameters;
82 }
83
84 @Override
85 public String getId() {
86 return this.id;
87 }
88
89 @Override
90 public Long getVersionNumber() {
91 return this.versionNumber;
92 }
93 }