package net.sourceforge.fenixedu.domain.period; import java.util.ArrayList; import java.util.List; import net.sourceforge.fenixedu.domain.ExecutionInterval; import net.sourceforge.fenixedu.domain.candidacyProcess.CandidacyProcess; abstract public class CandidacyProcessCandidacyPeriod extends CandidacyProcessCandidacyPeriod_Base { protected CandidacyProcessCandidacyPeriod() { super(); } public boolean hasCandidacyProcesses(final Class clazz, final ExecutionInterval executionInterval) { return hasExecutionInterval(executionInterval) && containsCandidacyProcess(clazz); } public boolean hasExecutionInterval(final ExecutionInterval executionInterval) { return getExecutionInterval() == executionInterval; } public boolean containsCandidacyProcess(final Class clazz) { for (final CandidacyProcess process : getCandidacyProcesses()) { if (process.getClass().equals(clazz)) { return true; } } return false; } public List getCandidacyProcesses(final Class clazz) { final List result = new ArrayList(); for (final CandidacyProcess process : getCandidacyProcesses()) { if (process.getClass().equals(clazz)) { result.add(process); } } return result; } }