Coverage Report - org.kuali.student.enrollment.classII.academiccalendar.dto.AcademicCalendarInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
AcademicCalendarInfo
0%
0/18
0%
0/4
1.111
AcademicCalendarInfo$Builder
0%
0/23
N/A
1.111
 
 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.enrollment.classII.academiccalendar.dto;
 17  
 
 18  
 import java.io.Serializable;
 19  
 import java.util.Date;
 20  
 import java.util.List;
 21  
 import org.w3c.dom.Element;
 22  
 
 23  
 import javax.xml.bind.annotation.XmlAccessType;
 24  
 import javax.xml.bind.annotation.XmlAccessorType;
 25  
 import javax.xml.bind.annotation.XmlAnyElement;
 26  
 import javax.xml.bind.annotation.XmlAttribute;
 27  
 import javax.xml.bind.annotation.XmlElement;
 28  
 import javax.xml.bind.annotation.XmlType;
 29  
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 30  
 
 31  
 import org.kuali.student.r2.common.dto.KeyEntityInfo;
 32  
 import org.kuali.student.r2.common.infc.ModelBuilder;
 33  
 
 34  
 import org.kuali.student.enrollment.classII.academiccalendar.infc.AcademicCalendar;
 35  
 
 36  
 @XmlAccessorType(XmlAccessType.FIELD)
 37  
 @XmlType(name = "AcademicCalendarInfo", propOrder = {"key", "typeKey", "stateKey", "name", "descr", "startDate", "endDate", "campusCalendarKeys", "credentialProgramTypeKey", "metaInfo", "attributes", "_futureElements"})
 38  
 
 39  
 public class AcademicCalendarInfo extends KeyEntityInfo implements AcademicCalendar, Serializable {
 40  
 
 41  
     private static final long serialVersionUID = 1L;
 42  
 
 43  
     @XmlElement
 44  
     private final Date startDate;
 45  
 
 46  
     @XmlElement
 47  
     private final Date endDate;
 48  
 
 49  
     @XmlElement
 50  
     private final List<String> campusCalendarKeys;
 51  
 
 52  
     @XmlElement 
 53  
     private final String credentialProgramTypeKey;
 54  
 
 55  
     @XmlAnyElement
 56  
     private final List<Element> _futureElements;  
 57  
 
 58  0
     private AcademicCalendarInfo() {
 59  0
         startDate = null;
 60  0
         endDate = null;
 61  0
         campusCalendarKeys = null;
 62  0
         credentialProgramTypeKey = null;
 63  0
         _futureElements = null;
 64  0
     }
 65  
 
 66  
     /**
 67  
      * Constructs a new AcademicCalendarInfo from another
 68  
      * AcademicCalendar.
 69  
      *
 70  
      * @param academicCalendar the Academic Calendar to copy
 71  
      */
 72  
     public AcademicCalendarInfo(AcademicCalendar academicCalendar) {
 73  0
         super(academicCalendar);
 74  
 
 75  0
         this.startDate = null != academicCalendar.getStartDate() ? new Date(academicCalendar.getStartDate().getTime()) : null;
 76  0
         this.endDate = null != academicCalendar.getEndDate() ? new Date(academicCalendar.getEndDate().getTime()) : null;
 77  0
         this.campusCalendarKeys = academicCalendar.getCampusCalendarKeys();
 78  0
         this.credentialProgramTypeKey = academicCalendar.getCredentialProgramTypeKey();
 79  
 
 80  0
         _futureElements = null;
 81  0
     }
 82  
 
 83  
 
 84  
     @Override
 85  
     public Date getStartDate() {
 86  0
         return startDate;
 87  
     }
 88  
 
 89  
 
 90  
     @Override
 91  
     public Date getEndDate() {
 92  0
         return endDate;
 93  
     }
 94  
 
 95  
 
 96  
     @Override
 97  
     public List<String> getCampusCalendarKeys() {
 98  0
         return campusCalendarKeys;
 99  
     }
 100  
 
 101  
     @Override
 102  
     public String getCredentialProgramTypeKey() {
 103  0
         return credentialProgramTypeKey;
 104  
     }
 105  
 
 106  
     /**
 107  
      * The builder class for this AcademicCalendarInfo.
 108  
      */
 109  0
     public static class Builder extends KeyEntityInfo.Builder implements ModelBuilder<AcademicCalendarInfo>, AcademicCalendar {
 110  
 
 111  
         private Date startDate;
 112  
         private Date endDate;
 113  
         private List<String> campusCalendarKeys;
 114  
         private String credentialProgramTypeKey;
 115  
 
 116  
 
 117  
         /**
 118  
          * Constructs a new builder.
 119  
          */
 120  0
         public Builder() {}
 121  
 
 122  
         /**
 123  
          * Constructs a new builder initialized from another AcademicCalendar
 124  
          */
 125  
         public Builder(AcademicCalendar academicCalendar) {
 126  0
             super(academicCalendar);
 127  
 
 128  0
             this.startDate = academicCalendar.getStartDate();
 129  0
             this.endDate = academicCalendar.getEndDate();
 130  0
             this.campusCalendarKeys =  academicCalendar.getCampusCalendarKeys();
 131  0
             this.credentialProgramTypeKey = academicCalendar.getCredentialProgramTypeKey();
 132  0
         }
 133  
 
 134  
  
 135  
         public AcademicCalendarInfo build() {
 136  0
             return new AcademicCalendarInfo(this);
 137  
         }
 138  
 
 139  
 
 140  
         @Override
 141  
         public Date getStartDate() {
 142  0
             return startDate;
 143  
         }
 144  
 
 145  
 
 146  
         public void setStartDate(Date startDate) {
 147  0
             this.startDate = startDate;
 148  0
         }
 149  
 
 150  
   
 151  
         @Override
 152  
         public Date getEndDate() {
 153  0
             return endDate;
 154  
         }
 155  
 
 156  
 
 157  
         public void setEndDate(Date endDate) {
 158  0
             this.endDate = endDate;
 159  0
         }
 160  
 
 161  
 
 162  
         @Override
 163  
         public List<String> getCampusCalendarKeys() {
 164  0
             return campusCalendarKeys;
 165  
         }
 166  
 
 167  
         public void setCampusCalendarKeys(List<String> campusCalendarKeys) {
 168  0
             this.campusCalendarKeys = campusCalendarKeys;
 169  0
         }
 170  
 
 171  
         public void addCampusCalendarKey(String campusCalendarKey) {
 172  0
             this.campusCalendarKeys.add(campusCalendarKey);
 173  0
         }
 174  
 
 175  
         @Override
 176  
         public String getCredentialProgramTypeKey() {
 177  0
             return credentialProgramTypeKey;
 178  
         }
 179  
 
 180  
         public void setCredentialProgramTypeKey(String credentialProgramTypeKey) {
 181  0
             this.credentialProgramTypeKey = credentialProgramTypeKey;
 182  0
         }
 183  
     }
 184  
 }