| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AtpInfo |
|
| 1.0;1 | ||||
| AtpInfo$Builder |
|
| 1.0;1 |
| 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 | ||
| 16 | package org.kuali.student.core.atp.dto; | |
| 17 | ||
| 18 | import java.io.Serializable; | |
| 19 | import java.util.Date; | |
| 20 | import java.util.List; | |
| 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.XmlAttribute; | |
| 27 | import javax.xml.bind.annotation.XmlElement; | |
| 28 | import javax.xml.bind.annotation.XmlType; | |
| 29 | import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | |
| 30 | ||
| 31 | import org.kuali.student.common.infc.ModelBuilder; | |
| 32 | import org.kuali.student.common.dto.KeyEntityInfo; | |
| 33 | import org.kuali.student.core.atp.infc.Atp; | |
| 34 | ||
| 35 | ||
| 36 | /** | |
| 37 | * Information about an academic time period. | |
| 38 | * | |
| 39 | * @Author tom | |
| 40 | * @Since Tue Apr 05 14:22:34 EDT 2011 | |
| 41 | */ | |
| 42 | ||
| 43 | @XmlAccessorType(XmlAccessType.FIELD) | |
| 44 | @XmlType(name = "AtpInfo", propOrder = {"key", "typeKey", "stateKey", "name", "descr", "startDate", "endDate", "metaInfo", "attributes", "_futureElements"}) | |
| 45 | ||
| 46 | public class AtpInfo extends KeyEntityInfo implements Atp, Serializable { | |
| 47 | ||
| 48 | private static final long serialVersionUID = 1L; | |
| 49 | ||
| 50 | @XmlElement | |
| 51 | private final Date startDate; | |
| 52 | ||
| 53 | @XmlElement | |
| 54 | private final Date endDate; | |
| 55 | ||
| 56 | @XmlAnyElement | |
| 57 | private final List<Element> _futureElements; | |
| 58 | ||
| 59 | 0 | private AtpInfo() { |
| 60 | 0 | startDate = null; |
| 61 | 0 | endDate = null; |
| 62 | 0 | _futureElements = null; |
| 63 | 0 | } |
| 64 | ||
| 65 | /** | |
| 66 | * Constructs a new AtpInfo from another Atp. | |
| 67 | * | |
| 68 | * @param atp the ATP to copy | |
| 69 | */ | |
| 70 | public AtpInfo(Atp atp) { | |
| 71 | 0 | super(atp); |
| 72 | 0 | this.startDate = atp.getStartDate(); |
| 73 | 0 | this.endDate = atp.getEndDate(); |
| 74 | 0 | _futureElements = null; |
| 75 | 0 | } |
| 76 | ||
| 77 | /** | |
| 78 | * Name: StartDate | |
| 79 | * Date and time the academic time period becomes effective. This | |
| 80 | * does not provide a bound on date ranges or milestones | |
| 81 | * associated with this time period, but instead indicates the | |
| 82 | * time period proper. This is a similar concept to the effective | |
| 83 | * date on enumerated values. When an end date has been specified, | |
| 84 | * this field must be less than or equal to the end date. | |
| 85 | * | |
| 86 | * @return the ATP start date | |
| 87 | */ | |
| 88 | @Override | |
| 89 | public Date getStartDate() { | |
| 90 | 0 | return startDate; |
| 91 | } | |
| 92 | ||
| 93 | /** | |
| 94 | * Name: EndDate | |
| 95 | * Date and time the academic time period becomes | |
| 96 | * ineffective. This does not provide a bound on date ranges or | |
| 97 | * milestones associated with this time period, but instead | |
| 98 | * indicates the time period proper. If specified, this must be | |
| 99 | * greater than or equal to the start date. If this field is not | |
| 100 | * specified, then no end date has been currently defined | |
| 101 | * and should automatically be considered greater than the | |
| 102 | * effective date. | |
| 103 | * | |
| 104 | * @return the ATP end date | |
| 105 | */ | |
| 106 | @Override | |
| 107 | public Date getEndDate() { | |
| 108 | 0 | return endDate; |
| 109 | } | |
| 110 | ||
| 111 | /** | |
| 112 | * The builder class for this AtpInfo. | |
| 113 | */ | |
| 114 | ||
| 115 | 0 | public static class Builder extends KeyEntityInfo.Builder implements ModelBuilder<AtpInfo>, Atp { |
| 116 | ||
| 117 | private Date startDate; | |
| 118 | private Date endDate; | |
| 119 | ||
| 120 | /** | |
| 121 | * Constructs a new builder. | |
| 122 | */ | |
| 123 | 0 | public Builder() {} |
| 124 | ||
| 125 | /** | |
| 126 | * Constructs a new builder initialized from another ATP. | |
| 127 | */ | |
| 128 | public Builder(Atp atp) { | |
| 129 | 0 | super(atp); |
| 130 | 0 | this.startDate = atp.getStartDate(); |
| 131 | 0 | this.startDate = atp.getEndDate(); |
| 132 | 0 | } |
| 133 | ||
| 134 | /** | |
| 135 | * Builds the ATP. | |
| 136 | * | |
| 137 | * @return a new ATP | |
| 138 | */ | |
| 139 | public AtpInfo build() { | |
| 140 | 0 | return new AtpInfo(this); |
| 141 | } | |
| 142 | ||
| 143 | /** | |
| 144 | * Gets the start date. | |
| 145 | * | |
| 146 | * @return the ATP start date | |
| 147 | */ | |
| 148 | @Override | |
| 149 | public Date getStartDate() { | |
| 150 | 0 | return startDate; |
| 151 | } | |
| 152 | ||
| 153 | /** | |
| 154 | * Sets the ATP start date. | |
| 155 | * | |
| 156 | * @param startDate the start date for the ATP | |
| 157 | */ | |
| 158 | public void setStartDate(Date startDate) { | |
| 159 | 0 | this.startDate = startDate; |
| 160 | 0 | } |
| 161 | ||
| 162 | /** | |
| 163 | * Gets the start date. | |
| 164 | * | |
| 165 | * @return the ATP end date | |
| 166 | */ | |
| 167 | @Override | |
| 168 | public Date getEndDate() { | |
| 169 | 0 | return endDate; |
| 170 | } | |
| 171 | ||
| 172 | /** | |
| 173 | * Sets the ATP end date. | |
| 174 | * | |
| 175 | * @param endDate the end date for the ATP | |
| 176 | */ | |
| 177 | public void setEndDate(Date endDate) { | |
| 178 | 0 | this.endDate = endDate; |
| 179 | 0 | } |
| 180 | } | |
| 181 | } |