Coverage Report - org.kuali.student.r2.common.dto.StateInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
StateInfo
0%
0/36
0%
0/14
1.5
 
 1  
 /*
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may
 3  
  * not use this file except in compliance with the License. You may obtain a copy of the License at
 4  
  * http://www.osedu.org/licenses/ECL-2.0 Unless required by applicable law or agreed to in writing, software distributed
 5  
  * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 6  
  * implied. See the License for the specific language governing permissions and limitations under the License.
 7  
  */
 8  
 
 9  
 package org.kuali.student.r2.common.dto;
 10  
 
 11  
 import java.io.Serializable;
 12  
 import java.util.Date;
 13  
 import java.util.List;
 14  
 
 15  
 import javax.xml.bind.annotation.XmlAccessType;
 16  
 import javax.xml.bind.annotation.XmlAccessorType;
 17  
 import javax.xml.bind.annotation.XmlAnyElement;
 18  
 import javax.xml.bind.annotation.XmlAttribute;
 19  
 import javax.xml.bind.annotation.XmlElement;
 20  
 import javax.xml.bind.annotation.XmlType;
 21  
 
 22  
 import org.kuali.student.r2.common.infc.State;
 23  
 import org.w3c.dom.Element;
 24  
 
 25  
 @SuppressWarnings("serial")
 26  
 @XmlAccessorType(XmlAccessType.FIELD)
 27  
 @XmlType(name = "StateInfo", propOrder = {"key", "name", "descr", "effectiveDate", "expirationDate", "attributes", "_futureElements"})
 28  
 public class StateInfo extends HasAttributesInfo implements State, Serializable {
 29  
 
 30  
     @XmlAttribute
 31  
     private String key;
 32  
 
 33  
     @XmlElement
 34  
     private String name;
 35  
 
 36  
     @XmlElement
 37  
     private String descr;
 38  
 
 39  
     @XmlElement
 40  
     private Date effectiveDate;
 41  
 
 42  
     @XmlElement
 43  
     private Date expirationDate;
 44  
 
 45  
     @XmlAnyElement
 46  
     private List<Element> _futureElements;
 47  
 
 48  
     public static StateInfo getInstance(State state) {
 49  0
         return new StateInfo(state);
 50  
     }
 51  
 
 52  
     public static StateInfo newInstance(){
 53  0
             return new StateInfo();
 54  
     }
 55  
     
 56  0
     public StateInfo() {
 57  0
         key = null;
 58  0
         name = null;
 59  0
         descr = null;
 60  0
         effectiveDate = null;
 61  0
         expirationDate = null;
 62  0
         _futureElements = null;
 63  0
     }
 64  
 
 65  
     public StateInfo(State sInfo) {
 66  0
         super(sInfo);
 67  0
         if(sInfo != null){
 68  0
                 this.key = sInfo.getKey();
 69  0
                 this.name = sInfo.getName();
 70  0
                 this.descr = sInfo.getDescr();
 71  0
                 this.effectiveDate = null != sInfo.getEffectiveDate() ? new Date(sInfo.getEffectiveDate().getTime()) : null;
 72  0
                 this.expirationDate = null != sInfo.getExpirationDate() ? new Date(sInfo.getExpirationDate().getTime()) : null;
 73  0
                 this._futureElements = null;
 74  
         }
 75  0
     }
 76  
 
 77  
     @Override
 78  
     public String getKey() {
 79  0
         return key;
 80  
     }
 81  
 
 82  
     public void setKey(String key) {
 83  0
         this.key = key;
 84  0
     }
 85  
 
 86  
     @Override
 87  
     public String getName() {
 88  0
         return name;
 89  
     }
 90  
 
 91  
     public void setName(String name) {
 92  0
         this.name = name;
 93  0
     }
 94  
 
 95  
     @Override
 96  
     public String getDescr() {
 97  0
         return descr;
 98  
     }
 99  
 
 100  
     public void setDescr(String descr) {
 101  0
         this.descr = descr;
 102  0
     }
 103  
 
 104  
     @Override
 105  
     public Date getEffectiveDate() {
 106  0
         return effectiveDate != null ? new Date(effectiveDate.getTime()) : null;
 107  
     }
 108  
 
 109  
     
 110  
     public void setEffectiveDate(Date effectiveDate) {
 111  0
             if(effectiveDate != null)
 112  0
                     this.effectiveDate = new Date(effectiveDate.getTime());
 113  0
     }
 114  
 
 115  
     @Override
 116  
     public Date getExpirationDate() {
 117  0
             return expirationDate != null ? new Date(expirationDate.getTime()) : null;
 118  
     }
 119  
 
 120  
     
 121  
     public void setExpirationDate(Date expirationDate) {
 122  0
             if(expirationDate != null)
 123  0
                     this.expirationDate = new Date(expirationDate.getTime());
 124  0
     }
 125  
 }