package net.sourceforge.fenixedu.domain.curricularRules; import java.util.Collections; import java.util.List; import net.sourceforge.fenixedu.dataTransferObject.GenericPair; import net.sourceforge.fenixedu.domain.Enrolment; import net.sourceforge.fenixedu.domain.ExecutionSemester; import net.sourceforge.fenixedu.domain.curricularRules.executors.verifyExecutors.VerifyRuleExecutor; import net.sourceforge.fenixedu.domain.degreeStructure.CourseGroup; import net.sourceforge.fenixedu.domain.degreeStructure.DegreeModule; import net.sourceforge.fenixedu.domain.exceptions.DomainException; import com.linkare.commons.metainfo.Linkare; @Linkare(author = "Paulo Zenida") public class EnrolmentInSpecialSituationEvaluation extends CurricularRuleNotPersistent { private Enrolment toApply; public EnrolmentInSpecialSituationEvaluation(final Enrolment enrolment) { if (enrolment == null) { throw new DomainException("curricular.rule.invalid.parameters"); } else { this.toApply = enrolment; } } public List> getLabel() { return Collections.singletonList(new GenericPair("label.enrolmentInSpecialSituationEvaluation", true)); } public Enrolment getEnrolment() { return toApply; } public DegreeModule getDegreeModuleToApplyRule() { return getEnrolment().getDegreeModule(); } public CourseGroup getContextCourseGroup() { return null; } public CompositeRule getParentCompositeRule() { return null; } public CurricularRuleType getCurricularRuleType() { return CurricularRuleType.ENROLMENT_IN_SPECIAL_SITUATION_EVALUATION; } public ExecutionSemester getBegin() { return ExecutionSemester.readActualExecutionSemester(); } public ExecutionSemester getEnd() { return null; } @Override public boolean equals(Object obj) { if (obj instanceof EnrolmentInSpecialSituationEvaluation) { EnrolmentInSpecialSituationEvaluation enrolmentInSpecialSituationEvaluation = (EnrolmentInSpecialSituationEvaluation) obj; return toApply == enrolmentInSpecialSituationEvaluation.getEnrolment(); } return false; } public VerifyRuleExecutor createVerifyRuleExecutor() { return VerifyRuleExecutor.NULL_VERIFY_EXECUTOR; } }