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