Exemple #1
0
  public CandidacySituation nextState(String nextState) {
    CandidacySituationType situationType = CandidacySituationType.valueOf(nextState);

    if (!situationType.equals(this.getActiveCandidacySituation().getCandidacySituationType())
        && getValidNextStates().contains(nextState)) {

      switch (situationType) {
        case CANCELLED:
          return new CancelledCandidacySituation(this);
        case PRE_CANDIDACY:
          return new PreCandidacySituation(this);
        case STAND_BY:
          return new StandByCandidacySituation(this);
        case STAND_BY_CONFIRMED_DATA:
          return new StandByConfirmedDataCandidacySituation(this);
        case STAND_BY_FILLED_DATA:
          return new StandByFilledDataCandidacySituation(this);
        case REGISTERED:
          return new RegisteredCandidacySituation(this);
        case ADMITTED:
          return new AdmittedCandidacySituation(this);
        case NOT_ADMITTED:
          return new NotAdmittedCandidacySituation(this);
        case SUBSTITUTE:
          return new SubstituteCandidacySituation(this);
        default:
          break;
      }
    }
    return null;
  }
Exemple #2
0
 public boolean isActive() {
   final CandidacySituationType situationType = getActiveCandidacySituationType();
   return situationType != null && situationType.isActive();
 }
Exemple #3
0
 private boolean isCancelling(final String nextState) {
   return CandidacySituationType.valueOf(nextState) == CandidacySituationType.CANCELLED;
 }