001: /*
002: * Copyright 2006-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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.module.kra.budget.bo;
017:
018: import java.sql.Timestamp;
019: import java.util.LinkedHashMap;
020:
021: import org.kuali.core.bo.PersistableBusinessObjectBase;
022: import org.kuali.core.util.KualiDecimal;
023: import org.kuali.core.util.ObjectUtils;
024: import org.kuali.kfs.KFSPropertyConstants;
025:
026: /**
027: * Budget Fringe Rate Business Object
028: */
029: public class BudgetFringeRate extends PersistableBusinessObjectBase {
030:
031: private static final long serialVersionUID = -1305514388024735249L;
032: private String documentNumber;
033: private String institutionAppointmentTypeCode;
034: private KualiDecimal contractsAndGrantsFringeRateAmount;
035: private KualiDecimal institutionCostShareFringeRateAmount;
036: private Timestamp budgetLastUpdateTimestamp;
037:
038: private AppointmentType appointmentType;
039:
040: /**
041: *
042: */
043: public BudgetFringeRate() {
044: super ();
045: appointmentType = new AppointmentType();
046: }
047:
048: public BudgetFringeRate(String documentNumber,
049: String institutionAppointmentTypeCode) {
050: this ();
051: this .documentNumber = documentNumber;
052: this .institutionAppointmentTypeCode = institutionAppointmentTypeCode;
053: }
054:
055: public BudgetFringeRate(String documentNumber,
056: String institutionAppointmentTypeCode,
057: KualiDecimal contractsAndGrantsFringeRateAmount,
058: KualiDecimal institutionCostShareFringeRateAmount,
059: AppointmentType appointmentType) {
060: this (documentNumber, institutionAppointmentTypeCode,
061: contractsAndGrantsFringeRateAmount,
062: institutionCostShareFringeRateAmount, appointmentType,
063: null, null);
064: }
065:
066: public BudgetFringeRate(String documentNumber,
067: AppointmentType appointmentType) {
068: this (documentNumber, appointmentType.getAppointmentTypeCode(),
069: appointmentType.getFringeRateAmount(), appointmentType
070: .getCostShareFringeRateAmount(),
071: appointmentType, null, null);
072: }
073:
074: public BudgetFringeRate(String documentNumber,
075: String institutionAppointmentTypeCode,
076: KualiDecimal contractsAndGrantsFringeRateAmount,
077: KualiDecimal institutionCostShareFringeRateAmount,
078: AppointmentType appointmentType, String objectId,
079: Long versionNumber) {
080: super ();
081: this .documentNumber = documentNumber;
082: this .institutionAppointmentTypeCode = institutionAppointmentTypeCode;
083: this .contractsAndGrantsFringeRateAmount = contractsAndGrantsFringeRateAmount;
084: this .institutionCostShareFringeRateAmount = institutionCostShareFringeRateAmount;
085: this .appointmentType = appointmentType;
086: setObjectId(objectId);
087: setVersionNumber(versionNumber);
088: }
089:
090: /*
091: * (non-Javadoc)
092: *
093: * @see org.kuali.core.bo.BusinessObjectBase#toStringBuilder(java.util.LinkedHashMap)
094: */
095: protected String toStringBuilder(LinkedHashMap fieldValues) {
096: // TODO Auto-generated method stub
097: return super .toStringBuilder(fieldValues);
098: }
099:
100: /*
101: * (non-Javadoc)
102: *
103: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
104: */
105: protected LinkedHashMap toStringMapper() {
106: LinkedHashMap m = new LinkedHashMap();
107:
108: m
109: .put(KFSPropertyConstants.DOCUMENT_NUMBER,
110: this .documentNumber);
111: m.put("institutionAppointmentTypeCode",
112: this .institutionAppointmentTypeCode);
113: return m;
114: }
115:
116: /*
117: * (non-Javadoc) Doesn't compare timestamps
118: *
119: * @see java.lang.Object#equals(java.lang.Object)
120: */
121: public boolean equals(Object obj) {
122: boolean equals = true;
123:
124: if (ObjectUtils.isNotNull(obj)
125: && obj instanceof BudgetFringeRate) {
126: BudgetFringeRate objCompare = (BudgetFringeRate) obj;
127: equals &= this .documentNumber.equals(objCompare
128: .getDocumentNumber());
129: equals &= this .institutionAppointmentTypeCode
130: .equals(objCompare
131: .getInstitutionAppointmentTypeCode());
132: if (this .contractsAndGrantsFringeRateAmount == null
133: && objCompare
134: .getContractsAndGrantsFringeRateAmount() == null) {
135: } else {
136: equals &= this .contractsAndGrantsFringeRateAmount != null
137: && objCompare
138: .getContractsAndGrantsFringeRateAmount() != null
139: && this .contractsAndGrantsFringeRateAmount
140: .equals(objCompare
141: .getContractsAndGrantsFringeRateAmount());
142: }
143: if (this .institutionCostShareFringeRateAmount == null
144: && objCompare
145: .getInstitutionCostShareFringeRateAmount() == null) {
146: } else {
147: equals &= this .institutionCostShareFringeRateAmount != null
148: && objCompare
149: .getInstitutionCostShareFringeRateAmount() != null
150: && this .institutionCostShareFringeRateAmount
151: .equals(objCompare
152: .getInstitutionCostShareFringeRateAmount());
153: }
154: }
155:
156: return equals;
157: }
158:
159: /**
160: * @return Returns the budgetLastUpdate.
161: */
162: public Timestamp getBudgetLastUpdateTimestamp() {
163: return budgetLastUpdateTimestamp;
164: }
165:
166: /**
167: * @param budgetLastUpdate The budgetLastUpdate to set.
168: */
169: public void setBudgetLastUpdateTimestamp(
170: Timestamp budgetLastUpdateTimestamp) {
171: this .budgetLastUpdateTimestamp = budgetLastUpdateTimestamp;
172: }
173:
174: /**
175: * @return Returns the documentNumber.
176: */
177: public String getDocumentNumber() {
178: return documentNumber;
179: }
180:
181: /**
182: * @param documentNumber The documentNumber to set.
183: */
184: public void setDocumentNumber(String documentNumber) {
185: this .documentNumber = documentNumber;
186: }
187:
188: /**
189: * @return Returns the contractsAndGrantsFringeRateAmount.
190: */
191: public KualiDecimal getContractsAndGrantsFringeRateAmount() {
192: return contractsAndGrantsFringeRateAmount;
193: }
194:
195: /**
196: * @param contractsAndGrantsFringeRateAmount The contractsAndGrantsFringeRateAmount to set.
197: */
198: public void setContractsAndGrantsFringeRateAmount(
199: KualiDecimal contractsAndGrantsFringeRateAmount) {
200: this .contractsAndGrantsFringeRateAmount = contractsAndGrantsFringeRateAmount;
201: }
202:
203: /**
204: * @return Returns the institutionAppointmentTypeCode.
205: */
206: public String getInstitutionAppointmentTypeCode() {
207: return institutionAppointmentTypeCode;
208: }
209:
210: /**
211: * @param institutionAppointmentTypeCode The institutionAppointmentTypeCode to set.
212: */
213: public void setInstitutionAppointmentTypeCode(
214: String institutionAppointmentTypeCode) {
215: this .institutionAppointmentTypeCode = institutionAppointmentTypeCode;
216: }
217:
218: /**
219: * @return Returns the institutionCostShareFringeRateAmount.
220: */
221: public KualiDecimal getInstitutionCostShareFringeRateAmount() {
222: return institutionCostShareFringeRateAmount;
223: }
224:
225: /**
226: * @param institutionCostShareFringeRateAmount The institutionCostShareFringeRateAmount to set.
227: */
228: public void setInstitutionCostShareFringeRateAmount(
229: KualiDecimal institutionCostShareFringeRateAmount) {
230: this .institutionCostShareFringeRateAmount = institutionCostShareFringeRateAmount;
231: }
232:
233: /**
234: * @return Returns the appointmentType.
235: */
236: public AppointmentType getAppointmentType() {
237: return appointmentType;
238: }
239:
240: /**
241: * @param appointmentType The appointmentType to set.
242: */
243: public void setAppointmentType(AppointmentType appointmentType) {
244: this .appointmentType = appointmentType;
245: }
246:
247: public KualiDecimal getAppointmentTypeFringeRateAmount() {
248: return this .appointmentType.getFringeRateAmount();
249: }
250:
251: public KualiDecimal getAppointmentTypeCostShareFringeRateAmount() {
252: return this.appointmentType.getCostShareFringeRateAmount();
253: }
254: }
|