View Javadoc
1   /**
2    * Copyright 2004-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
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 implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.student.contract.model.test.source;
17  
18  import java.io.Serializable;
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.contract.model.test.source.ModelBuilder;
28  import org.kuali.student.contract.model.test.source.TimeAmount;
29  import org.w3c.dom.Element;
30  
31  @XmlAccessorType(XmlAccessType.FIELD)
32  @XmlType(name = "TimeAmountInfo", propOrder = {"atpDurationTypeKey", "timeQuantity", "_futureElements"})
33  public class TimeAmountInfo implements TimeAmount, Serializable {
34  	private static final long serialVersionUID = 1L;
35  	
36  	@XmlElement
37  	private final String atpDurationTypeKey; 
38  	
39  	@XmlElement
40  	private final Integer timeQuantity; 
41  
42      @XmlAnyElement
43      private final List<Element> _futureElements;    
44  	
45  	private TimeAmountInfo() {
46  		atpDurationTypeKey = null; 
47  		timeQuantity = null;
48  		_futureElements = null;
49  	}
50  	
51  	private TimeAmountInfo(TimeAmount builder) {
52  		this.atpDurationTypeKey = builder.getAtpDurationTypeKey();
53  		this.timeQuantity = builder.getTimeQuantity();
54  		this._futureElements = null;
55  	}
56  	
57  	public String getAtpDurationTypeKey(){
58  		return atpDurationTypeKey;
59  	}
60  	
61  	public Integer getTimeQuantity(){
62  		return timeQuantity;
63  	}
64  	
65  	public static class Builder implements ModelBuilder<TimeAmountInfo>, TimeAmount {
66  		private String atpDurationTypeKey;
67  		private Integer timeQuantity;
68  
69  		public Builder() {}
70  		
71  		public Builder(TimeAmount taInfo) {
72  			this.atpDurationTypeKey = taInfo.getAtpDurationTypeKey();
73  			this.timeQuantity = taInfo.getTimeQuantity();
74  		}
75  		
76  		public TimeAmountInfo build() {
77  			return new TimeAmountInfo(this);
78  		}
79  
80          public String getAtpDurationTypeKey() {
81              return atpDurationTypeKey;
82          }
83  
84          public void setAtpDurationTypeKey(String atpDurationTypeKey) {
85              this.atpDurationTypeKey = atpDurationTypeKey;
86          }
87  
88          public Integer getTimeQuantity() {
89              return timeQuantity;
90          }
91  
92          public void setTimeQuantity(Integer timeQuantity) {
93              this.timeQuantity = timeQuantity;
94          }
95  	}
96  }