/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016 - 2024 Free Software Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*/
package org.mxchange.jphone.events.landline.updated;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import java.text.MessageFormat;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
* An event when a mobile number has been updated
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-public class AdminLandLineNumberUpdatedEvent implements AdminUpdatedLandLineNumberEvent {
+public class AdminLandLineNumberUpdatedEvent implements ObservableAdminLandLineNumberUpdatedEvent {
/**
* Serial number
* @param updatedLandLineNumber Updated mobile number
*/
public AdminLandLineNumberUpdatedEvent (final DialableLandLineNumber updatedLandLineNumber) {
+ // Check parameter
+ if (null == updatedLandLineNumber) {
+ // Throw NPE
+ throw new NullPointerException("Parameter 'updatedLandLineNumber' is null"); //NOI18M
+ } else if (updatedLandLineNumber.getPhoneId() == null) {
+ // Throw it again
+ throw new NullPointerException("updatedLandLineNumber.phoneId is null"); //NOI18M
+ } else if (updatedLandLineNumber.getPhoneId() < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException(MessageFormat.format("updatedLandLineNumber.phoneId={0} is invalid", updatedLandLineNumber.getPhoneId())); //NOI18M
+ } else if (updatedLandLineNumber.getPhoneAreaCode() == null) {
+ // Throw it again
+ throw new NullPointerException("updatedLandLineNumber.phoneAreaCode is null"); //NOI18M
+ } else if (updatedLandLineNumber.getPhoneAreaCode() < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException(MessageFormat.format("updatedLandLineNumber.phoneAreaCode={0} is invalid", updatedLandLineNumber.getPhoneAreaCode())); //NOI18M
+ } else if (updatedLandLineNumber.getPhoneNumber() == null) {
+ // Throw it again
+ throw new NullPointerException("updatedLandLineNumber.phoneNumber is null"); //NOI18M
+ } else if (updatedLandLineNumber.getPhoneNumber() < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException(MessageFormat.format("updatedLandLineNumber.phoneNumber={0} is invalid", updatedLandLineNumber.getPhoneNumber())); //NOI18M
+ } else if (updatedLandLineNumber.getPhoneCountry() == null) {
+ // Throw it again
+ throw new NullPointerException("updatedLandLineNumber.phoneCountry is null"); //NOI18M
+ } else if (updatedLandLineNumber.getPhoneCountry().getCountryId() == null) {
+ // Throw it again
+ throw new NullPointerException("updatedLandLineNumber.phoneCountry.countryId is null"); //NOI18M
+ } else if (updatedLandLineNumber.getPhoneCountry().getCountryId() < 1) {
+ // Throw it again
+ throw new NullPointerException(MessageFormat.format("updatedLandLineNumber.phoneCountry.countryId={0} is invalid", updatedLandLineNumber.getPhoneCountry().getCountryId())); //NOI18M
+ }
+
// Set it here
this.updatedLandLineNumber = updatedLandLineNumber;
}