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