001 /** 002 * Copyright 2004-2013 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.coa.businessobject; 017 018 import java.util.LinkedHashMap; 019 020 import org.apache.commons.lang.StringUtils; 021 import org.kuali.rice.core.api.mo.common.active.Inactivatable; 022 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase; 023 024 /** 025 * 026 */ 027 public class Chart extends PersistableBusinessObjectBase implements Inactivatable { 028 029 private static final long serialVersionUID = 4129020803214027609L; 030 031 private String finChartOfAccountDescription; 032 private boolean active; 033 private String chartOfAccountsCode; 034 035 /** 036 * Default no-arg constructor. 037 */ 038 public Chart() { 039 } 040 041 /** 042 * Gets the finChartOfAccountDescription attribute. 043 * 044 * @return Returns the finChartOfAccountDescription 045 */ 046 public String getFinChartOfAccountDescription() { 047 return finChartOfAccountDescription; 048 } 049 050 /** 051 * Sets the finChartOfAccountDescription attribute. 052 * 053 * @param finChartOfAccountDescription The finChartOfAccountDescription to set. 054 */ 055 public void setFinChartOfAccountDescription(String finChartOfAccountDescription) { 056 this.finChartOfAccountDescription = finChartOfAccountDescription; 057 } 058 059 /** 060 * Gets the active attribute. 061 * 062 * @return Returns the active 063 */ 064 public boolean isActive() { 065 return active; 066 } 067 068 /** 069 * Sets the active attribute. 070 * 071 * @param active The active to set. 072 */ 073 public void setActive(boolean active) { 074 this.active = active; 075 } 076 077 /** 078 * Gets the chartOfAccountsCode attribute. 079 * 080 * @return Returns the chartOfAccountsCode. 081 */ 082 public String getChartOfAccountsCode() { 083 return chartOfAccountsCode; 084 } 085 086 /** 087 * Sets the chartOfAccountsCode attribute value. 088 * 089 * @param chartOfAccountsCode The chartOfAccountsCode to set. 090 */ 091 public void setChartOfAccountsCode(String chartOfAccountsCode) { 092 this.chartOfAccountsCode = chartOfAccountsCode; 093 } 094 095 096 /** 097 * @return Returns the code and description in format: xx - xxxxxxxxxxxxxxxx 098 */ 099 public String getCodeAndDescription() { 100 if (StringUtils.isNotBlank(getChartOfAccountsCode()) && StringUtils.isNotBlank(getFinChartOfAccountDescription())) 101 return getChartOfAccountsCode() + " - " + getFinChartOfAccountDescription(); 102 else 103 return ""; 104 } 105 106 public String getCode() { 107 return this.chartOfAccountsCode; 108 } 109 110 public String getName() { 111 return this.finChartOfAccountDescription; 112 } 113 114 /** 115 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper() 116 */ 117 protected LinkedHashMap toStringMapper() { 118 LinkedHashMap m = new LinkedHashMap(); 119 120 m.put("chartOfAccountsCode", this.chartOfAccountsCode); 121 122 return m; 123 } 124 } 125