Coverage Report - org.kuali.student.r2.core.appointment.dto.AppointmentSlotRuleInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
AppointmentSlotRuleInfo
0%
0/28
0%
0/12
1.5
 
 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.appointment.dto;
 17  
 
 18  
 import org.kuali.student.r2.common.dto.TimeAmountInfo;
 19  
 import org.kuali.student.r2.common.dto.TimeOfDayInfo;
 20  
 import org.kuali.student.r2.core.appointment.infc.AppointmentSlotRule;
 21  
 
 22  
 import javax.xml.bind.Element;
 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.util.ArrayList;
 29  
 import java.util.List;
 30  
 
 31  
 /**
 32  
  * @Version 2.0
 33  
  * @Author Sri komandur@uw.edu
 34  
  */
 35  0
 @XmlAccessorType(XmlAccessType.FIELD)
 36  
 @XmlType(name = "AppointmentSlotRuleInfo", propOrder = {"weekdays", "startTimeOfDay", "endTimeOfDay",
 37  
         "slotStartInterval", "slotDuration", "_futureElements"})
 38  
 public class AppointmentSlotRuleInfo implements AppointmentSlotRule {
 39  
 
 40  
     @XmlElement
 41  
     private List<Integer> weekdays;
 42  
     @XmlElement
 43  
     private TimeOfDayInfo startTimeOfDay;
 44  
     @XmlElement
 45  
     private TimeOfDayInfo endTimeOfDay;
 46  
     @XmlElement
 47  
     private TimeAmountInfo slotStartInterval;
 48  
     @XmlElement
 49  
     private TimeAmountInfo slotDuration;
 50  
     @XmlAnyElement
 51  
     private List<Element> _futureElements;
 52  
 
 53  0
     public AppointmentSlotRuleInfo() {
 54  
 
 55  0
     }
 56  
 
 57  0
     public AppointmentSlotRuleInfo(AppointmentSlotRule appointmentSlotRule) {
 58  0
         if (null != appointmentSlotRule) {
 59  0
             this.weekdays = new ArrayList<Integer>(appointmentSlotRule.getWeekdays());
 60  0
             this.startTimeOfDay = (null != appointmentSlotRule.getStartTimeOfDay()) ? new TimeOfDayInfo(appointmentSlotRule.getStartTimeOfDay()) : null;
 61  0
             this.endTimeOfDay = (null != appointmentSlotRule.getEndTimeOfDay()) ? new TimeOfDayInfo(appointmentSlotRule.getEndTimeOfDay()) : null;
 62  0
             this.slotStartInterval = (null != appointmentSlotRule.getSlotStartInterval()) ? new TimeAmountInfo(appointmentSlotRule.getSlotStartInterval()) : null;
 63  0
             this.slotDuration = (null != appointmentSlotRule.getSlotDuration()) ? new TimeAmountInfo(appointmentSlotRule.getSlotDuration()) : null;
 64  
         }
 65  0
     }
 66  
 
 67  
     public void setWeekdays(List<Integer> weekdays) {
 68  0
         this.weekdays = weekdays;
 69  0
     }
 70  
 
 71  
     @Override
 72  
     public List<Integer> getWeekdays() {
 73  0
         if (null == this.weekdays) {
 74  0
             this.weekdays = new ArrayList<Integer>();
 75  
         }
 76  0
         return this.weekdays;
 77  
     }
 78  
 
 79  
     public void setStartTimeOfDay(TimeOfDayInfo startTimeOfDay) {
 80  0
         this.startTimeOfDay = startTimeOfDay;
 81  0
     }
 82  
 
 83  
     @Override
 84  
     public TimeOfDayInfo getStartTimeOfDay() {
 85  0
         return this.startTimeOfDay;
 86  
     }
 87  
 
 88  
     public void setEndTimeOfDay(TimeOfDayInfo endTimeOfDay) {
 89  0
         this.endTimeOfDay = endTimeOfDay;
 90  0
     }
 91  
 
 92  
     @Override
 93  
     public TimeOfDayInfo getEndTimeOfDay() {
 94  0
         return this.endTimeOfDay;
 95  
     }
 96  
 
 97  
     public void setSlotStartInterval(TimeAmountInfo slotStartInterval) {
 98  0
         this.slotStartInterval = slotStartInterval;
 99  0
     }
 100  
 
 101  
     @Override
 102  
     public TimeAmountInfo getSlotStartInterval() {
 103  0
         return this.slotStartInterval;
 104  
     }
 105  
 
 106  
     public void setSlotDuration(TimeAmountInfo slotDuration) {
 107  0
         this.slotDuration = slotDuration;
 108  0
     }
 109  
 
 110  
     @Override
 111  
     public TimeAmountInfo getSlotDuration() {
 112  0
         return this.slotDuration;
 113  
     }
 114  
 }