Example #1
0
  /**
   * Finds and returns the tag with the same name as this section types name.
   *
   * @param sectionType
   * @return
   */
  public Tag getTag(final SectionType sectionType) {
    Tag tag = null;

    // Section Tag
    if (sectionType != null) {
      final TagDao daoTag = new DaoFactory().getTagDao();
      tag = daoTag.findByName(sectionType.getName());
    }
    assert tag != null
        : "Database problem. Tag for SectionType " + sectionType.getName() + " is missing";

    return tag;
  }
Example #2
0
 private boolean isEligible(final SectionType sectionType, final DateTime birthDate) {
   final DateTime startingAge = sectionType.getStartingAge().getBirthDate();
   final DateTime endingAge = sectionType.getEndingAge().getBirthDate();
   return (birthDate.equals(startingAge) || birthDate.isBefore(startingAge))
       && (birthDate.isAfter(endingAge) || birthDate.equals(endingAge));
 }