001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.krad.labs.transaction; 017 018import org.apache.commons.lang.RandomStringUtils; 019 020import java.io.Serializable; 021import java.util.ArrayList; 022import java.util.List; 023 024/** 025 * Test transaction model. For testing only; does not represent any real object. 026 * 027 * @author Kuali Rice Team (rice.collab@kuali.org) 028 */ 029public class TransactionModel implements Serializable { 030 private static final long serialVersionUID = -437696877653987556L; 031 private String id; 032 private Integer chargeAmount; 033 private String transactionDisplayType; 034 private List<TransactionModel> subTransactions = new ArrayList<TransactionModel>(); 035 036 public TransactionModel(){ 037 this.id = RandomStringUtils.randomAlphanumeric(4); 038 this.chargeAmount = new Integer(RandomStringUtils.randomNumeric(2)); 039 this.transactionDisplayType = "type" + RandomStringUtils.randomNumeric(2); 040 } 041 042 public TransactionModel(int subTransactionsItemNumber){ 043 this(); 044 045 for(int i = 0; i < subTransactionsItemNumber; i++){ 046 this.subTransactions.add(new TransactionModel(0)); 047 } 048 } 049 050 public Integer getChargeAmount() { 051 return chargeAmount; 052 } 053 054 public void setChargeAmount(Integer chargeAmount) { 055 this.chargeAmount = chargeAmount; 056 } 057 058 public String getId() { 059 return id; 060 } 061 062 public void setId(String id) { 063 this.id = id; 064 } 065 066 public List<TransactionModel> getSubTransactions() { 067 return subTransactions; 068 } 069 070 public void setSubTransactions(List<TransactionModel> subTransactions) { 071 this.subTransactions = subTransactions; 072 } 073 074 public String getTransactionDisplayType() { 075 return transactionDisplayType; 076 } 077 078 public void setTransactionDisplayType(String transactionDisplayType) { 079 this.transactionDisplayType = transactionDisplayType; 080 } 081}