View Javadoc
1   /*
2    * Copyright 2008-2009 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.ole.fp.businessobject;
17  
18  import java.util.HashMap;
19  import java.util.LinkedHashMap;
20  import java.util.Map;
21  
22  import org.kuali.ole.sys.OLEPropertyConstants;
23  import org.kuali.rice.core.api.util.type.KualiDecimal;
24  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
25  import org.kuali.rice.krad.util.ObjectUtils;
26  
27  public class CapitalAssetAccountsGroupDetails extends PersistableBusinessObjectBase {
28  
29      //primary key fields..
30      private String documentNumber;
31      private Integer capitalAssetLineNumber;
32      private Integer capitalAssetAccountLineNumber;
33      private Integer sequenceNumber;
34  
35      // accounting line info
36      private String financialDocumentLineTypeCode;
37      private String chartOfAccountsCode;
38      private String accountNumber;
39      private String financialObjectCode;
40      private String subAccountNumber;
41      private String financialSubObjectCode;
42      private String projectCode;
43      private String organizationReferenceId;
44      private KualiDecimal amount;
45  
46      private CapitalAssetInformation capitalAssetInformation;
47  
48      /**
49       * Gets the documentNumber attribute.
50       *
51       * @return Returns the documentNumber
52       */
53  
54      public String getDocumentNumber() {
55          return documentNumber;
56      }
57  
58      /**
59       * Gets the capitalAssetAccountLineNumber attribute.
60       *
61       * @return Returns the capitalAssetAccountLineNumber
62       */
63  
64      public Integer getCapitalAssetAccountLineNumber() {
65          return capitalAssetAccountLineNumber;
66      }
67  
68      /**
69       * Gets the financialDocumentLineTypeCode attribute.
70       *
71       * @return Returns the financialDocumentLineTypeCode
72       */
73  
74      public String getFinancialDocumentLineTypeCode() {
75          return financialDocumentLineTypeCode;
76      }
77  
78      /**
79       * Gets the chartOfAccountsCode attribute.
80       *
81       * @return Returns the chartOfAccountsCode
82       */
83  
84      public String getChartOfAccountsCode() {
85          return chartOfAccountsCode;
86      }
87  
88      /**
89       * Gets the accountNumber attribute.
90       *
91       * @return Returns the accountNumber
92       */
93  
94      public String getAccountNumber() {
95          return accountNumber;
96      }
97  
98      /**
99       * Gets the financialObjectCode attribute.
100      *
101      * @return Returns the financialObjectCode
102      */
103 
104     public String getFinancialObjectCode() {
105         return financialObjectCode;
106     }
107 
108     /**
109      * Gets the capitalAssetInformation attribute.
110      *
111      * @return Returns the capitalAssetInformation.
112      */
113     public CapitalAssetInformation getCapitalAssetInformation() {
114         return capitalAssetInformation;
115     }
116 
117     /**
118      * Sets the capitalAssetInformation attribute value.
119      *
120      * @param capitalAssetInformation The capitalAssetInformation to set.
121      */
122     public void setCapitalAssetInformation(CapitalAssetInformation capitalAssetInformation) {
123         this.capitalAssetInformation = capitalAssetInformation;
124     }
125 
126 
127     /**
128      * Sets the documentNumber attribute.
129      *
130      * @param documentNumber The documentNumber to set.
131      */
132     public void setDocumentNumber(String documentNumber) {
133         this.documentNumber = documentNumber;
134     }
135 
136     /**
137      * Sets the capitalAssetAccountLineNumber attribute.
138      *
139      * @param capitalAssetAccountLineNumber The capitalAssetAccountLineNumber to set.
140      */
141     public void setCapitalAssetAccountLineNumber(Integer capitalAssetAccountLineNumber) {
142         this.capitalAssetAccountLineNumber = capitalAssetAccountLineNumber;
143     }
144 
145     /**
146      * Sets the financialDocumentLineTypeCode attribute.
147      *
148      * @param financialDocumentLineTypeCode The financialDocumentLineTypeCode to set.
149      */
150     public void setFinancialDocumentLineTypeCode(String financialDocumentLineTypeCode) {
151         this.financialDocumentLineTypeCode = financialDocumentLineTypeCode;
152     }
153 
154     /**
155      * Sets the chartOfAccountsCode attribute.
156      *
157      * @param chartOfAccountsCode The chartOfAccountsCode to set.
158      */
159     public void setChartOfAccountsCode(String chartOfAccountsCode) {
160         this.chartOfAccountsCode = chartOfAccountsCode;
161     }
162 
163     /**
164      * Sets the accountNumber attribute.
165      *
166      * @param accountNumber The accountNumber to set.
167      */
168     public void setAccountNumber(String accountNumber) {
169         this.accountNumber = accountNumber;
170     }
171 
172     /**
173      * Sets the financialObjectCode attribute.
174      *
175      * @param financialObjectCode The financialObjectCode to set.
176      */
177     public void setFinancialObjectCode(String financialObjectCode) {
178         this.financialObjectCode = financialObjectCode;
179     }
180 
181     /**
182      * Constructs a CapitalAssetInformation.java.
183      */
184     public CapitalAssetAccountsGroupDetails() {
185         super();
186         setAmount(KualiDecimal.ZERO);
187     }
188 
189     /**
190      * Gets the sequenceNumber attribute.
191      *
192      * @return Returns the sequenceNumber
193      */
194 
195     public Integer getSequenceNumber() {
196         return sequenceNumber;
197     }
198 
199     /**
200      * Sets the sequenceNumber attribute.
201      *
202      * @param sequenceNumber The sequenceNumber to set.
203      */
204     public void setSequenceNumber(Integer sequenceNumber) {
205         this.sequenceNumber = sequenceNumber;
206     }
207 
208     protected LinkedHashMap toStringMapper() {
209         LinkedHashMap m = new LinkedHashMap();
210         m.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
211         m.put(OLEPropertyConstants.CAPITAL_ASSET_LINE_NUMBER, this.getCapitalAssetLineNumber());
212         m.put(OLEPropertyConstants.CAPITAL_ASSET_ACCOUNT_LINE_NUMBER, this.getCapitalAssetAccountLineNumber());
213         m.put(OLEPropertyConstants.SEQUENCE_NUMBER, this.getSequenceNumber());
214 
215         return m;
216     }
217 
218     /**
219      * Returns a map with the primitive field names as the key and the primitive values as the map value.
220      *
221      * @return Map a map with the primitive field names as the key and the primitive values as the map value.
222      */
223     public Map<String, Object> getValuesMap() {
224         Map<String, Object> simpleValues = new HashMap<String, Object>();
225 
226         simpleValues.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.getDocumentNumber());
227         simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_LINE_NUMBER, this.getCapitalAssetLineNumber());
228         simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_ACCOUNT_LINE_NUMBER, this.getCapitalAssetAccountLineNumber());
229         simpleValues.put(OLEPropertyConstants.FINANCIAL_DOCUMENT_LINE_TYPE_CODE, this.getFinancialDocumentLineTypeCode());
230         simpleValues.put(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, this.getChartOfAccountsCode());
231         simpleValues.put(OLEPropertyConstants.ACCOUNT_NUMBER, this.getAccountNumber());
232         simpleValues.put(OLEPropertyConstants.FINANCIAL_OBJECT_CODE, this.getFinancialObjectCode());
233         simpleValues.put(OLEPropertyConstants.AMOUNT, this.getAmount());
234         simpleValues.put(OLEPropertyConstants.SEQUENCE_NUMBER, this.getSequenceNumber());
235 
236         return simpleValues;
237     }
238 
239     /**
240      * Gets the capitalAssetLineNumber attribute.
241      * @return Returns the capitalAssetLineNumber.
242      */
243     public Integer getCapitalAssetLineNumber() {
244         return capitalAssetLineNumber;
245     }
246 
247     /**
248      * Sets the capitalAssetLineNumber attribute value.
249      * @param capitalAssetLineNumber The capitalAssetLineNumber to set.
250      */
251     public void setCapitalAssetLineNumber(Integer capitalAssetLineNumber) {
252         this.capitalAssetLineNumber = capitalAssetLineNumber;
253     }
254 
255     /**
256      * @return Returns the amount.
257      */
258     public KualiDecimal getAmount() {
259         if (ObjectUtils.isNull(amount)) {
260             return KualiDecimal.ZERO;
261         }
262         else {
263             return amount;
264         }
265     }
266 
267     /**
268      * @param amount The amount to set.
269      */
270     public void setAmount(KualiDecimal amount) {
271         if (ObjectUtils.isNull(amount)) {
272             this.amount = KualiDecimal.ZERO;
273         }
274         else {
275             this.amount = amount;
276         }
277 
278         this.amount = amount;
279     }
280 
281     public String getSubAccountNumber() {
282         return subAccountNumber;
283     }
284 
285     public void setSubAccountNumber(String subAccountNumber) {
286         this.subAccountNumber = subAccountNumber;
287     }
288 
289     public String getFinancialSubObjectCode() {
290         return financialSubObjectCode;
291     }
292 
293     public void setFinancialSubObjectCode(String financialSubObjectCode) {
294         this.financialSubObjectCode = financialSubObjectCode;
295     }
296 
297     public String getProjectCode() {
298         return projectCode;
299     }
300 
301     public void setProjectCode(String projectCode) {
302         this.projectCode = projectCode;
303     }
304 
305     public String getOrganizationReferenceId() {
306         return organizationReferenceId;
307     }
308 
309     public void setOrganizationReferenceId(String organizationReferenceId) {
310         this.organizationReferenceId = organizationReferenceId;
311     }
312         
313 }