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