this.adminContactController.copyContactToController(this.getContact());
}
+ @Override
+ public void copyFaxNumberToController () {
+ // Validate fax instance
+ if (this.getFaxNumber() == null) {
+ // Throw NPE
+ throw new NullPointerException("this.faxNumber is null");
+ } else if (this.getFaxNumber().getPhoneId() == null) {
+ // Throw again
+ throw new NullPointerException("this.faxNumber.phoneId is null");
+ } else if (this.getFaxNumber().getPhoneId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneId={0} is not valid", this.getFaxNumber().getPhoneId()));
+ } else if (this.getFaxNumber().getPhoneAreaCode()== null) {
+ // Throw again
+ throw new NullPointerException("this.faxNumber.phoneAreaCode is null");
+ } else if (this.getFaxNumber().getPhoneAreaCode() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneAreaCode={0} is not valid", this.getFaxNumber().getPhoneAreaCode()));
+ } else if (this.getFaxNumber().getPhoneCountry() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.faxNumber.phoneCountry is null");
+ } else if (this.getFaxNumber().getPhoneCountry().getCountryId() == null) {
+ // ... throw again
+ throw new NullPointerException("this.faxNumber.phoneCountry.countryId is null");
+ } else if (this.getFaxNumber().getPhoneCountry().getCountryId() < 1) {
+ // Invalid id
+ throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneCountry.countryId={0} is invalid", this.getFaxNumber().getPhoneCountry().getCountryId()));
+ } else if (this.getFaxNumber().getPhoneNumber() == null) {
+ // Throw NPE again ...
+ throw new NullPointerException("this.faxNumber.phoneNumber is null");
+ } else if (this.getFaxNumber().getPhoneNumber() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneNumber={0} is not valid", this.getFaxNumber().getPhoneNumber()));
+ }
+
+ // Copy all (changeable) data fields to admin controller
+ this.adminPhoneController.setPhoneCountry(this.getFaxNumber().getPhoneCountry());
+ this.adminPhoneController.setPhoneNumber(this.getFaxNumber().getPhoneNumber());
+ }
+
+ @Override
+ public void copyLandLineNumberToController () {
+ // Validate land-line instance
+ if (this.getLandLineNumber() == null) {
+ // Throw NPE
+ throw new NullPointerException("this.landLineNumber is null");
+ } else if (this.getLandLineNumber().getPhoneId() == null) {
+ // Throw again
+ throw new NullPointerException("this.landLineNumber.phoneId is null");
+ } else if (this.getLandLineNumber().getPhoneId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneId={0} is not valid", this.getLandLineNumber().getPhoneId()));
+ } else if (this.getFaxNumber().getPhoneAreaCode()== null) {
+ // Throw again
+ throw new NullPointerException("this.landLineNumber.phoneAreaCode is null");
+ } else if (this.getFaxNumber().getPhoneAreaCode() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneAreaCode={0} is not valid", this.getFaxNumber().getPhoneAreaCode()));
+ } else if (this.getLandLineNumber().getPhoneCountry() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.landLineNumber.phoneCountry is null");
+ } else if (this.getLandLineNumber().getPhoneCountry().getCountryId() == null) {
+ // ... throw again
+ throw new NullPointerException("this.landLineNumber.phoneCountry.countryId is null");
+ } else if (this.getLandLineNumber().getPhoneCountry().getCountryId() < 1) {
+ // Invalid id
+ throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneCountry.countryId={0} is invalid", this.getLandLineNumber().getPhoneCountry().getCountryId()));
+ } else if (this.getLandLineNumber().getPhoneNumber() == null) {
+ // Throw NPE again ...
+ throw new NullPointerException("this.landLineNumber.phoneNumber is null");
+ } else if (this.getLandLineNumber().getPhoneNumber() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneNumber={0} is not valid", this.getLandLineNumber().getPhoneNumber()));
+ }
+
+ // Copy all (changeable) data fields to admin controller
+ this.adminPhoneController.setPhoneCountry(this.getLandLineNumber().getPhoneCountry());
+ this.adminPhoneController.setPhoneNumber(this.getLandLineNumber().getPhoneNumber());
+ }
+
@Override
public void copyMobileNumberToController () {
// Validate mobile instance