View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krms.dto;
17  
18  import org.kuali.rice.krms.api.repository.proposition.PropositionParameterContract;
19  
20  import java.io.Serializable;
21  import org.kuali.rice.krms.api.repository.term.TermDefinition;
22  
23  /**
24   * @author Kuali Student Team
25   */
26  public class PropositionParameterEditor implements PropositionParameterContract, Serializable {
27  
28      private String id;
29      private String propId;
30      private String value;
31      private TermDefinition termValue;
32      private String parameterType;
33      private Integer sequenceNumber;
34      private Long versionNumber;
35  
36      public PropositionParameterEditor(){
37          super();
38      }
39  
40      public PropositionParameterEditor(String parameterType, Integer sequenceNumber){
41          super();
42          this.setParameterType(parameterType);
43          this.setSequenceNumber(sequenceNumber);
44          this.setVersionNumber(new Long(1));
45          this.setValue(null);
46          this.setTermValue(null);
47      }
48  
49      /**
50       * Converts a immutable object to it's mutable bo counterpart
51       * @param definition immutable object
52       * @return the mutable bo
53       */
54      public PropositionParameterEditor(PropositionParameterContract definition) {
55          this.id = definition.getId();
56          this.propId = definition.getPropId();
57          this.value = definition.getValue();
58          this.termValue = definition.getTermValue();
59          this.parameterType = definition.getParameterType();
60          this.sequenceNumber = definition.getSequenceNumber();
61          this.versionNumber = definition.getVersionNumber();
62      }
63  
64      public void clear() {
65          this.value = null;
66      }
67  
68      public void setId(String id) {
69          this.id = id;
70      }
71  
72      @Override
73      public String getId() {
74          return id;
75      }
76  
77      public void setPropId(String propId) {
78          this.propId = propId;
79      }
80  
81      @Override
82      public String getPropId() {
83          return propId;
84      }
85  
86      public void setValue(String value) {
87          this.value = value;
88      }
89  
90      @Override
91      public String getValue() {
92          return value;
93      }
94  
95      public void setTermValue(TermDefinition termValue) {
96          this.termValue = termValue;
97      }
98  
99      @Override
100     public TermDefinition getTermValue() {
101         return termValue;
102     }
103 
104     
105     
106     public void setParameterType(String parameterType) {
107         this.parameterType = parameterType;
108     }
109 
110     @Override
111     public String getParameterType() {
112         return parameterType;
113     }
114 
115     public void setSequenceNumber(Integer sequenceNumber) {
116         this.sequenceNumber = sequenceNumber;
117     }
118 
119     @Override
120     public Integer getSequenceNumber() {
121         return sequenceNumber;
122     }
123 
124     @Override
125     public Long getVersionNumber() {
126         return versionNumber;
127     }
128 
129     public void setVersionNumber(Long versionNumber) {
130         this.versionNumber = versionNumber;
131     }
132 
133 }