View Javadoc

1   /*
2    * Copyright 2007-2008 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.kns.test.document;
17  
18  import java.util.ArrayList;
19  import java.util.LinkedHashMap;
20  import java.util.List;
21  
22  import org.kuali.rice.kns.document.SessionDocument;
23  import org.kuali.rice.kns.document.TransactionalDocumentBase;
24  import org.kuali.rice.kns.test.document.bo.Account;
25  
26  
27  
28  public class AccountRequestDocument extends TransactionalDocumentBase implements SessionDocument {
29  
30      private String requester;
31      private String reason1;
32      private String reason2;
33      private String requestType;
34      private String accountTypeCode;
35  
36      private List<Account> accounts;
37  
38      public AccountRequestDocument() {
39          accounts = new ArrayList<Account>();
40      }
41  
42      @Override
43      protected LinkedHashMap toStringMapper() {
44          LinkedHashMap<String, String> meMap = new LinkedHashMap<String, String>();
45          meMap.put("requester", getRequester());
46          meMap.put("reason1", getReason1());
47          meMap.put("reason2", getReason2());
48          return meMap;
49      }
50  
51      public String getReason2() {
52          return reason2;
53      }
54  
55      public void setReason2(String reason2) {
56          this.reason2 = reason2;
57      }
58  
59      public String getReason1() {
60          return reason1;
61      }
62  
63      public void setReason1(String reason1) {
64          this.reason1 = reason1;
65      }
66  
67      public String getRequester() {
68          return requester;
69      }
70  
71      public void setRequester(String requester) {
72          this.requester = requester;
73      }
74  
75      public List<Account> getAccounts() {
76          return accounts;
77      }
78  
79      public void setAccounts(List<Account> accounts) {
80          this.accounts = accounts;
81      }
82  
83      public Account getAccount(int index) {
84          while(accounts.size() - 1 < index) {
85              accounts.add(new Account());
86          }
87          return accounts.get(index);
88      }
89  
90      public String getRequestType() {
91          return requestType;
92      }
93  
94      public void setRequestType(String requestType) {
95          this.requestType = requestType;
96      }
97  
98      public void setAccountTypeCode(String accountType) {
99          this.accountTypeCode = accountType;
100     }
101 
102     public String getAccountTypeCode() {
103         return accountTypeCode;
104     }
105 
106 }