View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.core.enumerationmanagement.dto;
17  
18  import java.io.Serializable;
19  import java.util.ArrayList;
20  import java.util.Date;
21  import java.util.List;
22  
23  import javax.xml.bind.annotation.XmlAccessType;
24  import javax.xml.bind.annotation.XmlAccessorType;
25  import javax.xml.bind.annotation.XmlAttribute;
26  import javax.xml.bind.annotation.XmlElement;
27  
28  /**
29   *Value associated with a particular enumeration.
30   */ 
31  @XmlAccessorType(XmlAccessType.FIELD)
32  public class EnumeratedValueInfo implements Serializable {
33  
34      private static final long serialVersionUID = 1L;
35  
36      @XmlElement
37      private String code;
38  
39      @XmlElement
40      private String abbrevValue;
41  
42      @XmlElement
43      private String value;
44  
45      @XmlElement
46      private Date effectiveDate;
47  
48      @XmlElement
49      private Date expirationDate;
50  
51      @XmlElement
52      private String sortKey;
53  
54      @XmlElement
55      private List<EnumContextValueInfo> contexts;
56  
57      @XmlAttribute
58      private String enumerationKey;    
59      
60      /**
61       * Typically coincides with a code representation. Likely the key if this is a reference to another object.
62       */
63      public String getCode() {
64          return code;
65      }
66  
67      public void setCode(String code) {
68          this.code = code;
69      }
70  
71      /**
72       * Typically coincides with a shortened name. May be equal to the code or value fields.
73       */
74      public String getAbbrevValue() {
75          return abbrevValue;
76      }
77  
78      public void setAbbrevValue(String abbrevValue) {
79          this.abbrevValue = abbrevValue;
80      }
81  
82      /**
83       * Typically coincides with a name for display.
84       */
85      public String getValue() {
86          return value;
87      }
88  
89      public void setValue(String value) {
90          this.value = value;
91      }
92  
93      /**
94       * Date that this enumerated value became effective. If referring to another object, this may correspond with the effective date, created date, date of a state transition, or some arbitrarily defined date. For code/value pairs with no dates, the current date may be returned.
95       */
96      public Date getEffectiveDate() {
97          return effectiveDate;
98      }
99  
100     public void setEffectiveDate(Date effectiveDate) {
101         this.effectiveDate = effectiveDate;
102     }
103 
104     /**
105      * Date that this enumerated value expires. If referring to another object, this may correspond with the expiration date, date of a state transition, or some arbitrarily defined date. If this field is not specified, then no expiration date has been currently defined. For code/value pairs with no dates, this date may not be specified.
106      */
107     public Date getExpirationDate() {
108         return expirationDate;
109     }
110 
111     public void setExpirationDate(Date expirationDate) {
112         this.expirationDate = expirationDate;
113     }
114 
115     /**
116      * Default position for the enumerated value. This might or might not exist, particularly in cases where the enumeration consists solely of a view.
117      */
118     public String getSortKey() {
119         return sortKey;
120     }
121 
122     public void setSortKey(String sortKey) {
123         this.sortKey = sortKey;
124     }
125 
126     /**
127      * Indicates which context types and values this particular enumerated value participates in.
128      */
129     public List<EnumContextValueInfo> getContexts() {
130         if (contexts == null) {
131             contexts = new ArrayList<EnumContextValueInfo>();
132         }
133         return contexts;
134     }
135 
136     public void setContexts(List<EnumContextValueInfo> contexts) {
137         this.contexts = contexts;
138     }
139 
140     public String getEnumerationKey() {
141         return enumerationKey;
142     }
143 
144     public void setEnumerationKey(String enumerationKey) {
145         this.enumerationKey = enumerationKey;
146     }
147 
148     
149 }