Beispiel #1
0
 public static Set<Candidacy> readCandidaciesBetween(final Integer from, final Integer to) {
   final Set<Candidacy> result = new HashSet<Candidacy>();
   for (final Candidacy candidacy : Bennu.getInstance().getCandidaciesSet()) {
     if (candidacy.getNumber() >= from && candidacy.getNumber() <= to) {
       result.add(candidacy);
     }
   }
   return result;
 }
Beispiel #2
0
 public static Candidacy readByCandidacyNumber(Integer candidacyNumber) {
   for (Candidacy candidacy : Bennu.getInstance().getCandidaciesSet()) {
     if (candidacy.getNumber().equals(candidacyNumber)) {
       return candidacy;
     }
   }
   return null;
 }
Beispiel #3
0
 public final Integer createCandidacyNumber() {
   if (Bennu.getInstance().getCandidaciesSet().size() == 0) {
     return Integer.valueOf(1);
   }
   Candidacy candidacy =
       Collections.max(Bennu.getInstance().getCandidaciesSet(), new BeanComparator("number"));
   return candidacy.getNumber() + 1;
 }