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.r2.lum.clu.dto;
17  
18  import org.kuali.student.r2.common.dto.MetaInfo;
19  import org.kuali.student.r2.common.dto.IdNamelessEntityInfo;
20  import org.kuali.student.r2.common.dto.RichTextInfo;
21  import org.kuali.student.r2.lum.clu.infc.ResultOption;
22  
23  import javax.xml.bind.annotation.XmlAccessType;
24  import javax.xml.bind.annotation.XmlAccessorType;
25  import javax.xml.bind.annotation.XmlElement;
26  import javax.xml.bind.annotation.XmlType;
27  import java.io.Serializable;
28  import java.util.Date;
29  
30  @XmlAccessorType(XmlAccessType.FIELD)
31  @XmlType(name = "ResultOptionInfo", propOrder = {"id", "descr", "typeKey", "stateKey", "resultUsageTypeKey", "resultComponentId", "effectiveDate",
32          "expirationDate", "meta", "attributes" })//, "_futureElements" }) TODO KSCM-372: Non-GWT translatable code})
33  public class ResultOptionInfo extends IdNamelessEntityInfo implements ResultOption, Serializable {
34  
35      private static final long serialVersionUID = 1L;
36  
37      @XmlElement
38      private RichTextInfo descr;
39  
40      @XmlElement
41      private String resultUsageTypeKey;
42  
43      @XmlElement
44      private String resultComponentId;
45  
46      @XmlElement
47      private Date effectiveDate;
48  
49      @XmlElement
50      private Date expirationDate;
51  
52  //    TODO KSCM-372: Non-GWT translatable code
53  //    @XmlAnyElement
54  //    private List<Element> _futureElements;
55  
56      public ResultOptionInfo() {
57  
58      }
59  
60      public ResultOptionInfo(ResultOption resultOption) {
61          super(resultOption);
62          if (null != resultOption) {
63              this.resultUsageTypeKey = resultOption.getResultUsageTypeKey();
64              this.resultComponentId = resultOption.getResultComponentId();
65              this.effectiveDate = (null != resultOption.getEffectiveDate()) ? new Date(resultOption.getEffectiveDate().getTime()) : null;
66              this.expirationDate = (null != resultOption.getExpirationDate()) ? new Date(resultOption.getExpirationDate().getTime()) : null;
67          }
68      }
69  
70      @Override
71      public RichTextInfo getDescr() {
72          return descr;
73      }
74  
75      public void setDescr(RichTextInfo descr) {
76          this.descr = descr;
77      }
78  
79      @Override
80      public String getResultUsageTypeKey() {
81          return resultUsageTypeKey;
82      }
83  
84      public void setResultUsageTypeKey(String resultUsageTypeKey) {
85          this.resultUsageTypeKey = resultUsageTypeKey;
86      }
87  
88      @Override
89      public String getResultComponentId() {
90          return resultComponentId;
91      }
92  
93      public void setResultComponentId(String resultComponentId) {
94          this.resultComponentId = resultComponentId;
95      }
96  
97      @Override
98      public Date getEffectiveDate() {
99          return effectiveDate;
100     }
101 
102     public void setEffectiveDate(Date effectiveDate) {
103         this.effectiveDate = effectiveDate;
104     }
105 
106     @Override
107     public Date getExpirationDate() {
108         return expirationDate;
109     }
110 
111     public void setExpirationDate(Date expirationDate) {
112         this.expirationDate = expirationDate;
113     }
114 
115 }