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