package net.sourceforge.fenixedu.dataTransferObject.student; import java.io.Serializable; import net.sourceforge.fenixedu.domain.DomainReference; import net.sourceforge.fenixedu.domain.organizationalStructure.Unit; import net.sourceforge.fenixedu.domain.student.MobilityAgreement; import net.sourceforge.fenixedu.domain.student.MobilityProgram; import net.sourceforge.fenixedu.domain.student.Registration; import org.joda.time.YearMonthDay; import pt.iscte.ci.metadata.ISCTE; @ISCTE(author = "Paulo Zenida") public class MobilityAgreementBean implements Serializable { private static final long serialVersionUID = 1L; private DomainReference mobilityAgreement; private DomainReference registration; private MobilityProgram mobilityProgram; private YearMonthDay startDate; private YearMonthDay endDate; private DomainReference institution; public MobilityAgreementBean(final Registration registration) { setRegistration(registration); } public MobilityAgreementBean(final MobilityAgreement mobilityAgreement) { super(); setMobilityAgreement(mobilityAgreement); setRegistration(mobilityAgreement.getRegistration()); setMobilityProgram(mobilityAgreement.getMobilityProgram()); setStartDate(mobilityAgreement.getStartDate()); setEndDate(mobilityAgreement.getEndDate()); setInstitution(mobilityAgreement.getInstitution()); } public MobilityAgreement getMobilityAgreement() { return mobilityAgreement == null ? null : mobilityAgreement.getObject(); } public void setMobilityAgreement(final MobilityAgreement mobilityAgreement) { this.mobilityAgreement = mobilityAgreement == null ? null : new DomainReference(mobilityAgreement); } public Registration getRegistration() { return registration == null ? null : registration.getObject(); } public void setRegistration(final Registration registration) { this.registration = registration == null ? null : new DomainReference(registration); } /** * @return the mobilityProgram */ public MobilityProgram getMobilityProgram() { return mobilityProgram; } /** * @param mobilityProgram * the mobilityProgram to set */ public void setMobilityProgram(MobilityProgram mobilityProgram) { this.mobilityProgram = mobilityProgram; } /** * @return the startDate */ public YearMonthDay getStartDate() { return startDate; } /** * @param startDate * the startDate to set */ public void setStartDate(YearMonthDay startDate) { this.startDate = startDate; } /** * @return the endDate */ public YearMonthDay getEndDate() { return endDate; } /** * @param endDate * the endDate to set */ public void setEndDate(YearMonthDay endDate) { this.endDate = endDate; } /** * @return the institution */ public Unit getInstitution() { return institution == null ? null : institution.getObject(); } /** * @param institution * the institution to set */ public void setInstitution(Unit institution) { this.institution = institution == null ? null : new DomainReference(institution); } }