View Javadoc

1   /**
2    * Copyright 2005-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.rice.krad.labs.transaction;
17  
18  import org.apache.commons.lang.RandomStringUtils;
19  
20  import java.io.Serializable;
21  import java.util.ArrayList;
22  import java.util.List;
23  
24  /**
25   * Test transaction model.  For testing only; does not represent any real object.
26   *
27   * @author Kuali Rice Team (rice.collab@kuali.org)
28   */
29  public class TransactionModel implements Serializable {
30      private static final long serialVersionUID = -437696877653987556L;
31      private String id;
32      private Integer chargeAmount;
33      private String transactionDisplayType;
34      private List<TransactionModel> subTransactions = new ArrayList<TransactionModel>();
35  
36      public TransactionModel(){
37          this.id = RandomStringUtils.randomAlphanumeric(4);
38          this.chargeAmount = new Integer(RandomStringUtils.randomNumeric(2));
39          this.transactionDisplayType = "type" + RandomStringUtils.randomNumeric(2);
40      }
41  
42      public TransactionModel(int subTransactionsItemNumber){
43          this();
44  
45          for(int i = 0; i < subTransactionsItemNumber; i++){
46              this.subTransactions.add(new TransactionModel(0));
47          }
48      }
49  
50      public Integer getChargeAmount() {
51          return chargeAmount;
52      }
53  
54      public void setChargeAmount(Integer chargeAmount) {
55          this.chargeAmount = chargeAmount;
56      }
57  
58      public String getId() {
59          return id;
60      }
61  
62      public void setId(String id) {
63          this.id = id;
64      }
65  
66      public List<TransactionModel> getSubTransactions() {
67          return subTransactions;
68      }
69  
70      public void setSubTransactions(List<TransactionModel> subTransactions) {
71          this.subTransactions = subTransactions;
72      }
73  
74      public String getTransactionDisplayType() {
75          return transactionDisplayType;
76      }
77  
78      public void setTransactionDisplayType(String transactionDisplayType) {
79          this.transactionDisplayType = transactionDisplayType;
80      }
81  }