Coverage Report - org.kuali.student.r2.core.scheduling.dto.TimeSlotInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
TimeSlotInfo
0%
0/19
0%
0/8
1.625
 
 1  
 /*
 2  
  * Copyright 2012 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.r2.core.scheduling.dto;
 17  
 
 18  
 import org.kuali.student.r2.common.dto.IdEntityInfo;
 19  
 import org.kuali.student.r2.common.dto.TimeOfDayInfo;
 20  
 import org.kuali.student.r2.core.scheduling.infc.TimeSlot;
 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.XmlElement;
 27  
 import javax.xml.bind.annotation.XmlType;
 28  
 import java.io.Serializable;
 29  
 import java.util.ArrayList;
 30  
 import java.util.List;
 31  
 
 32  
 /**
 33  
  * @Version 2.0
 34  
  * @Author Sri komandur@uw.edu
 35  
  */
 36  
 @XmlAccessorType(XmlAccessType.FIELD)
 37  
 @XmlType(name = "TimeSlotInfo", propOrder = {"id", "typeKey", "stateKey", "name", "descr",
 38  
         "weekdays", "startTime", "endTime",
 39  
         "meta", "attributes", "_futureElements"})
 40  
 public class TimeSlotInfo extends IdEntityInfo implements TimeSlot, Serializable {
 41  
 
 42  
     @XmlElement
 43  
     private List<Integer> weekdays;
 44  
     @XmlElement
 45  
     private TimeOfDayInfo startTime;
 46  
     @XmlElement
 47  
     private TimeOfDayInfo endTime;
 48  
     @XmlAnyElement
 49  
     private List<Element> _futureElements;
 50  
 
 51  0
     public TimeSlotInfo() {
 52  0
     }
 53  
 
 54  
     public TimeSlotInfo(TimeSlot timeSlot) {
 55  0
         super (timeSlot);
 56  0
         if (null != timeSlot) {
 57  0
             this.weekdays = new ArrayList<Integer>(timeSlot.getWeekdays());
 58  0
             this.startTime = (null != timeSlot.getStartTime()) ? new TimeOfDayInfo(timeSlot.getStartTime()) : null;
 59  0
             this.endTime = (null != timeSlot.getEndTime()) ? new TimeOfDayInfo(timeSlot.getEndTime()) : null;
 60  
         }
 61  0
     }
 62  
 
 63  
     @Override
 64  
     public List<Integer> getWeekdays() {
 65  0
         if (null == this.weekdays) {
 66  0
             return new ArrayList<Integer>();
 67  
         }
 68  
         else {
 69  0
             return this.weekdays;
 70  
         }
 71  
     }
 72  
 
 73  
     public void setWeekdays(List<Integer> weekdays) {
 74  0
         this.weekdays = weekdays;
 75  0
     }
 76  
 
 77  
     @Override
 78  
     public TimeOfDayInfo getStartTime() {
 79  0
         return startTime;
 80  
     }
 81  
 
 82  
     public void setStartTime(TimeOfDayInfo startTime) {
 83  0
         this.startTime = startTime;
 84  0
     }
 85  
 
 86  
     @Override
 87  
     public TimeOfDayInfo getEndTime() {
 88  0
         return endTime;
 89  
     }
 90  
 
 91  
     public void setEndTime(TimeOfDayInfo endTime) {
 92  0
         this.endTime = endTime;
 93  0
     }
 94  
 }