示例#1
0
 /**
  * This method tests if there is an Award Sponsor Term with Sponsor Term Type Code that is equal
  * to the parameter "key".
  *
  * @param key
  * @param awardSponsorTerms
  * @return
  */
 protected boolean isSponsorTermTypeInAwardSponsorTerms(
     String key, List<AwardSponsorTerm> awardSponsorTerms) {
   boolean valid = false;
   for (AwardSponsorTerm awardSponsorTerm : awardSponsorTerms) {
     if (awardSponsorTerm.getSponsorTermTypeCode().equals(key)) {
       valid = true;
       break;
     }
   }
   return valid;
 }
  /**
   * Test source and destination for equality in AwardCostShare.
   *
   * @param AwardCostShare, MessageMap
   * @return Boolean
   */
  boolean validateAwardSponsorTermNotDuplicate(
      AwardSponsorTerm awardSponsorTerm, List<AwardSponsorTerm> awardSponsorTerms) {
    boolean valid = true;

    for (AwardSponsorTerm tempAwardSponsorTerm : awardSponsorTerms) {
      if (awardSponsorTerm.getSponsorTermId().equals(tempAwardSponsorTerm.getSponsorTermId())) {
        valid = false;
        reportError(
            NEW_AWARD_SPONSOR_TERM
                + awardSponsorTerm.getSponsorTerm().getSponsorTermTypeCode()
                + Constants.RIGHT_SQUARE_BRACKET,
            KeyConstants.ERROR_DUPLICATE_SPONSOR_TERM);
      }
    }
    return valid;
  }