Coverage Report - org.kuali.student.enrollment.classII.acal.dto.TermInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
TermInfo
0%
0/12
0%
0/4
1.182
TermInfo$Builder
0%
0/14
N/A
1.182
 
 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  
 package org.kuali.student.enrollment.classII.acal.dto;
 16  
 
 17  
 import java.io.Serializable;
 18  
 import java.util.Date;
 19  
 import java.util.List;
 20  
 
 21  
 import javax.xml.bind.annotation.XmlAccessType;
 22  
 import javax.xml.bind.annotation.XmlAccessorType;
 23  
 import javax.xml.bind.annotation.XmlAnyElement;
 24  
 import javax.xml.bind.annotation.XmlElement;
 25  
 import javax.xml.bind.annotation.XmlType;
 26  
 
 27  
 import org.kuali.student.enrollment.classII.acal.infc.Term;
 28  
 import org.kuali.student.r2.common.dto.KeyEntityInfo;
 29  
 import org.kuali.student.r2.common.infc.ModelBuilder;
 30  
 import org.w3c.dom.Element;
 31  
 
 32  
 @XmlAccessorType(XmlAccessType.FIELD)
 33  
 @XmlType(name = "TermInfo", propOrder = {"key", "typeKey", "stateKey", "name", "descr", "startDate", "endDate", "metaInfo", "attributes", "_futureElements"})
 34  
 
 35  
 public class TermInfo extends KeyEntityInfo implements Term, Serializable {
 36  
     private static final long serialVersionUID = 1L;
 37  
 
 38  
     @XmlElement
 39  
     private final Date startDate;
 40  
 
 41  
     @XmlElement
 42  
     private final Date endDate;
 43  
 
 44  
     @XmlAnyElement
 45  
     private final List<Element> _futureElements;
 46  
 
 47  0
     private TermInfo() {
 48  0
         startDate = null;
 49  0
         endDate = null;
 50  0
         _futureElements = null;
 51  0
     }
 52  
 
 53  
     /**
 54  
      * Constructs a new TermInfo from another
 55  
      * Term.
 56  
      *
 57  
      * @param term the Term to copy
 58  
      */
 59  
     public TermInfo(Term term) {
 60  0
         super(term);
 61  
 
 62  0
         this.startDate = null != term.getStartDate() ? new Date(term.getStartDate().getTime()) : null;
 63  0
         this.endDate = null != term.getEndDate() ? new Date(term.getEndDate().getTime()) : null;
 64  
 
 65  0
         _futureElements = null;
 66  0
     }
 67  
 
 68  
 
 69  
     @Override
 70  
     public Date getStartDate() {
 71  0
         return startDate;
 72  
     }
 73  
 
 74  
 
 75  
     @Override
 76  
     public Date getEndDate() {
 77  0
         return endDate;
 78  
     }
 79  
 
 80  
     /**
 81  
      * The builder class for this TermInfo.
 82  
      */
 83  0
     public static class Builder extends KeyEntityInfo.Builder implements ModelBuilder<TermInfo>, Term {
 84  
 
 85  
         private Date startDate;
 86  
         private Date endDate;
 87  
 
 88  
         /**
 89  
          * Constructs a new builder.
 90  
          */
 91  0
         public Builder() {
 92  0
         }
 93  
 
 94  
         /**
 95  
          * Constructs a new builder initialized from another Term
 96  
          */
 97  
         public Builder(Term term) {
 98  0
             super(term);
 99  0
             this.startDate = term.getStartDate();
 100  0
             this.startDate = term.getEndDate();
 101  0
         }
 102  
 
 103  
         @Override
 104  
         public TermInfo build() {
 105  0
             return new TermInfo(this);
 106  
         }
 107  
 
 108  
         @Override
 109  
         public Date getStartDate() {
 110  0
             return startDate;
 111  
         }
 112  
 
 113  
         public void setStartDate(Date startDate) {
 114  0
             this.startDate = startDate;
 115  0
         }
 116  
 
 117  
         @Override
 118  
         public Date getEndDate() {
 119  0
             return endDate;
 120  
         }
 121  
 
 122  
         public void setEndDate(Date endDate) {
 123  0
             this.endDate = endDate;
 124  0
         }
 125  
     }
 126  
 }