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