package net.sourceforge.fenixedu.dataTransferObject.degreeAdministrativeOffice.gradeSubmission; import java.io.Serializable; import java.util.Comparator; import net.sourceforge.fenixedu.domain.CurricularCourse; import net.sourceforge.fenixedu.domain.DomainReference; import net.sourceforge.fenixedu.domain.ExecutionPeriod; public class CurricularCourseMarksheetManagementBean implements Serializable { static final public Comparator COMPARATOR_BY_NAME = new Comparator() { public int compare(CurricularCourseMarksheetManagementBean o1, CurricularCourseMarksheetManagementBean o2) { return o1.getName().compareTo(o2.getName()); } }; private DomainReference curricularCourse; private DomainReference executionPeriod; public CurricularCourseMarksheetManagementBean(final CurricularCourse curricularCourse, final ExecutionPeriod executionPeriod) { setCurricularCourse(curricularCourse); setExecutionPeriod(executionPeriod); } public CurricularCourse getCurricularCourse() { return (this.curricularCourse != null) ? this.curricularCourse.getObject() : null; } public void setCurricularCourse(CurricularCourse curricularCourse) { this.curricularCourse = (curricularCourse != null) ? new DomainReference(curricularCourse) : null; } public ExecutionPeriod getExecutionPeriod() { return (this.executionPeriod != null) ? this.executionPeriod.getObject() : null; } public void setExecutionPeriod(ExecutionPeriod attribute) { this.executionPeriod = (attribute != null) ? new DomainReference(attribute) : null; } public String getKey() { return String.valueOf(getCurricularCourse().getOID() + ":" + getExecutionPeriod().getOID()); } public String getName() { return getCurricularCourse().getName(getExecutionPeriod()); } public String getCode() { return getCurricularCourse().getCode(getExecutionPeriod()); } @Override public boolean equals(Object obj) { if (obj instanceof CurricularCourseMarksheetManagementBean) { return getCurricularCourse().equals(((CurricularCourseMarksheetManagementBean) obj).getCurricularCourse()); } return false; } }