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.util.LinkedHashMap;
019:
020: import org.kuali.core.bo.PersistableBusinessObjectBase;
021: import org.kuali.core.util.KualiInteger;
022: import org.kuali.core.util.ObjectUtils;
023: import org.kuali.kfs.KFSPropertyConstants;
024:
025: /**
026: *
027: */
028:
029: public class BudgetNonpersonnel extends PersistableBusinessObjectBase
030: implements Comparable {
031: private static final long serialVersionUID = -7058371220805374107L;
032:
033: private String documentNumber;
034: private Integer budgetTaskSequenceNumber;
035: private Integer budgetPeriodSequenceNumber;
036: private String budgetNonpersonnelCategoryCode;
037: private String budgetNonpersonnelSubCategoryCode;
038: private Integer budgetNonpersonnelSequenceNumber;
039: private String budgetNonpersonnelDescription;
040: private KualiInteger agencyRequestAmount;
041: private KualiInteger budgetThirdPartyCostShareAmount;
042: private KualiInteger budgetInstitutionCostShareAmount;
043: private Integer budgetOriginSequenceNumber;
044: private boolean agencyCopyIndicator;
045: private boolean budgetInstitutionCostShareCopyIndicator;
046: private boolean budgetThirdPartyCostShareCopyIndicator;
047: private KualiInteger budgetOriginAgencyAmount;
048: private KualiInteger budgetOriginInstitutionCostShareAmount;
049: private KualiInteger budgetOriginThirdPartyCostShareAmount;
050: private String subcontractorNumber;
051:
052: private boolean copyToFuturePeriods = false; // Not in database, but field used by Nonpersonnel page.
053:
054: // Following 3 fields are not in database. They are used in order to determine after a page submit if
055: // the indicators for each of those needs to be unchecked (functionally if a user modifies an amount,
056: // the indicator should be dropped).
057: private KualiInteger agencyRequestAmountBackup;
058: private KualiInteger budgetThirdPartyCostShareAmountBackup;
059: private KualiInteger budgetInstitutionCostShareAmountBackup;
060:
061: private NonpersonnelObjectCode nonpersonnelObjectCode;
062:
063: /**
064: * Default no-arg constructor.
065: */
066: public BudgetNonpersonnel() {
067: agencyRequestAmount = new KualiInteger(0);
068: budgetThirdPartyCostShareAmount = new KualiInteger(0);
069: budgetInstitutionCostShareAmount = new KualiInteger(0);
070: }
071:
072: /**
073: * Makes a 1:1 copy of the budgetNonpersonnel passed in.
074: *
075: * @param budgetNonpersonnel to be used to copy source
076: */
077: public BudgetNonpersonnel(BudgetNonpersonnel budgetNonpersonnel) {
078: documentNumber = budgetNonpersonnel.getDocumentNumber();
079: budgetTaskSequenceNumber = budgetNonpersonnel
080: .getBudgetTaskSequenceNumber();
081: budgetPeriodSequenceNumber = budgetNonpersonnel
082: .getBudgetPeriodSequenceNumber();
083: budgetNonpersonnelCategoryCode = budgetNonpersonnel
084: .getBudgetNonpersonnelCategoryCode();
085: budgetNonpersonnelSubCategoryCode = budgetNonpersonnel
086: .getBudgetNonpersonnelSubCategoryCode();
087: budgetNonpersonnelSequenceNumber = budgetNonpersonnel
088: .getBudgetNonpersonnelSequenceNumber();
089: budgetNonpersonnelDescription = budgetNonpersonnel
090: .getBudgetNonpersonnelDescription();
091: agencyRequestAmount = budgetNonpersonnel
092: .getAgencyRequestAmount();
093: budgetThirdPartyCostShareAmount = budgetNonpersonnel
094: .getBudgetThirdPartyCostShareAmount();
095: budgetInstitutionCostShareAmount = budgetNonpersonnel
096: .getBudgetInstitutionCostShareAmount();
097: budgetOriginSequenceNumber = budgetNonpersonnel
098: .getBudgetOriginSequenceNumber();
099: agencyCopyIndicator = budgetNonpersonnel
100: .getAgencyCopyIndicator();
101: budgetInstitutionCostShareCopyIndicator = budgetNonpersonnel
102: .getBudgetInstitutionCostShareCopyIndicator();
103: budgetThirdPartyCostShareCopyIndicator = budgetNonpersonnel
104: .getBudgetThirdPartyCostShareCopyIndicator();
105: budgetOriginAgencyAmount = budgetNonpersonnel
106: .getBudgetOriginAgencyAmount();
107: budgetOriginInstitutionCostShareAmount = budgetNonpersonnel
108: .getBudgetOriginInstitutionCostShareAmount();
109: budgetOriginThirdPartyCostShareAmount = budgetNonpersonnel
110: .getBudgetOriginThirdPartyCostShareAmount();
111: subcontractorNumber = budgetNonpersonnel
112: .getSubcontractorNumber();
113:
114: copyToFuturePeriods = budgetNonpersonnel
115: .getCopyToFuturePeriods();
116:
117: nonpersonnelObjectCode = budgetNonpersonnel
118: .getNonpersonnelObjectCode();
119: }
120:
121: /**
122: * @param budgetTaskSequenceNumber
123: * @param budgetPeriodSequenceNumber
124: * @param budgetNonpersonnelCategoryCode
125: * @param budgetNonpersonnelSubCategoryCode
126: * @param budgetNonpersonnelDescription
127: * @param agencyRequestAmount
128: * @param budgetInstitutionCostShareAmount
129: */
130: public BudgetNonpersonnel(Integer budgetTaskSequenceNumber,
131: Integer budgetPeriodSequenceNumber,
132: String budgetNonpersonnelCategoryCode,
133: String budgetNonpersonnelSubCategoryCode,
134: String budgetNonpersonnelDescription,
135: KualiInteger agencyRequestAmount,
136: KualiInteger budgetInstitutionCostShareAmount) {
137: this ();
138:
139: this .budgetTaskSequenceNumber = budgetTaskSequenceNumber;
140: this .budgetPeriodSequenceNumber = budgetPeriodSequenceNumber;
141: this .budgetNonpersonnelCategoryCode = budgetNonpersonnelCategoryCode;
142: this .budgetNonpersonnelSubCategoryCode = budgetNonpersonnelSubCategoryCode;
143: this .budgetNonpersonnelDescription = budgetNonpersonnelDescription;
144: this .agencyRequestAmount = agencyRequestAmount;
145: this .budgetInstitutionCostShareAmount = budgetInstitutionCostShareAmount;
146: }
147:
148: /**
149: * Determined if this item has already been copied over into other periods. Located in this Business Object because it needs to
150: * be available on the NPRS page (not just on the copy over page).
151: *
152: * @return NPRS copy over origin item.
153: */
154: public boolean isCopiedOverItem() {
155: return budgetOriginSequenceNumber != null;
156: }
157:
158: /**
159: * Determines if this object is an origin item in the term of NPRS copy over. Located in this Business Object because it needs
160: * to be available in BudgetNonpersonnel objects.
161: *
162: * @return NPRS copy over origin item.
163: */
164: public boolean isOriginItem() {
165: boolean result = false;
166:
167: // while the below seems slightly complicated it has to be noted that this
168: // should work on both the copy over page & NPRS page.
169:
170: if (budgetNonpersonnelSequenceNumber == null
171: || budgetNonpersonnelSequenceNumber.intValue() == -1) {
172: // newly copied over may be null or -1 per BoHelper constructor.
173: result = false;
174: } else if (budgetOriginSequenceNumber == null) { // newly added items on NPRS page have no origin number
175: result = true;
176: } else {
177: // origin items have those two values equal per constructor in BudgetNonpersonnelCopyOverBoHelper
178: result = this .getBudgetOriginSequenceNumber().intValue() == this
179: .getBudgetNonpersonnelSequenceNumber().intValue();
180: }
181:
182: return result;
183: }
184:
185: /**
186: * Gets the budgetPeriodSequenceNumber attribute.
187: *
188: * @return Returns the budgetPeriodSequenceNumber.
189: */
190: public Integer getBudgetPeriodSequenceNumber() {
191: return budgetPeriodSequenceNumber;
192: }
193:
194: /**
195: * Sets the budgetPeriodSequenceNumber attribute value.
196: *
197: * @param budgetPeriodSequenceNumber The budgetPeriodSequenceNumber to set.
198: */
199: public void setBudgetPeriodSequenceNumber(
200: Integer budgetPeriodSequenceNumber) {
201: this .budgetPeriodSequenceNumber = budgetPeriodSequenceNumber;
202: }
203:
204: /**
205: * Gets the budgetTaskSequenceNumber attribute.
206: *
207: * @return Returns the budgetTaskSequenceNumber.
208: */
209: public Integer getBudgetTaskSequenceNumber() {
210: return budgetTaskSequenceNumber;
211: }
212:
213: /**
214: * Sets the budgetTaskSequenceNumber attribute value.
215: *
216: * @param budgetTaskSequenceNumber The budgetTaskSequenceNumber to set.
217: */
218: public void setBudgetTaskSequenceNumber(
219: Integer budgetTaskSequenceNumber) {
220: this .budgetTaskSequenceNumber = budgetTaskSequenceNumber;
221: }
222:
223: /**
224: * Gets the documentNumber attribute.
225: *
226: * @return Returns the documentNumber.
227: */
228: public String getDocumentNumber() {
229: return documentNumber;
230: }
231:
232: /**
233: * Sets the documentNumber attribute value.
234: *
235: * @param documentNumber The documentNumber to set.
236: */
237: public void setDocumentNumber(String documentNumber) {
238: this .documentNumber = documentNumber;
239: }
240:
241: /**
242: * o
243: */
244: public void setBudgetNonpersonnelSequenceNumber(Integer o) {
245: budgetNonpersonnelSequenceNumber = o;
246: }
247:
248: /**
249: * budgetNonpersonnelSequenceNumber
250: */
251: public Integer getBudgetNonpersonnelSequenceNumber() {
252: return budgetNonpersonnelSequenceNumber;
253: }
254:
255: /**
256: * o
257: */
258: public void setBudgetNonpersonnelDescription(String o) {
259: budgetNonpersonnelDescription = o;
260: }
261:
262: /**
263: * budgetNonpersonnelDescription
264: */
265: public String getBudgetNonpersonnelDescription() {
266: return budgetNonpersonnelDescription;
267: }
268:
269: /**
270: * Gets the agencyRequestAmount attribute.
271: *
272: * @return Returns the agencyRequestAmount.
273: */
274: public KualiInteger getAgencyRequestAmount() {
275: return agencyRequestAmount;
276: }
277:
278: /**
279: * Sets the agencyRequestAmount attribute value.
280: *
281: * @param agencyRequestAmount The agencyRequestAmount to set.
282: */
283: public void setAgencyRequestAmount(KualiInteger agencyRequestAmount) {
284: this .agencyRequestAmount = agencyRequestAmount;
285: }
286:
287: /**
288: * Gets the budgetThirdPartyCostShareAmount attribute.
289: *
290: * @return Returns the budgetThirdPartyCostShareAmount.
291: */
292: public KualiInteger getBudgetThirdPartyCostShareAmount() {
293: return budgetThirdPartyCostShareAmount;
294: }
295:
296: /**
297: * Sets the budgetThirdPartyCostShareAmount attribute value.
298: *
299: * @param budgetThirdPartyCostShareAmount The budgetThirdPartyCostShareAmount to set.
300: */
301: public void setBudgetThirdPartyCostShareAmount(
302: KualiInteger budgetThirdPartyCostShareAmount) {
303: this .budgetThirdPartyCostShareAmount = budgetThirdPartyCostShareAmount;
304: }
305:
306: /**
307: * Gets the budgetInstitutionCostShareAmount attribute.
308: *
309: * @return Returns the budgetInstitutionCostShareAmount.
310: */
311: public KualiInteger getBudgetInstitutionCostShareAmount() {
312: return budgetInstitutionCostShareAmount;
313: }
314:
315: /**
316: * Sets the budgetInstitutionCostShareAmount attribute value.
317: *
318: * @param budgetInstitutionCostShareAmount The budgetInstitutionCostShareAmount to set.
319: */
320: public void setBudgetInstitutionCostShareAmount(
321: KualiInteger budgetInstitutionCostShareAmount) {
322: this .budgetInstitutionCostShareAmount = budgetInstitutionCostShareAmount;
323: }
324:
325: /**
326: * o
327: */
328: public void setBudgetOriginSequenceNumber(Integer o) {
329: budgetOriginSequenceNumber = o;
330: }
331:
332: /**
333: * budgetOriginSequenceNumber
334: */
335: public Integer getBudgetOriginSequenceNumber() {
336: return budgetOriginSequenceNumber;
337: }
338:
339: /**
340: * o
341: */
342: public void setAgencyCopyIndicator(boolean o) {
343: agencyCopyIndicator = o;
344: }
345:
346: /**
347: * agencyCopyIndicator
348: */
349: public boolean getAgencyCopyIndicator() {
350: return agencyCopyIndicator;
351: }
352:
353: /**
354: * o
355: */
356: public void setBudgetInstitutionCostShareCopyIndicator(boolean o) {
357: budgetInstitutionCostShareCopyIndicator = o;
358: }
359:
360: /**
361: * budgetInstitutionCostShareCopyIndicator
362: */
363: public boolean getBudgetInstitutionCostShareCopyIndicator() {
364: return budgetInstitutionCostShareCopyIndicator;
365: }
366:
367: /**
368: * o
369: */
370: public void setBudgetThirdPartyCostShareCopyIndicator(boolean o) {
371: budgetThirdPartyCostShareCopyIndicator = o;
372: }
373:
374: /**
375: * budgetThirdPartyCostShareCopyIndicator
376: */
377: public boolean getBudgetThirdPartyCostShareCopyIndicator() {
378: return budgetThirdPartyCostShareCopyIndicator;
379: }
380:
381: /**
382: * o
383: */
384: public void setBudgetOriginAgencyAmount(KualiInteger o) {
385: budgetOriginAgencyAmount = o;
386: }
387:
388: /**
389: * budgetOriginAgencyAmount
390: */
391: public KualiInteger getBudgetOriginAgencyAmount() {
392: return budgetOriginAgencyAmount;
393: }
394:
395: /**
396: * o
397: */
398: public void setBudgetOriginInstitutionCostShareAmount(KualiInteger o) {
399: budgetOriginInstitutionCostShareAmount = o;
400: }
401:
402: /**
403: * budgetOriginInstitutionCostShareAmount
404: */
405: public KualiInteger getBudgetOriginInstitutionCostShareAmount() {
406: return budgetOriginInstitutionCostShareAmount;
407: }
408:
409: /**
410: * o
411: */
412: public void setBudgetOriginThirdPartyCostShareAmount(KualiInteger o) {
413: budgetOriginThirdPartyCostShareAmount = o;
414: }
415:
416: /**
417: * budgetOriginThirdPartyCostShareAmount
418: */
419: public KualiInteger getBudgetOriginThirdPartyCostShareAmount() {
420: return budgetOriginThirdPartyCostShareAmount;
421: }
422:
423: /**
424: * o
425: */
426: public void setNonpersonnelObjectCode(NonpersonnelObjectCode o) {
427: nonpersonnelObjectCode = o;
428: }
429:
430: /**
431: * nonpersonnelObjectCode
432: */
433: public NonpersonnelObjectCode getNonpersonnelObjectCode() {
434: return nonpersonnelObjectCode;
435: }
436:
437: /**
438: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
439: */
440: protected LinkedHashMap toStringMapper() {
441: LinkedHashMap m = new LinkedHashMap();
442:
443: m
444: .put(KFSPropertyConstants.DOCUMENT_NUMBER,
445: this .documentNumber);
446: m
447: .put("budgetTaskSequenceNumber",
448: this .budgetTaskSequenceNumber);
449: m.put("budgetPeriodSequenceNumber",
450: this .budgetPeriodSequenceNumber);
451: m.put("budgetNonpersonnelCategoryCode",
452: this .budgetNonpersonnelCategoryCode);
453: m.put("budgetNonpersonnelSequenceNumber",
454: this .budgetNonpersonnelSequenceNumber);
455: m.put("budgetNonpersonnelSubCategoryCode",
456: this .budgetNonpersonnelSubCategoryCode);
457: return m;
458:
459: }
460:
461: /**
462: * Gets the budgetNonpersonnelCategoryCode attribute.
463: *
464: * @return Returns the budgetNonpersonnelCategoryCode.
465: */
466: public String getBudgetNonpersonnelCategoryCode() {
467: return budgetNonpersonnelCategoryCode;
468: }
469:
470: /**
471: * Sets the budgetNonpersonnelCategoryCode attribute value.
472: *
473: * @param budgetNonpersonnelCategoryCode The budgetNonpersonnelCategoryCode to set.
474: */
475: public void setBudgetNonpersonnelCategoryCode(
476: String budgetNonpersonnelCategoryCode) {
477: this .budgetNonpersonnelCategoryCode = budgetNonpersonnelCategoryCode;
478: }
479:
480: /**
481: * Gets the budgetNonpersonnelSubCategoryCode attribute.
482: *
483: * @return Returns the budgetNonpersonnelSubCategoryCode.
484: */
485: public String getBudgetNonpersonnelSubCategoryCode() {
486: return budgetNonpersonnelSubCategoryCode;
487: }
488:
489: /**
490: * Sets the budgetNonpersonnelSubCategoryCode attribute value.
491: *
492: * @param budgetNonpersonnelSubCategoryCode The budgetNonpersonnelSubCategoryCode to set.
493: */
494: public void setBudgetNonpersonnelSubCategoryCode(
495: String budgetNonpersonnelSubCategoryCode) {
496: this .budgetNonpersonnelSubCategoryCode = budgetNonpersonnelSubCategoryCode;
497: }
498:
499: /**
500: * Gets the subcontractorNumber attribute.
501: *
502: * @return Returns the subcontractorNumber.
503: */
504: public String getSubcontractorNumber() {
505: return subcontractorNumber;
506: }
507:
508: /**
509: * Sets the subcontractorNumber attribute value.
510: *
511: * @param subcontractorNumber The subcontractorNumber to set.
512: */
513: public void setSubcontractorNumber(String subcontractorNumber) {
514: this .subcontractorNumber = subcontractorNumber;
515: }
516:
517: /**
518: * Gets the copyToFuturePeriods attribute.
519: *
520: * @return Returns the copyToFuturePeriods.
521: */
522: public boolean getCopyToFuturePeriods() {
523: return copyToFuturePeriods;
524: }
525:
526: /**
527: * Sets the copyToFuturePeriods attribute value.
528: *
529: * @param copyToFuturePeriods The copyToFuturePeriods to set.
530: */
531: public void setCopyToFuturePeriods(boolean copyToFuturePeriods) {
532: this .copyToFuturePeriods = copyToFuturePeriods;
533: }
534:
535: /**
536: * Gets the agencyRequestAmountBackup attribute.
537: *
538: * @return Returns the agencyRequestAmountBackup.
539: */
540: public KualiInteger getAgencyRequestAmountBackup() {
541: return agencyRequestAmountBackup;
542: }
543:
544: /**
545: * Sets the agencyRequestAmountBackup attribute value.
546: *
547: * @param agencyRequestAmountBackup The agencyRequestAmountBackup to set.
548: */
549: public void setAgencyRequestAmountBackup(
550: KualiInteger agencyRequestAmountDuplicate) {
551: this .agencyRequestAmountBackup = agencyRequestAmountDuplicate;
552: }
553:
554: /**
555: * Gets the budgetThirdPartyCostShareAmountBackup attribute.
556: *
557: * @return Returns the budgetThirdPartyCostShareAmountBackup.
558: */
559: public KualiInteger getBudgetThirdPartyCostShareAmountBackup() {
560: return budgetThirdPartyCostShareAmountBackup;
561: }
562:
563: /**
564: * Sets the budgetThirdPartyCostShareAmountBackup attribute value.
565: *
566: * @param budgetThirdPartyCostShareAmountBackup The budgetThirdPartyCostShareAmountBackup to set.
567: */
568: public void setBudgetThirdPartyCostShareAmountBackup(
569: KualiInteger budgetThirdPartyCostShareAmountDuplicate) {
570: this .budgetThirdPartyCostShareAmountBackup = budgetThirdPartyCostShareAmountDuplicate;
571: }
572:
573: /**
574: * Gets the budgetInstitutionCostShareAmountBackup attribute.
575: *
576: * @return Returns the budgetInstitutionCostShareAmountBackup.
577: */
578: public KualiInteger getBudgetInstitutionCostShareAmountBackup() {
579: return budgetInstitutionCostShareAmountBackup;
580: }
581:
582: /**
583: * Sets the budgetInstitutionCostShareAmountBackup attribute value.
584: *
585: * @param budgetInstitutionCostShareAmountBackup The budgetInstitutionCostShareAmountBackup to set.
586: */
587: public void setBudgetInstitutionCostShareAmountBackup(
588: KualiInteger budgetInstitutionCostShareAmountDuplicate) {
589: this .budgetInstitutionCostShareAmountBackup = budgetInstitutionCostShareAmountDuplicate;
590: }
591:
592: /**
593: * @see java.lang.Comparable#compareTo(java.lang.Object)
594: */
595: public int compareTo(Object o) {
596: BudgetNonpersonnel budgetNonpersonnel = (BudgetNonpersonnel) o;
597: return this .budgetNonpersonnelSequenceNumber
598: .compareTo(budgetNonpersonnel
599: .getBudgetNonpersonnelSequenceNumber());
600: }
601:
602: /**
603: * @see java.lang.Object#equals(java.lang.Object)
604: */
605: public boolean equals(Object obj) {
606: boolean equals = true;
607:
608: if (ObjectUtils.isNotNull(obj)
609: && obj instanceof BudgetNonpersonnel) {
610: BudgetNonpersonnel objCompare = (BudgetNonpersonnel) obj;
611: equals &= this .documentNumber.equals(objCompare
612: .getDocumentNumber());
613: equals &= this .agencyCopyIndicator == objCompare
614: .getAgencyCopyIndicator();
615: equals &= this .budgetThirdPartyCostShareCopyIndicator == objCompare
616: .getBudgetThirdPartyCostShareCopyIndicator();
617: equals &= this .budgetInstitutionCostShareCopyIndicator == objCompare
618: .getBudgetInstitutionCostShareCopyIndicator();
619:
620: if (this .agencyRequestAmount == null
621: && objCompare.getAgencyRequestAmount() == null) {
622: } else {
623: equals &= this .agencyRequestAmount != null
624: && objCompare.getAgencyRequestAmount() != null
625: && this .agencyRequestAmount.equals(objCompare
626: .getAgencyRequestAmount());
627: }
628: if (this .budgetNonpersonnelCategoryCode == null
629: && objCompare.getBudgetNonpersonnelCategoryCode() == null) {
630: } else {
631: equals &= this .budgetNonpersonnelCategoryCode != null
632: && objCompare
633: .getBudgetNonpersonnelCategoryCode() != null
634: && this .budgetNonpersonnelCategoryCode
635: .equals(objCompare
636: .getBudgetNonpersonnelCategoryCode());
637: }
638: if (this .budgetNonpersonnelDescription == null
639: && objCompare.getBudgetNonpersonnelDescription() == null) {
640: } else {
641: equals &= this .budgetNonpersonnelDescription != null
642: && objCompare
643: .getBudgetNonpersonnelDescription() != null
644: && this .budgetNonpersonnelDescription
645: .equals(objCompare
646: .getBudgetNonpersonnelDescription());
647: }
648: if (this .budgetNonpersonnelSequenceNumber == null
649: && objCompare.getBudgetNonpersonnelSequenceNumber() == null) {
650: } else {
651: equals &= this .budgetNonpersonnelSequenceNumber != null
652: && objCompare
653: .getBudgetNonpersonnelSequenceNumber() != null
654: && this .budgetNonpersonnelSequenceNumber
655: .equals(objCompare
656: .getBudgetNonpersonnelSequenceNumber());
657: }
658: if (this .budgetNonpersonnelSubCategoryCode == null
659: && objCompare
660: .getBudgetNonpersonnelSubCategoryCode() == null) {
661: } else {
662: equals &= this .budgetNonpersonnelSubCategoryCode != null
663: && objCompare
664: .getBudgetNonpersonnelSubCategoryCode() != null
665: && this .budgetNonpersonnelSubCategoryCode
666: .equals(objCompare
667: .getBudgetNonpersonnelSubCategoryCode());
668: }
669: if (this .budgetOriginAgencyAmount == null
670: && objCompare.getBudgetOriginAgencyAmount() == null) {
671: } else {
672: equals &= this .budgetOriginAgencyAmount != null
673: && objCompare.getBudgetOriginAgencyAmount() != null
674: && this .budgetOriginAgencyAmount
675: .equals(objCompare
676: .getBudgetOriginAgencyAmount());
677: }
678: if (this .budgetOriginSequenceNumber == null
679: && objCompare.getBudgetOriginSequenceNumber() == null) {
680: } else {
681: equals &= this .budgetOriginSequenceNumber != null
682: && objCompare.getBudgetOriginSequenceNumber() != null
683: && this .budgetOriginSequenceNumber
684: .equals(objCompare
685: .getBudgetOriginSequenceNumber());
686: }
687: if (this .budgetOriginThirdPartyCostShareAmount == null
688: && objCompare
689: .getBudgetOriginThirdPartyCostShareAmount() == null) {
690: } else {
691: equals &= this .budgetOriginThirdPartyCostShareAmount != null
692: && objCompare
693: .getBudgetOriginThirdPartyCostShareAmount() != null
694: && this .budgetOriginThirdPartyCostShareAmount
695: .equals(objCompare
696: .getBudgetOriginThirdPartyCostShareAmount());
697: }
698: if (this .budgetOriginInstitutionCostShareAmount == null
699: && objCompare
700: .getBudgetOriginInstitutionCostShareAmount() == null) {
701: } else {
702: equals &= this .budgetOriginInstitutionCostShareAmount != null
703: && objCompare
704: .getBudgetOriginInstitutionCostShareAmount() != null
705: && this .budgetOriginInstitutionCostShareAmount
706: .equals(objCompare
707: .getBudgetOriginInstitutionCostShareAmount());
708: }
709: if (this .budgetPeriodSequenceNumber == null
710: && objCompare.getBudgetPeriodSequenceNumber() == null) {
711: } else {
712: equals &= this .budgetPeriodSequenceNumber != null
713: && objCompare.getBudgetPeriodSequenceNumber() != null
714: && this .budgetPeriodSequenceNumber
715: .equals(objCompare
716: .getBudgetPeriodSequenceNumber());
717: }
718: if (ObjectUtils.isNull(this .budgetTaskSequenceNumber)
719: && ObjectUtils.isNull(objCompare
720: .getBudgetTaskSequenceNumber())) {
721: } else {
722: equals &= ObjectUtils
723: .isNotNull(this .budgetTaskSequenceNumber)
724: && ObjectUtils.isNotNull(objCompare
725: .getBudgetTaskSequenceNumber())
726: && this .budgetTaskSequenceNumber
727: .equals(objCompare
728: .getBudgetTaskSequenceNumber());
729: }
730: if (this .budgetThirdPartyCostShareAmount == null
731: && objCompare.getBudgetThirdPartyCostShareAmount() == null) {
732: } else {
733: equals &= this .budgetThirdPartyCostShareAmount != null
734: && objCompare
735: .getBudgetThirdPartyCostShareAmount() != null
736: && this .budgetThirdPartyCostShareAmount
737: .equals(objCompare
738: .getBudgetThirdPartyCostShareAmount());
739: }
740: if (this .budgetInstitutionCostShareAmount == null
741: && objCompare.getBudgetInstitutionCostShareAmount() == null) {
742: } else {
743: equals &= this .budgetInstitutionCostShareAmount != null
744: && objCompare
745: .getBudgetInstitutionCostShareAmount() != null
746: && this .budgetInstitutionCostShareAmount
747: .equals(objCompare
748: .getBudgetInstitutionCostShareAmount());
749: }
750: if (this .subcontractorNumber == null
751: && objCompare.getSubcontractorNumber() == null) {
752: } else {
753: equals &= this .subcontractorNumber != null
754: && objCompare.getSubcontractorNumber() != null
755: && this .subcontractorNumber.equals(objCompare
756: .getSubcontractorNumber());
757: }
758: } else {
759: return false;
760: }
761:
762: return equals;
763: }
764:
765: /**
766: * @see java.lang.Object#hashCode()
767: */
768: public int hashCode() {
769: String hashString = this .getDocumentNumber()
770: + "|"
771: + this .getBudgetNonpersonnelCategoryCode()
772: + "|"
773: + this .getBudgetNonpersonnelDescription()
774: + "|"
775: + this .getBudgetNonpersonnelSubCategoryCode()
776: + "|"
777: + this .getDocumentNumber()
778: + "|"
779: + this .getSubcontractorNumber()
780: + "|"
781: + this .getAgencyRequestAmount().toString()
782: + "|"
783: + this .getAgencyRequestAmountBackup().toString()
784: + "|"
785: + this .getBudgetNonpersonnelSequenceNumber().toString()
786: + "|"
787: + this .getBudgetOriginAgencyAmount().toString()
788: + "|"
789: + this .getBudgetPeriodSequenceNumber().toString()
790: + "|"
791: + this .getBudgetTaskSequenceNumber().toString()
792: + "|"
793: + this .getBudgetOriginSequenceNumber().toString()
794: + "|"
795: + this .getBudgetOriginThirdPartyCostShareAmount()
796: .toString()
797: + "|"
798: + this .getBudgetOriginInstitutionCostShareAmount()
799: .toString()
800: + "|"
801: + this .getBudgetInstitutionCostShareAmountBackup()
802: .toString() + "|"
803: + this.getNonpersonnelObjectCode().toString();
804: return hashString.hashCode();
805: }
806: }
|