package net.sourceforge.fenixedu.domain; import pt.utl.ist.fenix.tools.util.i18n.Language; import pt.utl.ist.fenix.tools.util.i18n.MultiLanguageString; import net.sourceforge.fenixedu.domain.exceptions.DomainException; /** * * @author bogas * */ public class ExecutionDegreeExternalInformation extends ExecutionDegreeExternalInformation_Base { public ExecutionDegreeExternalInformation(final Language language, final String name, final String url, final ExecutionDegree executionDegree) { super(); init(language, name, url, executionDegree); } public ExecutionDegreeExternalInformation(final String name, final String url, final ExecutionDegree executionDegree) { this(Language.pt, name, url, executionDegree); } private void init(Language language, String name, String url, ExecutionDegree executionDegree) { checkParameters(language, name, url, executionDegree); setRootDomainObject(RootDomainObject.getInstance()); setName(new MultiLanguageString(language, name)); setUrl(url); setExecutionDegree(executionDegree); } private void checkParameters(Language language, String name, String url, ExecutionDegree executionDegree) { if (language == null) { throw new DomainException( "error.ExecutionDegreeExternalInformation.java.language.cannot.be.null"); } if (name == null) { throw new DomainException( "error.ExecutionDegreeExternalInformation.java.name.cannot.be.null"); } if (url == null) { throw new DomainException("error.ExecutionDegreeExternalInformation.java.url.cannot.be.null"); } if (executionDegree == null) { throw new DomainException( "error.ExecutionDegreeExternalInformation.java.executionDegree.cannot.be.null"); } } }