public MasterDegreeCandidate getMasterDegreeCandidateBySpecializationAndCandidateNumber( Specialization specialization, Integer candidateNumber) { for (final MasterDegreeCandidate masterDegreeCandidate : this.getMasterDegreeCandidatesSet()) { if (masterDegreeCandidate.getSpecialization() == specialization && masterDegreeCandidate.getCandidateNumber().equals(candidateNumber)) { return masterDegreeCandidate; } } return null; }
public Integer generateCandidateNumberForSpecialization(Specialization specialization) { int maxCandidateNumber = 0; for (final MasterDegreeCandidate masterDegreeCandidate : this.getMasterDegreeCandidatesSet()) { if (masterDegreeCandidate.getSpecialization() == specialization && masterDegreeCandidate.getCandidateNumber() != null) { maxCandidateNumber = Math.max(maxCandidateNumber, masterDegreeCandidate.getCandidateNumber()); } } return Integer.valueOf(++maxCandidateNumber); }
public List<CandidateSituation> getCandidateSituationsInSituation( List<SituationName> situationNames) { List<CandidateSituation> result = new ArrayList<CandidateSituation>(); for (MasterDegreeCandidate candidate : getMasterDegreeCandidatesSet()) { for (CandidateSituation situation : candidate.getSituationsSet()) { if (situation.getValidation().getState() == null || situation.getValidation().getState() != State.ACTIVE) { continue; } if (situationNames != null && !situationNames.contains(situation.getSituation())) { continue; } result.add(situation); } } return result; }