package net.sourceforge.fenixedu.domain.contacts; import net.sourceforge.fenixedu.domain.exceptions.DomainException; import net.sourceforge.fenixedu.domain.organizationalStructure.Party; import org.apache.commons.lang.StringUtils; public class Fax extends Fax_Base { protected Fax() { super(); } protected Fax(final Party party, final PartyContactType type, final boolean visible, final boolean defaultContact) { this(); super.init(party, type, visible, defaultContact); } public Fax(final Party party, final PartyContactType type, final Boolean defaultContact, final String number) { this(party, type, true, defaultContact, number); } public Fax(final Party party, final PartyContactType type, final boolean visible, final boolean defaultContact, final String number) { this(); super.init(party, type, visible, defaultContact); checkParameters(number); super.setNumber(number); } private void checkParameters(final String number) { if (StringUtils.isEmpty(number)) { throw new DomainException("error.contacts.Fax.invalid.number"); } } @Override public boolean isFax() { return true; } public void edit(final String number) { if (number != null) { super.setNumber(number); invalidate(); } } public void edit(final PartyContactType type, final Boolean defaultContact, final String number) { super.edit(type, true, defaultContact); edit(number); } }