001/* 002 * Copyright 2005 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 017package org.kuali.ole.module.cg.businessobject; 018 019import java.util.LinkedHashMap; 020 021import org.kuali.ole.integration.cg.ContractsAndGrantsAgency; 022import org.kuali.ole.sys.OLEConstants; 023import org.kuali.rice.core.api.mo.common.active.MutableInactivatable; 024import org.kuali.rice.core.api.util.type.KualiDecimal; 025import org.kuali.rice.krad.bo.PersistableBusinessObjectBase; 026 027/** 028 * This class defines an agency as it is used and referenced within the Contracts and Grants portion of a college or university 029 * financial system. 030 */ 031public class Agency extends PersistableBusinessObjectBase implements ContractsAndGrantsAgency, MutableInactivatable { 032 033 private String agencyNumber; 034 private String reportingName; 035 private String fullName; 036 private String agencyTypeCode; 037 private String reportsToAgencyNumber; 038 private KualiDecimal indirectAmount; 039 private boolean inStateIndicator; 040 private Agency reportsToAgency; 041 private AgencyType agencyType; 042 private boolean active; 043 044 public static final String CACHE_NAME = OLEConstants.APPLICATION_NAMESPACE_CODE + "/" + "Agency"; 045 046 /** 047 * Gets the agencyTypeCode attribute. 048 * 049 * @return Returns the agencyTypeCode. 050 */ 051 public String getAgencyTypeCode() { 052 return agencyTypeCode; 053 } 054 055 /** 056 * Sets the agencyTypeCode attribute value. 057 * 058 * @param agencyTypeCode The agencyTypeCode to set. 059 */ 060 public void setAgencyTypeCode(String agencyTypeCode) { 061 this.agencyTypeCode = agencyTypeCode; 062 } 063 064 /** 065 * Gets the reportsToAgencyNumber attribute. 066 * 067 * @return Returns the reportsToAgencyNumber. 068 */ 069 public String getReportsToAgencyNumber() { 070 return reportsToAgencyNumber; 071 } 072 073 /** 074 * Sets the reportsToAgencyNumber attribute value. 075 * 076 * @param reportsToAgencyNumber The reportsToAgencyNumber to set. 077 */ 078 public void setReportsToAgencyNumber(String reportsToAgencyNumber) { 079 this.reportsToAgencyNumber = reportsToAgencyNumber; 080 } 081 082 /** 083 * Default no-arg constructor. 084 */ 085 public Agency() { 086 087 } 088 089 /** 090 * Gets the agencyNumber attribute. 091 * 092 * @return Returns the agencyNumber 093 */ 094 @Override 095 public String getAgencyNumber() { 096 return agencyNumber; 097 } 098 099 /** 100 * Sets the agencyNumber attribute. 101 * 102 * @param agencyNumber The agencyNumber to set. 103 */ 104 public void setAgencyNumber(String agencyNumber) { 105 this.agencyNumber = agencyNumber; 106 } 107 108 /** 109 * Gets the reportingName attribute. 110 * 111 * @return Returns the reportingName 112 */ 113 public String getReportingName() { 114 return reportingName; 115 } 116 117 /** 118 * Sets the reportingName attribute. 119 * 120 * @param reportingName The reportingName to set. 121 */ 122 public void setReportingName(String reportingName) { 123 this.reportingName = reportingName; 124 } 125 126 /** 127 * Gets the fullName attribute. 128 * 129 * @return Returns the fullName 130 */ 131 public String getFullName() { 132 return fullName; 133 } 134 135 /** 136 * Sets the fullName attribute. 137 * 138 * @param fullName The fullName to set. 139 */ 140 public void setFullName(String fullName) { 141 this.fullName = fullName; 142 } 143 144 /** 145 * Gets the indirectAmount attribute. 146 * 147 * @return Returns the indirectAmount 148 */ 149 public KualiDecimal getIndirectAmount() { 150 return indirectAmount; 151 } 152 153 /** 154 * Sets the indirectAmount attribute. 155 * 156 * @param indirectAmount The indirectAmount to set. 157 */ 158 public void setIndirectAmount(KualiDecimal indirectAmount) { 159 this.indirectAmount = indirectAmount; 160 } 161 162 /** 163 * Gets the inStateIndicator attribute. 164 * 165 * @return Returns the inStateIndicator 166 */ 167 public boolean isInStateIndicator() { 168 return inStateIndicator; 169 } 170 171 /** 172 * Sets the inStateIndicator attribute. 173 * 174 * @param inStateIndicator The inStateIndicator to set. 175 */ 176 public void setInStateIndicator(boolean inStateIndicator) { 177 this.inStateIndicator = inStateIndicator; 178 } 179 180 /** 181 * Gets the reportsToAgency attribute. 182 * 183 * @return Returns the reportsToAgency 184 */ 185 public Agency getReportsToAgency() { 186 return reportsToAgency; 187 } 188 189 /** 190 * Sets the reportsToAgency attribute. 191 * 192 * @param reportsToAgencyNumber The reportsToAgency to set. 193 * @deprecated 194 * @todo Why is this deprecated? 195 */ 196 @Deprecated 197 public void setReportsToAgency(Agency reportsToAgencyNumber) { 198 this.reportsToAgency = reportsToAgencyNumber; 199 } 200 201 /** 202 * Gets the agencyType attribute. 203 * 204 * @return Returns the agencyType 205 */ 206 public AgencyType getAgencyType() { 207 return agencyType; 208 } 209 210 /** 211 * Sets the agencyType attribute. 212 * 213 * @param agencyType The agencyType to set. 214 * @deprecated 215 * @todo Why is this deprecated? 216 */ 217 @Deprecated 218 public void setAgencyType(AgencyType agencyType) { 219 this.agencyType = agencyType; 220 } 221 222 /** 223 * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper() 224 */ 225 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() { 226 LinkedHashMap m = new LinkedHashMap(); 227 228 m.put("agencyNumber", getAgencyNumber()); 229 return m; 230 } 231 232 /** 233 * This method compares the passed in agency object against this agency object to check for equality. Equality is defined by if 234 * the agency passed in has the same agency number as the agency being compared to. 235 * 236 * @param agency The agency object to be compared. 237 * @return True if the agency passed in is determined to be equal, false otherwise. 238 */ 239 public boolean equals(Agency agency) { 240 return this.agencyNumber.equals(agency.getAgencyNumber()); 241 } 242 243 /** 244 * Gets the active attribute. 245 * @return Returns the active. 246 */ 247 @Override 248 public boolean isActive() { 249 return active; 250 } 251 252 /** 253 * Sets the active attribute value. 254 * @param active The active to set. 255 */ 256 @Override 257 public void setActive(boolean active) { 258 this.active = active; 259 } 260 261}