Coverage Report - org.kuali.student.r2.common.dto.DateRangeInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
DateRangeInfo
0%
0/15
0%
0/6
1.5
 
 1  
 /*
 2  
  * Copyright 2010 The Kuali Foundation 
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the
 5  
  * "License"); you may not use this file except in compliance with the
 6  
  * License. You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.osedu.org/licenses/ECL-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 13  
  * implied. See the License for the specific language governing
 14  
  * permissions and limitations under the License.
 15  
  */
 16  
 
 17  
 package org.kuali.student.r2.common.dto;
 18  
 
 19  
 import java.io.Serializable;
 20  
 import java.util.Date;
 21  
 import java.util.List;
 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.XmlElement;
 27  
 import javax.xml.bind.annotation.XmlType;
 28  
 
 29  
 import org.kuali.student.r2.common.infc.DateRange;
 30  
 import org.w3c.dom.Element;
 31  
 
 32  
 /**
 33  
  * A DTO for a date range.
 34  
  *
 35  
  * @author tom
 36  
  */
 37  
 
 38  
 @XmlAccessorType(XmlAccessType.FIELD)
 39  
 @XmlType(name = "DateRangeInfo", propOrder = {
 40  
                 "startDate", "endDate", "_futureElements"})
 41  
 
 42  
 public class DateRangeInfo 
 43  
     implements DateRange, Serializable {
 44  
         
 45  
     private static final long serialVersionUID = 1L;
 46  
 
 47  
     @XmlElement
 48  
     private Date startDate;
 49  
     
 50  
     @XmlElement
 51  
     private Date endDate;
 52  
     
 53  
     @XmlAnyElement
 54  
     private List<Element> _futureElements;    
 55  
     
 56  
 
 57  
     /**
 58  
      *  Constructs a new DateRangeInfo.
 59  
      */
 60  0
     public DateRangeInfo() {
 61  0
     }
 62  
         
 63  
     /**
 64  
      * Constructs a new DateRangeInfo from another DateRange.
 65  
      *
 66  
      * @param dateRange the DateRange to copy
 67  
      */
 68  0
     public DateRangeInfo(DateRange dateRange) {
 69  0
         if (dateRange != null) {
 70  0
             if (dateRange.getStartDate() != null) {
 71  0
                 this.startDate = new Date(dateRange.getStartDate().getTime());
 72  
             }
 73  
 
 74  0
             if (dateRange.getEndDate() != null) {
 75  0
                 this.endDate = new Date(dateRange.getEndDate().getTime());
 76  
             }
 77  
         }
 78  0
     }
 79  
 
 80  
     @Override
 81  
     public Date getStartDate() {
 82  0
         return startDate;
 83  
     }
 84  
 
 85  
     public void setStartDate(Date startDate) {
 86  0
         this.startDate = startDate;
 87  0
     }
 88  
 
 89  
     @Override
 90  
     public Date getEndDate() {
 91  0
         return endDate;
 92  
     }
 93  
 
 94  
     public void setEndDate(Date endDate) {
 95  0
         this.endDate = endDate;
 96  0
     }
 97  
 }