1 /*
2 * Copyright 2005 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
17 package org.kuali.ole.module.cg.businessobject;
18
19 import java.util.LinkedHashMap;
20
21 import org.kuali.ole.integration.cg.ContractsAndGrantsAgency;
22 import org.kuali.ole.sys.OLEConstants;
23 import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
24 import org.kuali.rice.core.api.util.type.KualiDecimal;
25 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
26
27 /**
28 * This class defines an agency as it is used and referenced within the Contracts and Grants portion of a college or university
29 * financial system.
30 */
31 public class Agency extends PersistableBusinessObjectBase implements ContractsAndGrantsAgency, MutableInactivatable {
32
33 private String agencyNumber;
34 private String reportingName;
35 private String fullName;
36 private String agencyTypeCode;
37 private String reportsToAgencyNumber;
38 private KualiDecimal indirectAmount;
39 private boolean inStateIndicator;
40 private Agency reportsToAgency;
41 private AgencyType agencyType;
42 private boolean active;
43
44 public static final String CACHE_NAME = OLEConstants.APPLICATION_NAMESPACE_CODE + "/" + "Agency";
45
46 /**
47 * Gets the agencyTypeCode attribute.
48 *
49 * @return Returns the agencyTypeCode.
50 */
51 public String getAgencyTypeCode() {
52 return agencyTypeCode;
53 }
54
55 /**
56 * Sets the agencyTypeCode attribute value.
57 *
58 * @param agencyTypeCode The agencyTypeCode to set.
59 */
60 public void setAgencyTypeCode(String agencyTypeCode) {
61 this.agencyTypeCode = agencyTypeCode;
62 }
63
64 /**
65 * Gets the reportsToAgencyNumber attribute.
66 *
67 * @return Returns the reportsToAgencyNumber.
68 */
69 public String getReportsToAgencyNumber() {
70 return reportsToAgencyNumber;
71 }
72
73 /**
74 * Sets the reportsToAgencyNumber attribute value.
75 *
76 * @param reportsToAgencyNumber The reportsToAgencyNumber to set.
77 */
78 public void setReportsToAgencyNumber(String reportsToAgencyNumber) {
79 this.reportsToAgencyNumber = reportsToAgencyNumber;
80 }
81
82 /**
83 * Default no-arg constructor.
84 */
85 public Agency() {
86
87 }
88
89 /**
90 * Gets the agencyNumber attribute.
91 *
92 * @return Returns the agencyNumber
93 */
94 @Override
95 public String getAgencyNumber() {
96 return agencyNumber;
97 }
98
99 /**
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 }