@Atomic public void apply(final OutboundMobilityCandidacyContest contest) { for (final OutboundMobilityCandidacy candidacy : getOutboundMobilityCandidacySet()) { if (candidacy.getOutboundMobilityCandidacyContest() == contest) { return; } } new OutboundMobilityCandidacy(contest, this); }
public boolean hasContestInGroup(final OutboundMobilityCandidacyContestGroup mobilityGroup) { for (final OutboundMobilityCandidacy candidacy : getOutboundMobilityCandidacySet()) { final OutboundMobilityCandidacyContest contest = candidacy.getOutboundMobilityCandidacyContest(); if (contest.getOutboundMobilityCandidacyContestGroup() == mobilityGroup) { return true; } } return false; }
public void select() { if (!hasSelectedCandidacy()) { for (final OutboundMobilityCandidacy candidacy : getSortedOutboundMobilityCandidacySet()) { if (candidacy.getOutboundMobilityCandidacyContest().hasVacancy()) { candidacy.select(); return; } } } }
public SortedSet<OutboundMobilityCandidacyContestGroup> getOutboundMobilityCandidacyContestGroupSet() { final SortedSet<OutboundMobilityCandidacyContestGroup> result = new TreeSet<OutboundMobilityCandidacyContestGroup>(); for (final OutboundMobilityCandidacy candidacy : getOutboundMobilityCandidacySet()) { final OutboundMobilityCandidacyContest contest = candidacy.getOutboundMobilityCandidacyContest(); result.add(contest.getOutboundMobilityCandidacyContestGroup()); } return result; }
public boolean hasCandidacy(final Student student) { for (final Registration registration : student.getRegistrationsSet()) { for (final OutboundMobilityCandidacySubmission submission : registration.getOutboundMobilityCandidacySubmissionSet()) { for (final OutboundMobilityCandidacy candidacy : submission.getOutboundMobilityCandidacySet()) { if (candidacy.getOutboundMobilityCandidacyContest() == this) { return true; } } } } return false; }