]> git.mxchange.org Git - jphone-core.git/blobdiff - src/org/mxchange/jphone/events/landline/updated/AdminLandLineNumberUpdatedEvent.java
Updated copyright year
[jphone-core.git] / src / org / mxchange / jphone / events / landline / updated / AdminLandLineNumberUpdatedEvent.java
index 0b1a9b6fd104fc9be7c0010ad60555501203b84a..0a325d9a2fb088549c056ef21e5d6f66b0b54b0b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -41,6 +42,39 @@ public class AdminLandLineNumberUpdatedEvent implements AdminUpdatedLandLineNumb
         * @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;
        }