View Javadoc

1   /*
2    * Copyright 2013 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.core.rate.dto;
18  
19  import org.kuali.student.core.rate.infc.FlexibleCreditAmount;
20  import org.kuali.student.r2.common.dto.CurrencyAmountInfo;
21  
22  import java.io.Serializable;
23  import java.util.List;
24  
25  import javax.xml.bind.annotation.XmlAccessType;
26  import javax.xml.bind.annotation.XmlAccessorType;
27  import javax.xml.bind.annotation.XmlAnyElement;
28  import javax.xml.bind.annotation.XmlElement;
29  import javax.xml.bind.annotation.XmlType;
30  
31  import org.w3c.dom.Element;
32  
33  @XmlAccessorType(XmlAccessType.FIELD)
34  @XmlType(name = "FlexibleCreditAmountInfo", propOrder = {
35          "credits", "amount", "_futureElements" })
36  
37  public class FlexibleCreditAmountInfo
38      implements FlexibleCreditAmount {
39  
40      private static final long serialVersionUID = 1L;
41  
42      @XmlElement
43      private String credits;
44  
45      @XmlElement
46      private CurrencyAmountInfo amount;
47  
48      @XmlAnyElement
49      private List<Element> _futureElements;
50  
51  
52      /**
53       * Constructs a new FlexibleCreditAmountInfo.
54       */
55      public FlexibleCreditAmountInfo() {
56      }
57  
58      /**
59       * Constructs a new FlexibleCreditAmountInfo from another
60       * FlexibleCreditAmount.
61       *
62       * @param flexibleCreditAmount the FlexibleCreditAmount to copy
63       */
64      public FlexibleCreditAmountInfo(FlexibleCreditAmount flexibleCreditAmount) {
65          if (flexibleCreditAmount != null) {
66              this.credits = flexibleCreditAmount.getCredits();
67              this.amount = new CurrencyAmountInfo(flexibleCreditAmount.getAmount());
68          }
69      }
70  
71      @Override
72      public String getCredits() {
73          return (this.credits);
74      }
75  
76      public void setCredits(String credits) {
77          this.credits = credits;
78      }
79  
80      @Override
81      public CurrencyAmountInfo getAmount() {
82          return (this.amount);
83      }
84  
85      public void setAmount(CurrencyAmountInfo amount) {
86          this.amount = amount;
87      }
88  }