001    /*
002     * Copyright 2011 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     */
016    package org.kuali.kfs.module.endow.businessobject;
017    
018    import java.util.LinkedHashMap;
019    
020    import org.apache.commons.lang.StringUtils;
021    import org.kuali.kfs.sys.KFSConstants;
022    import org.kuali.rice.kns.bo.KualiCodeBase;
023    
024    /**
025     * Business Object for Class Code table.
026     */
027    public class ClassCode extends KualiCodeBase {
028    
029        private String securityReportingGrp;
030        private String securityAccrualMethod;
031        private String securityEndowmentTransactionCode;
032        private String securityIncomeEndowmentTransactionPostCode;
033        private boolean taxLotIndicator;
034        private String classCodeType;
035        private String valuationMethod;
036    
037        private SecurityReportingGroup reportingGroup;
038        private AccrualMethod accrualMethod;
039        private EndowmentTransactionCode endowmentTransactionCode;
040        private EndowmentTransactionCode incomeEndowmentTransactionPost;
041        private ClassCodeType codeType;
042        private SecurityValuationMethod securityValuationMethod;
043    
044        /**
045         * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
046         */
047        @Override
048        protected LinkedHashMap toStringMapper() {
049            LinkedHashMap m = new LinkedHashMap();
050            m.put(KFSConstants.GENERIC_CODE_PROPERTY_NAME, this.code);
051            return m;
052        }
053    
054        /**
055         * This method gets the classCodeType.
056         * 
057         * @return classCodeType
058         */
059        public String getClassCodeType() {
060            return classCodeType;
061        }
062    
063        /**
064         * This method sets the classCodeType.
065         * 
066         * @param classCodeType
067         */
068        public void setClassCodeType(String classCodeType) {
069            this.classCodeType = classCodeType;
070        }
071    
072        /**
073         * This method gets the securityAccrualMethod
074         * 
075         * @return securityAccrualMethod
076         */
077        public String getSecurityAccrualMethod() {
078            return securityAccrualMethod;
079        }
080    
081        /**
082         * This method sets securityAccrualMethod.
083         * 
084         * @param securityAccrualMethod
085         */
086        public void setSecurityAccrualMethod(String securityAccrualMethod) {
087            this.securityAccrualMethod = securityAccrualMethod;
088        }
089    
090        /**
091         * This method gets the securityEndowmentTransactionCode.
092         * 
093         * @return securityEndowmentTransactionCode
094         */
095        public String getSecurityEndowmentTransactionCode() {
096            return securityEndowmentTransactionCode;
097        }
098    
099        /**
100         * This method sets the securityEndowmentTransactionCode.
101         * 
102         * @param securityEndowmentTransactionCode
103         */
104        public void setSecurityEndowmentTransactionCode(String securityEndowmentTransactionCode) {
105            this.securityEndowmentTransactionCode = securityEndowmentTransactionCode;
106        }
107    
108        /**
109         * This method gets the securityIncomeEndowmentTransactionPostCode.
110         * 
111         * @return securityIncomeEndowmentTransactionPostCode
112         */
113        public String getSecurityIncomeEndowmentTransactionPostCode() {
114            return securityIncomeEndowmentTransactionPostCode;
115        }
116    
117        /**
118         * This method sets the securityIncomeEndowmentTransactionPostCode.
119         * 
120         * @param securityIncomeEndowmentTransactionPostCode
121         */
122        public void setSecurityIncomeEndowmentTransactionPostCode(String securityIncomeEndowmentTransactionPostCode) {
123            this.securityIncomeEndowmentTransactionPostCode = securityIncomeEndowmentTransactionPostCode;
124        }
125    
126        /**
127         * This method gets the securityReportingGrp
128         * 
129         * @return securityReportingGrp
130         */
131        public String getSecurityReportingGrp() {
132            return securityReportingGrp;
133        }
134    
135        /**
136         * This method sets the securityReportingGrp.
137         * 
138         * @param securityReportingGrp
139         */
140        public void setSecurityReportingGrp(String securityReportingGrp) {
141            this.securityReportingGrp = securityReportingGrp;
142        }
143    
144        /**
145         * This method gets the taxLotIndicator.
146         * 
147         * @return taxLotIndicator
148         */
149        public boolean isTaxLotIndicator() {
150            return taxLotIndicator;
151        }
152    
153        /**
154         * This method sets the taxLotIndicator.
155         * 
156         * @param taxLotIndicator
157         */
158        public void setTaxLotIndicator(boolean taxLotIndicator) {
159            this.taxLotIndicator = taxLotIndicator;
160        }
161    
162        /**
163         * This method gets the valuationMethod.
164         * 
165         * @return valuationMethod
166         */
167        public String getValuationMethod() {
168            return valuationMethod;
169        }
170    
171        /**
172         * This method sets the valuationMethod.
173         * 
174         * @param valuationMethod
175         */
176        public void setValuationMethod(String valuationMethod) {
177            this.valuationMethod = valuationMethod;
178        }
179    
180        /**
181         * Gets the accrualMethod.
182         * 
183         * @return accrualMethod
184         */
185        public AccrualMethod getAccrualMethod() {
186            return accrualMethod;
187        }
188    
189        /**
190         * Sets the accrualMethod.
191         * 
192         * @param accrualMethod
193         */
194        public void setAccrualMethod(AccrualMethod accrualMethod) {
195            this.accrualMethod = accrualMethod;
196        }
197    
198        /**
199         * Gets the codeType.
200         * 
201         * @return codeType
202         */
203        public ClassCodeType getCodeType() {
204            return codeType;
205        }
206    
207        /**
208         * Sets the codeType.
209         * 
210         * @param codeType
211         */
212        public void setCodeType(ClassCodeType codeType) {
213            this.codeType = codeType;
214        }
215    
216        /**
217         * Gets the endowmentTransactionCode.
218         * 
219         * @return endowmentTransactionCode
220         */
221        public EndowmentTransactionCode getEndowmentTransactionCode() {
222            return endowmentTransactionCode;
223        }
224    
225        /**
226         * Sets the endowmentTransactionCode.
227         * 
228         * @param endowmentTransactionCode
229         */
230        public void setEndowmentTransactionCode(EndowmentTransactionCode endowmentTransactionCode) {
231            this.endowmentTransactionCode = endowmentTransactionCode;
232        }
233    
234        /**
235         * Gets the incomeEndowmentTransactionPost.
236         * 
237         * @return incomeEndowmentTransactionPost
238         */
239        public EndowmentTransactionCode getIncomeEndowmentTransactionPost() {
240            return incomeEndowmentTransactionPost;
241        }
242    
243        /**
244         * Sets the incomeEndowmentTransactionPost.
245         * 
246         * @param incomeEndowmentTransactionPost
247         */
248        public void setIncomeEndowmentTransactionPost(EndowmentTransactionCode incomeEndowmentTransactionPost) {
249            this.incomeEndowmentTransactionPost = incomeEndowmentTransactionPost;
250        }
251    
252        /**
253         * Gets the reportingGroup.
254         * 
255         * @return reportingGroup
256         */
257        public SecurityReportingGroup getReportingGroup() {
258            return reportingGroup;
259        }
260    
261        /**
262         * Sets the reportingGroup.
263         * 
264         * @param reportingGroup
265         */
266        public void setReportingGroup(SecurityReportingGroup reportingGroup) {
267            this.reportingGroup = reportingGroup;
268        }
269    
270        /**
271         * Gets the securityValuationMethod.
272         * 
273         * @return securityValuationMethod
274         */
275        public SecurityValuationMethod getSecurityValuationMethod() {
276            return securityValuationMethod;
277        }
278    
279        /**
280         * Sets the securityValuationMethod.
281         * 
282         * @param securityValuationMethod
283         */
284        public void setSecurityValuationMethod(SecurityValuationMethod securityValuationMethod) {
285            this.securityValuationMethod = securityValuationMethod;
286        }
287    
288        /**
289         * Gets the reportingGroup description.
290         * 
291         * @return reportingGroup description
292         */
293        public String getSecurityReportingGrpDesc() {
294    
295            if (reportingGroup != null) {
296                return reportingGroup.getName();
297            }
298            else
299                return KFSConstants.EMPTY_STRING;
300        }
301    
302        /**
303         * Gets the accrualMethod description.
304         * 
305         * @return
306         */
307        public String getAccrualMethodDesc() {
308            if (accrualMethod != null) {
309                return accrualMethod.getName();
310            }
311            else
312                return KFSConstants.EMPTY_STRING;
313        }
314    
315        /**
316         * Get endowmentTransactionCode description.
317         * 
318         * @return endowmentTransactionCode description
319         */
320        public String getEndowmentTransactionDesc() {
321            if (endowmentTransactionCode != null) {
322                return endowmentTransactionCode.getCodeAndDescription();
323            }
324            else
325                return KFSConstants.EMPTY_STRING;
326        }
327    
328        /**
329         * Gets the incomeEndowmentTransactionPost description.
330         * 
331         * @return incomeEndowmentTransactionPost
332         */
333        public String getIncomeEndowmentTransactionPostDesc() {
334            if (incomeEndowmentTransactionPost != null) {
335                return incomeEndowmentTransactionPost.getCodeAndDescription();
336            }
337            else
338                return KFSConstants.EMPTY_STRING;
339        }
340    
341        /**
342         * @see org.kuali.rice.kns.bo.KualiCodeBase#getCodeAndDescription()
343         */
344        @Override
345        public String getCodeAndDescription() {
346            if (StringUtils.isEmpty(code)) {
347                return KFSConstants.EMPTY_STRING;
348            }
349            return super.getCodeAndDescription();
350        }
351    
352    }