]> git.mxchange.org Git - jphone-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 22 Jan 2023 06:48:35 +0000 (07:48 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 22 Jan 2023 06:48:35 +0000 (07:48 +0100)
- added checks for parameters
- renamed event interfaces with prefx "Observable"

34 files changed:
lib/jcoreee.jar
src/org/mxchange/jphone/events/fax/created/CreatedFaxNumberEvent.java
src/org/mxchange/jphone/events/fax/deleted/AdminDeletedFaxNumberEvent.java [deleted file]
src/org/mxchange/jphone/events/fax/deleted/AdminFaxNumberDeletedEvent.java
src/org/mxchange/jphone/events/fax/deleted/ObservableAdminFaxNumberDeletedEvent.java [new file with mode: 0644]
src/org/mxchange/jphone/events/fax/removed/AdminFaxNumberRemovedFromListEvent.java
src/org/mxchange/jphone/events/fax/removed/AdminRemoveFaxNumberFromListEvent.java [deleted file]
src/org/mxchange/jphone/events/fax/removed/ObservableAdminFaxNumberRemovedFromListEvent.java [new file with mode: 0644]
src/org/mxchange/jphone/events/fax/updated/AdminFaxNumberUpdatedEvent.java
src/org/mxchange/jphone/events/fax/updated/AdminUpdatedFaxNumberEvent.java [deleted file]
src/org/mxchange/jphone/events/fax/updated/ObservableAdminFaxNumberUpdatedEvent.java [new file with mode: 0644]
src/org/mxchange/jphone/events/landline/created/CreatedLandLineNumberEvent.java
src/org/mxchange/jphone/events/landline/deleted/AdminDeletedLandLineNumberEvent.java [deleted file]
src/org/mxchange/jphone/events/landline/deleted/AdminLandLineNumberDeletedEvent.java
src/org/mxchange/jphone/events/landline/deleted/ObservableAdminLandLineNumberDeletedEvent.java [new file with mode: 0644]
src/org/mxchange/jphone/events/landline/removed/AdminLandLineNumberRemovedFromListEvent.java
src/org/mxchange/jphone/events/landline/removed/AdminRemoveLandLineNumberFromListEvent.java [deleted file]
src/org/mxchange/jphone/events/landline/removed/ObservableAdminLandLineNumberRemovedFromListEvent.java [new file with mode: 0644]
src/org/mxchange/jphone/events/landline/updated/AdminLandLineNumberUpdatedEvent.java
src/org/mxchange/jphone/events/landline/updated/AdminUpdatedLandLineNumberEvent.java [deleted file]
src/org/mxchange/jphone/events/landline/updated/ObservableAdminLandLineNumberUpdatedEvent.java [new file with mode: 0644]
src/org/mxchange/jphone/events/mobile/created/CreatedMobileNumberEvent.java
src/org/mxchange/jphone/events/mobile/deleted/AdminDeletedMobileNumberEvent.java [deleted file]
src/org/mxchange/jphone/events/mobile/deleted/AdminMobileNumberDeletedEvent.java
src/org/mxchange/jphone/events/mobile/deleted/ObservableAdminMobileNumberDeletedEvent.java [new file with mode: 0644]
src/org/mxchange/jphone/events/mobile/remove/AdminMobileNumberRemovedFromListEvent.java
src/org/mxchange/jphone/events/mobile/remove/AdminRemoveMobileNumberFromListEvent.java [deleted file]
src/org/mxchange/jphone/events/mobile/remove/ObservableAdminMobileNumberRemovedFromListEvent.java [new file with mode: 0644]
src/org/mxchange/jphone/events/mobile/updated/AdminMobileNumberUpdatedEvent.java
src/org/mxchange/jphone/events/mobile/updated/AdminUpdatedMobileNumberEvent.java [deleted file]
src/org/mxchange/jphone/events/mobile/updated/ObservableAdminMobileNumberUpdatedEvent.java [new file with mode: 0644]
src/org/mxchange/jphone/events/mobileprovider/added/AdminAddedMobileProviderEvent.java [deleted file]
src/org/mxchange/jphone/events/mobileprovider/added/AdminMobileProviderAddedEvent.java
src/org/mxchange/jphone/events/mobileprovider/added/ObservableAdminMobileProviderAddedEvent.java [new file with mode: 0644]

index fa82023e537b42f98b05c403a446c558650e5f35..f8e0c8ee536def3819e3f0122c9411cccfdb48cf 100644 (file)
Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ
index 706b1cce3771204fafb64cd15e0df5d494d800ba..b43edf951e21a48b41fe18786ec0d2da21195207 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jphone.events.fax.created;
 
+import java.text.MessageFormat;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 
 /**
@@ -42,6 +43,40 @@ public class CreatedFaxNumberEvent implements ObservableCreatedFaxNumberEvent {
         * @param faxNumber Fax number instance
         */
        public CreatedFaxNumberEvent (final DialableFaxNumber faxNumber) {
+               // Check parameter
+               if (null == faxNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("Parameter 'faxNumber' is null"); //NOI18M
+               } else if (faxNumber.getPhoneId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("faxNumber.phoneId is null"); //NOI18M
+               } else if (faxNumber.getPhoneId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneId={0} is invalid", faxNumber.getPhoneId())); //NOI18M
+               } else if (faxNumber.getPhoneAreaCode() == null) {
+                       // Throw it again
+                       throw new NullPointerException("faxNumber.phoneAreaCode is null"); //NOI18M
+               } else if (faxNumber.getPhoneAreaCode() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneAreaCode={0} is invalid", faxNumber.getPhoneAreaCode())); //NOI18M
+               } else if (faxNumber.getPhoneNumber() == null) {
+                       // Throw it again
+                       throw new NullPointerException("faxNumber.phoneNumber is null"); //NOI18M
+               } else if (faxNumber.getPhoneNumber() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneNumber={0} is invalid", faxNumber.getPhoneNumber())); //NOI18M
+               } else if (faxNumber.getPhoneCountry() == null) {
+                       // Throw it again
+                       throw new NullPointerException("faxNumber.phoneCountry is null"); //NOI18M
+               } else if (faxNumber.getPhoneCountry().getCountryId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("faxNumber.phoneCountry.countryId is null"); //NOI18M
+               } else if (faxNumber.getPhoneCountry().getCountryId() < 1) {
+                       // Throw it again
+                       throw new NullPointerException(MessageFormat.format("faxNumber.phoneCountry.countryId={0} is invalid", faxNumber.getPhoneCountry().getCountryId())); //NOI18M
+               }
+
+               // Set it here
                this.faxNumber = faxNumber;
        }
 
diff --git a/src/org/mxchange/jphone/events/fax/deleted/AdminDeletedFaxNumberEvent.java b/src/org/mxchange/jphone/events/fax/deleted/AdminDeletedFaxNumberEvent.java
deleted file mode 100644 (file)
index d27752d..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 - 2022 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.events.fax.deleted;
-
-import java.io.Serializable;
-import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
-
-/**
- * An interface for an event when a fax number has been deleted
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AdminDeletedFaxNumberEvent extends Serializable {
-
-       /**
-        * Getter for deleted fax numbers
-        * <p>
-        * @return Deleted fax numbers
-        */
-       DialableFaxNumber getDeletedFaxNumber ();
-
-}
index fea6a597e63261945559b62e2849ac3216f77e1f..56f43147dffdc797c83c57c96f7a47ef87a9566a 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jphone.events.fax.deleted;
 
+import java.text.MessageFormat;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 
 /**
@@ -23,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public class AdminFaxNumberDeletedEvent implements AdminDeletedFaxNumberEvent {
+public class AdminFaxNumberDeletedEvent implements ObservableAdminFaxNumberDeletedEvent {
 
        /**
         * Serial number
@@ -41,6 +42,39 @@ public class AdminFaxNumberDeletedEvent implements AdminDeletedFaxNumberEvent {
         * @param deletedFaxNumber Deleted land-line number
         */
        public AdminFaxNumberDeletedEvent (final DialableFaxNumber deletedFaxNumber) {
+               // Check parameter
+               if (null == deletedFaxNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("Parameter 'deletedFaxNumber' is null"); //NOI18M
+               } else if (deletedFaxNumber.getPhoneId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedFaxNumber.phoneId is null"); //NOI18M
+               } else if (deletedFaxNumber.getPhoneId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("deletedFaxNumber.phoneId={0} is invalid", deletedFaxNumber.getPhoneId())); //NOI18M
+               } else if (deletedFaxNumber.getPhoneAreaCode() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedFaxNumber.phoneAreaCode is null"); //NOI18M
+               } else if (deletedFaxNumber.getPhoneAreaCode() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("deletedFaxNumber.phoneAreaCode={0} is invalid", deletedFaxNumber.getPhoneAreaCode())); //NOI18M
+               } else if (deletedFaxNumber.getPhoneNumber() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedFaxNumber.phoneNumber is null"); //NOI18M
+               } else if (deletedFaxNumber.getPhoneNumber() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("deletedFaxNumber.phoneNumber={0} is invalid", deletedFaxNumber.getPhoneNumber())); //NOI18M
+               } else if (deletedFaxNumber.getPhoneCountry() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedFaxNumber.phoneCountry is null"); //NOI18M
+               } else if (deletedFaxNumber.getPhoneCountry().getCountryId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedFaxNumber.phoneCountry.countryId is null"); //NOI18M
+               } else if (deletedFaxNumber.getPhoneCountry().getCountryId() < 1) {
+                       // Throw it again
+                       throw new NullPointerException(MessageFormat.format("deletedFaxNumber.phoneCountry.countryId={0} is invalid", deletedFaxNumber.getPhoneCountry().getCountryId())); //NOI18M
+               }
+
                // Set it here
                this.deletedFaxNumber = deletedFaxNumber;
        }
diff --git a/src/org/mxchange/jphone/events/fax/deleted/ObservableAdminFaxNumberDeletedEvent.java b/src/org/mxchange/jphone/events/fax/deleted/ObservableAdminFaxNumberDeletedEvent.java
new file mode 100644 (file)
index 0000000..52aa0fe
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 - 2022 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.events.fax.deleted;
+
+import java.io.Serializable;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
+
+/**
+ * An interface for an event when a fax number has been deleted
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminFaxNumberDeletedEvent extends Serializable {
+
+       /**
+        * Getter for deleted fax numbers
+        * <p>
+        * @return Deleted fax numbers
+        */
+       DialableFaxNumber getDeletedFaxNumber ();
+
+}
index 8de01824ab407180ecf1b7c1bd235457f2619c92..02147e571dd3f97c537383aa25196f9e3a7c834c 100644 (file)
@@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public class AdminFaxNumberRemovedFromListEvent implements AdminRemoveFaxNumberFromListEvent {
+public class AdminFaxNumberRemovedFromListEvent implements ObservableAdminFaxNumberRemovedFromListEvent {
 
        /**
         * Serial number
@@ -42,6 +42,12 @@ public class AdminFaxNumberRemovedFromListEvent implements AdminRemoveFaxNumberF
         * @param faxNumberList Fax number list
         */
        public AdminFaxNumberRemovedFromListEvent (final List<DialableFaxNumber> faxNumberList) {
+               // Check parameter
+               if (null == faxNumberList) {
+                       // Throw NPE
+                       throw new NullPointerException("Parameter 'faxNumberList' is null"); //NOI18N
+               }
+
                // Set it here
                this.faxNumberList = faxNumberList;
        }
diff --git a/src/org/mxchange/jphone/events/fax/removed/AdminRemoveFaxNumberFromListEvent.java b/src/org/mxchange/jphone/events/fax/removed/AdminRemoveFaxNumberFromListEvent.java
deleted file mode 100644 (file)
index 37cb48d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2016 - 2022 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.events.fax.removed;
-
-import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
-
-/**
- * An interface for an event when a list needs to be cleared from fax
- * numbers.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AdminRemoveFaxNumberFromListEvent extends Serializable {
-
-       /**
-        * Getter for fax numer list
-        * <p>
-        * @return fax number list
-        */
-       List<DialableFaxNumber> getFaxNumberList ();
-
-}
diff --git a/src/org/mxchange/jphone/events/fax/removed/ObservableAdminFaxNumberRemovedFromListEvent.java b/src/org/mxchange/jphone/events/fax/removed/ObservableAdminFaxNumberRemovedFromListEvent.java
new file mode 100644 (file)
index 0000000..efa789f
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2016 - 2022 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.events.fax.removed;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
+
+/**
+ * An interface for an event when a list needs to be cleared from fax
+ * numbers.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminFaxNumberRemovedFromListEvent extends Serializable {
+
+       /**
+        * Getter for fax numer list
+        * <p>
+        * @return fax number list
+        */
+       List<DialableFaxNumber> getFaxNumberList ();
+
+}
index 9905057f42aa8902e559194ae189a59a37a75003..fa6078338e01bc31c317f8faa32371ad8fdf83e0 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jphone.events.fax.updated;
 
+import java.text.MessageFormat;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 
 /**
@@ -23,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public class AdminFaxNumberUpdatedEvent implements AdminUpdatedFaxNumberEvent {
+public class AdminFaxNumberUpdatedEvent implements ObservableAdminFaxNumberUpdatedEvent {
 
        /**
         * Serial number
@@ -41,6 +42,39 @@ public class AdminFaxNumberUpdatedEvent implements AdminUpdatedFaxNumberEvent {
         * @param updatedFaxNumber Updated fax number
         */
        public AdminFaxNumberUpdatedEvent (final DialableFaxNumber updatedFaxNumber) {
+               // Check parameter
+               if (null == updatedFaxNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("Parameter 'updatedFaxNumber' is null"); //NOI18M
+               } else if (updatedFaxNumber.getPhoneId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("updatedFaxNumber.phoneId is null"); //NOI18M
+               } else if (updatedFaxNumber.getPhoneId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("updatedFaxNumber.phoneId={0} is invalid", updatedFaxNumber.getPhoneId())); //NOI18M
+               } else if (updatedFaxNumber.getPhoneAreaCode() == null) {
+                       // Throw it again
+                       throw new NullPointerException("updatedFaxNumber.phoneAreaCode is null"); //NOI18M
+               } else if (updatedFaxNumber.getPhoneAreaCode() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("updatedFaxNumber.phoneAreaCode={0} is invalid", updatedFaxNumber.getPhoneAreaCode())); //NOI18M
+               } else if (updatedFaxNumber.getPhoneNumber() == null) {
+                       // Throw it again
+                       throw new NullPointerException("updatedFaxNumber.phoneNumber is null"); //NOI18M
+               } else if (updatedFaxNumber.getPhoneNumber() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("updatedFaxNumber.phoneNumber={0} is invalid", updatedFaxNumber.getPhoneNumber())); //NOI18M
+               } else if (updatedFaxNumber.getPhoneCountry() == null) {
+                       // Throw it again
+                       throw new NullPointerException("updatedFaxNumber.phoneCountry is null"); //NOI18M
+               } else if (updatedFaxNumber.getPhoneCountry().getCountryId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("updatedFaxNumber.phoneCountry.countryId is null"); //NOI18M
+               } else if (updatedFaxNumber.getPhoneCountry().getCountryId() < 1) {
+                       // Throw it again
+                       throw new NullPointerException(MessageFormat.format("updatedFaxNumber.phoneCountry.countryId={0} is invalid", updatedFaxNumber.getPhoneCountry().getCountryId())); //NOI18M
+               }
+
                // Set it here
                this.updatedFaxNumber = updatedFaxNumber;
        }
diff --git a/src/org/mxchange/jphone/events/fax/updated/AdminUpdatedFaxNumberEvent.java b/src/org/mxchange/jphone/events/fax/updated/AdminUpdatedFaxNumberEvent.java
deleted file mode 100644 (file)
index a7d53ae..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 - 2022 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.events.fax.updated;
-
-import java.io.Serializable;
-import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
-
-/**
- * An interface for an event when a fax number has been updated
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AdminUpdatedFaxNumberEvent extends Serializable {
-
-       /**
-        * Getter for updated fax numbers
-        * <p>
-        * @return Updated fax numbers
-        */
-       DialableFaxNumber getUpdatedFaxNumber ();
-
-}
diff --git a/src/org/mxchange/jphone/events/fax/updated/ObservableAdminFaxNumberUpdatedEvent.java b/src/org/mxchange/jphone/events/fax/updated/ObservableAdminFaxNumberUpdatedEvent.java
new file mode 100644 (file)
index 0000000..2022c45
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 - 2022 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.events.fax.updated;
+
+import java.io.Serializable;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
+
+/**
+ * An interface for an event when a fax number has been updated
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminFaxNumberUpdatedEvent extends Serializable {
+
+       /**
+        * Getter for updated fax numbers
+        * <p>
+        * @return Updated fax numbers
+        */
+       DialableFaxNumber getUpdatedFaxNumber ();
+
+}
index d069df6c89e0c8fe33d7d5db47a6cbedba86d268..27e75bffe3f6064552ebcefe639dbc3a4b463c7f 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jphone.events.landline.created;
 
+import java.text.MessageFormat;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
 
 /**
@@ -42,6 +43,40 @@ public class CreatedLandLineNumberEvent implements ObservableCreatedLandLineNumb
         * @param landLineNumber Land-line number instance
         */
        public CreatedLandLineNumberEvent (final DialableLandLineNumber landLineNumber) {
+               // Check parameter
+               if (null == landLineNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("Parameter 'landLineNumber' is null"); //NOI18M
+               } else if (landLineNumber.getPhoneId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18M
+               } else if (landLineNumber.getPhoneId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneId={0} is invalid", landLineNumber.getPhoneId())); //NOI18M
+               } else if (landLineNumber.getPhoneAreaCode() == null) {
+                       // Throw it again
+                       throw new NullPointerException("landLineNumber.phoneAreaCode is null"); //NOI18M
+               } else if (landLineNumber.getPhoneAreaCode() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneAreaCode={0} is invalid", landLineNumber.getPhoneAreaCode())); //NOI18M
+               } else if (landLineNumber.getPhoneNumber() == null) {
+                       // Throw it again
+                       throw new NullPointerException("landLineNumber.phoneNumber is null"); //NOI18M
+               } else if (landLineNumber.getPhoneNumber() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneNumber={0} is invalid", landLineNumber.getPhoneNumber())); //NOI18M
+               } else if (landLineNumber.getPhoneCountry() == null) {
+                       // Throw it again
+                       throw new NullPointerException("landLineNumber.phoneCountry is null"); //NOI18M
+               } else if (landLineNumber.getPhoneCountry().getCountryId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("landLineNumber.phoneCountry.countryId is null"); //NOI18M
+               } else if (landLineNumber.getPhoneCountry().getCountryId() < 1) {
+                       // Throw it again
+                       throw new NullPointerException(MessageFormat.format("landLineNumber.phoneCountry.countryId={0} is invalid", landLineNumber.getPhoneCountry().getCountryId())); //NOI18M
+               }
+
+               // Set it here
                this.landLineNumber = landLineNumber;
        }
 
diff --git a/src/org/mxchange/jphone/events/landline/deleted/AdminDeletedLandLineNumberEvent.java b/src/org/mxchange/jphone/events/landline/deleted/AdminDeletedLandLineNumberEvent.java
deleted file mode 100644 (file)
index 72c1b4f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 - 2022 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.events.landline.deleted;
-
-import java.io.Serializable;
-import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-
-/**
- * An interface for an event when a land-line number has been deleted
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AdminDeletedLandLineNumberEvent extends Serializable {
-
-       /**
-        * Getter for deleted land-line numbers
-        * <p>
-        * @return Deleted land-line numbers
-        */
-       DialableLandLineNumber getDeletedLandLineNumber ();
-
-}
index 1e6d235012b6560bac0840baffa7e618ed982661..55b467a755e4beb7c7130c8031a111d97862db21 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jphone.events.landline.deleted;
 
+import java.text.MessageFormat;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
 
 /**
@@ -23,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public class AdminLandLineNumberDeletedEvent implements AdminDeletedLandLineNumberEvent {
+public class AdminLandLineNumberDeletedEvent implements ObservableAdminLandLineNumberDeletedEvent {
 
        /**
         * Serial number
@@ -41,6 +42,39 @@ public class AdminLandLineNumberDeletedEvent implements AdminDeletedLandLineNumb
         * @param deletedLandLineNumber Deleted land-line number
         */
        public AdminLandLineNumberDeletedEvent (final DialableLandLineNumber deletedLandLineNumber) {
+               // Check parameter
+               if (null == deletedLandLineNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("Parameter 'deletedLandLineNumber' is null"); //NOI18M
+               } else if (deletedLandLineNumber.getPhoneId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedLandLineNumber.phoneId is null"); //NOI18M
+               } else if (deletedLandLineNumber.getPhoneId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("deletedLandLineNumber.phoneId={0} is invalid", deletedLandLineNumber.getPhoneId())); //NOI18M
+               } else if (deletedLandLineNumber.getPhoneAreaCode() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedLandLineNumber.phoneAreaCode is null"); //NOI18M
+               } else if (deletedLandLineNumber.getPhoneAreaCode() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("deletedLandLineNumber.phoneAreaCode={0} is invalid", deletedLandLineNumber.getPhoneAreaCode())); //NOI18M
+               } else if (deletedLandLineNumber.getPhoneNumber() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedLandLineNumber.phoneNumber is null"); //NOI18M
+               } else if (deletedLandLineNumber.getPhoneNumber() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("deletedLandLineNumber.phoneNumber={0} is invalid", deletedLandLineNumber.getPhoneNumber())); //NOI18M
+               } else if (deletedLandLineNumber.getPhoneCountry() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedLandLineNumber.phoneCountry is null"); //NOI18M
+               } else if (deletedLandLineNumber.getPhoneCountry().getCountryId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedLandLineNumber.phoneCountry.countryId is null"); //NOI18M
+               } else if (deletedLandLineNumber.getPhoneCountry().getCountryId() < 1) {
+                       // Throw it again
+                       throw new NullPointerException(MessageFormat.format("deletedLandLineNumber.phoneCountry.countryId={0} is invalid", deletedLandLineNumber.getPhoneCountry().getCountryId())); //NOI18M
+               }
+
                // Set it here
                this.deletedLandLineNumber = deletedLandLineNumber;
        }
diff --git a/src/org/mxchange/jphone/events/landline/deleted/ObservableAdminLandLineNumberDeletedEvent.java b/src/org/mxchange/jphone/events/landline/deleted/ObservableAdminLandLineNumberDeletedEvent.java
new file mode 100644 (file)
index 0000000..358c7ee
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 - 2022 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.events.landline.deleted;
+
+import java.io.Serializable;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
+
+/**
+ * An interface for an event when a land-line number has been deleted
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminLandLineNumberDeletedEvent extends Serializable {
+
+       /**
+        * Getter for deleted land-line numbers
+        * <p>
+        * @return Deleted land-line numbers
+        */
+       DialableLandLineNumber getDeletedLandLineNumber ();
+
+}
index a58f47070784d7c1f8119e9bc0e7c8d747f53fea..478f596e3f171e99e9003b49b5b4cd7b442669ff 100644 (file)
@@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public class AdminLandLineNumberRemovedFromListEvent implements AdminRemoveLandLineNumberFromListEvent {
+public class AdminLandLineNumberRemovedFromListEvent implements ObservableAdminLandLineNumberRemovedFromListEvent {
 
        /**
         * Serial number
diff --git a/src/org/mxchange/jphone/events/landline/removed/AdminRemoveLandLineNumberFromListEvent.java b/src/org/mxchange/jphone/events/landline/removed/AdminRemoveLandLineNumberFromListEvent.java
deleted file mode 100644 (file)
index 85cc674..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2016 - 2022 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.events.landline.removed;
-
-import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-
-/**
- * An interface for an event when a list needs to be cleared from land-line
- * numbers.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AdminRemoveLandLineNumberFromListEvent extends Serializable {
-
-       /**
-        * Getter for land-line numer list
-        * <p>
-        * @return Land-line number list
-        */
-       List<DialableLandLineNumber> getLandLineNumberList ();
-
-}
diff --git a/src/org/mxchange/jphone/events/landline/removed/ObservableAdminLandLineNumberRemovedFromListEvent.java b/src/org/mxchange/jphone/events/landline/removed/ObservableAdminLandLineNumberRemovedFromListEvent.java
new file mode 100644 (file)
index 0000000..7dac773
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2016 - 2022 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.events.landline.removed;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
+
+/**
+ * An interface for an event when a list needs to be cleared from land-line
+ * numbers.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminLandLineNumberRemovedFromListEvent extends Serializable {
+
+       /**
+        * Getter for land-line numer list
+        * <p>
+        * @return Land-line number list
+        */
+       List<DialableLandLineNumber> getLandLineNumberList ();
+
+}
index a3b57efd73a62c8b462f2315e2dee745ffdf7f37..db07df45e523efad97fd7c1505537fd43dcb5c84 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jphone.events.landline.updated;
 
+import java.text.MessageFormat;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
 
 /**
@@ -23,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
  * <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;
        }
diff --git a/src/org/mxchange/jphone/events/landline/updated/AdminUpdatedLandLineNumberEvent.java b/src/org/mxchange/jphone/events/landline/updated/AdminUpdatedLandLineNumberEvent.java
deleted file mode 100644 (file)
index 1cd3207..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 - 2022 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.events.landline.updated;
-
-import java.io.Serializable;
-import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-
-/**
- * An interface for an event when a land-line number has been updated
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AdminUpdatedLandLineNumberEvent extends Serializable {
-
-       /**
-        * Getter for updated land-line numbers
-        * <p>
-        * @return Updated land-line numbers
-        */
-       DialableLandLineNumber getUpdatedLandLineNumber ();
-
-}
diff --git a/src/org/mxchange/jphone/events/landline/updated/ObservableAdminLandLineNumberUpdatedEvent.java b/src/org/mxchange/jphone/events/landline/updated/ObservableAdminLandLineNumberUpdatedEvent.java
new file mode 100644 (file)
index 0000000..d7e3155
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 - 2022 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.events.landline.updated;
+
+import java.io.Serializable;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
+
+/**
+ * An interface for an event when a land-line number has been updated
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminLandLineNumberUpdatedEvent extends Serializable {
+
+       /**
+        * Getter for updated land-line numbers
+        * <p>
+        * @return Updated land-line numbers
+        */
+       DialableLandLineNumber getUpdatedLandLineNumber ();
+
+}
index 4ba4878cb74afde685d69b4b75e217cb55d6a4d7..a3c92a0ec72504b6d27ae531fbdbbc436af47d18 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jphone.events.mobile.created;
 
+import java.text.MessageFormat;
 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
 
 /**
@@ -42,6 +43,34 @@ public class CreatedMobileNumberEvent implements ObservableCreatedMobileNumberEv
         * @param mobileNumber Mobile number instance
         */
        public CreatedMobileNumberEvent (final DialableMobileNumber mobileNumber) {
+               // Check parameter
+               if (null == mobileNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("Parameter 'mobileNumber' is null"); //NOI18M
+               } else if (mobileNumber.getMobileId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("mobileNumber.mobileId is null"); //NOI18M
+               } else if (mobileNumber.getMobileId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.mobileId={0} is invalid", mobileNumber.getMobileId())); //NOI18M
+               } else if (mobileNumber.getMobileNumber() == null) {
+                       // Throw it again
+                       throw new NullPointerException("mobileNumber.mobileNumber is null"); //NOI18M
+               } else if (mobileNumber.getMobileNumber() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.mobileNumber={0} is invalid", mobileNumber.getMobileNumber())); //NOI18M
+               } else if (mobileNumber.getMobileProvider() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("mobileNumber.mobileProvider is null"); //NOI18M
+               } else if (mobileNumber.getMobileProvider().getProviderId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("mobileNumber.mobileProvider.providerId is null"); //NOI18M
+               } else if (mobileNumber.getMobileProvider().getProviderId() < 1) {
+                       // Throw it again
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.mobileProvider.providerId={0} is invalid", mobileNumber.getMobileProvider().getProviderId())); //NOI18M
+               }
+
+               // Set it here
                this.mobileNumber = mobileNumber;
        }
 
diff --git a/src/org/mxchange/jphone/events/mobile/deleted/AdminDeletedMobileNumberEvent.java b/src/org/mxchange/jphone/events/mobile/deleted/AdminDeletedMobileNumberEvent.java
deleted file mode 100644 (file)
index f86a63f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 - 2022 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.events.mobile.deleted;
-
-import java.io.Serializable;
-import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
-
-/**
- * An interface for an event when a mobile number has been deleted
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AdminDeletedMobileNumberEvent extends Serializable {
-
-       /**
-        * Getter for deleted mobile numbers
-        * <p>
-        * @return Deleted mobile numbers
-        */
-       DialableMobileNumber getDeletedMobileNumber ();
-
-}
index fd2fc01bcdfb96fd7df00fcc479713b2816be12a..eaf6fc66dd7418d1ebd75cad5cda85c6ec5135ce 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jphone.events.mobile.deleted;
 
+import java.text.MessageFormat;
 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
 
 /**
@@ -23,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public class AdminMobileNumberDeletedEvent implements AdminDeletedMobileNumberEvent {
+public class AdminMobileNumberDeletedEvent implements ObservableAdminMobileNumberDeletedEvent {
 
        /**
         * Serial number
@@ -41,6 +42,33 @@ public class AdminMobileNumberDeletedEvent implements AdminDeletedMobileNumberEv
         * @param deletedMobileNumber Mobile number
         */
        public AdminMobileNumberDeletedEvent (final DialableMobileNumber deletedMobileNumber) {
+               // Check parameter
+               if (null == deletedMobileNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("Parameter 'deletedMobileNumber' is null"); //NOI18M
+               } else if (deletedMobileNumber.getMobileId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedMobileNumber.mobileId is null"); //NOI18M
+               } else if (deletedMobileNumber.getMobileId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("deletedMobileNumber.mobileId={0} is invalid", deletedMobileNumber.getMobileId())); //NOI18M
+               } else if (deletedMobileNumber.getMobileNumber() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedMobileNumber.mobileNumber is null"); //NOI18M
+               } else if (deletedMobileNumber.getMobileNumber() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("deletedMobileNumber.mobileNumber={0} is invalid", deletedMobileNumber.getMobileNumber())); //NOI18M
+               } else if (deletedMobileNumber.getMobileProvider() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("deletedMobileNumber.mobileProvider is null"); //NOI18M
+               } else if (deletedMobileNumber.getMobileProvider().getProviderId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("deletedMobileNumber.mobileProvider.providerId is null"); //NOI18M
+               } else if (deletedMobileNumber.getMobileProvider().getProviderId() < 1) {
+                       // Throw it again
+                       throw new IllegalArgumentException(MessageFormat.format("deletedMobileNumber.mobileProvider.providerId={0} is invalid", deletedMobileNumber.getMobileProvider().getProviderId())); //NOI18M
+               }
+
                // Set it here
                this.deletedMobileNumber = deletedMobileNumber;
        }
diff --git a/src/org/mxchange/jphone/events/mobile/deleted/ObservableAdminMobileNumberDeletedEvent.java b/src/org/mxchange/jphone/events/mobile/deleted/ObservableAdminMobileNumberDeletedEvent.java
new file mode 100644 (file)
index 0000000..f0a7a28
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 - 2022 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.events.mobile.deleted;
+
+import java.io.Serializable;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+
+/**
+ * An interface for an event when a mobile number has been deleted
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminMobileNumberDeletedEvent extends Serializable {
+
+       /**
+        * Getter for deleted mobile numbers
+        * <p>
+        * @return Deleted mobile numbers
+        */
+       DialableMobileNumber getDeletedMobileNumber ();
+
+}
index 277a99883bcaf39aa6780a990f3e6e19b2e3325d..ce0e453a805dab055b2b9a28f13a2cdcd3708555 100644 (file)
@@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public class AdminMobileNumberRemovedFromListEvent implements AdminRemoveMobileNumberFromListEvent {
+public class AdminMobileNumberRemovedFromListEvent implements ObservableAdminMobileNumberRemovedFromListEvent {
 
        /**
         * Serial number
@@ -42,6 +42,12 @@ public class AdminMobileNumberRemovedFromListEvent implements AdminRemoveMobileN
         * @param mobileNumberList Mobile number list
         */
        public AdminMobileNumberRemovedFromListEvent (final List<DialableMobileNumber> mobileNumberList) {
+               // Check parameter
+               if (null == mobileNumberList) {
+                       // Throw NPE
+                       throw new NullPointerException("Parameter 'mobileNumberList' is null"); //NOI18N
+               }
+
                // Set it here
                this.mobileNumberList = mobileNumberList;
        }
diff --git a/src/org/mxchange/jphone/events/mobile/remove/AdminRemoveMobileNumberFromListEvent.java b/src/org/mxchange/jphone/events/mobile/remove/AdminRemoveMobileNumberFromListEvent.java
deleted file mode 100644 (file)
index cea2221..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2016 - 2022 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.events.mobile.remove;
-
-import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
-
-/**
- * An interface for an event when a list needs to be cleared from mobile
- * numbers.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AdminRemoveMobileNumberFromListEvent extends Serializable {
-
-       /**
-        * Getter for mobile numer list
-        * <p>
-        * @return Mobile number list
-        */
-       List<DialableMobileNumber> getMobileNumberList ();
-
-}
diff --git a/src/org/mxchange/jphone/events/mobile/remove/ObservableAdminMobileNumberRemovedFromListEvent.java b/src/org/mxchange/jphone/events/mobile/remove/ObservableAdminMobileNumberRemovedFromListEvent.java
new file mode 100644 (file)
index 0000000..f62ebb7
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2016 - 2022 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.events.mobile.remove;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+
+/**
+ * An interface for an event when a list needs to be cleared from mobile
+ * numbers.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminMobileNumberRemovedFromListEvent extends Serializable {
+
+       /**
+        * Getter for mobile numer list
+        * <p>
+        * @return Mobile number list
+        */
+       List<DialableMobileNumber> getMobileNumberList ();
+
+}
index b1dbca9c8159b242f05421a98b5171ad0ff979e8..4460070c1723abeb8d84db07793e61281bef8001 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jphone.events.mobile.updated;
 
+import java.text.MessageFormat;
 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
 
 /**
@@ -23,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public class AdminMobileNumberUpdatedEvent implements AdminUpdatedMobileNumberEvent {
+public class AdminMobileNumberUpdatedEvent implements ObservableAdminMobileNumberUpdatedEvent {
 
        /**
         * Serial number
@@ -41,6 +42,33 @@ public class AdminMobileNumberUpdatedEvent implements AdminUpdatedMobileNumberEv
         * @param updatedMobileNumber Updated mobile number
         */
        public AdminMobileNumberUpdatedEvent (final DialableMobileNumber updatedMobileNumber) {
+               // Check parameter
+               if (null == updatedMobileNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("Parameter 'updatedMobileNumber' is null"); //NOI18M
+               } else if (updatedMobileNumber.getMobileId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("updatedMobileNumber.mobileId is null"); //NOI18M
+               } else if (updatedMobileNumber.getMobileId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("updatedMobileNumber.mobileId={0} is invalid", updatedMobileNumber.getMobileId())); //NOI18M
+               } else if (updatedMobileNumber.getMobileNumber() == null) {
+                       // Throw it again
+                       throw new NullPointerException("updatedMobileNumber.mobileNumber is null"); //NOI18M
+               } else if (updatedMobileNumber.getMobileNumber() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("updatedMobileNumber.mobileNumber={0} is invalid", updatedMobileNumber.getMobileNumber())); //NOI18M
+               } else if (updatedMobileNumber.getMobileProvider() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("updatedMobileNumber.mobileProvider is null"); //NOI18M
+               } else if (updatedMobileNumber.getMobileProvider().getProviderId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("updatedMobileNumber.mobileProvider.providerId is null"); //NOI18M
+               } else if (updatedMobileNumber.getMobileProvider().getProviderId() < 1) {
+                       // Throw it again
+                       throw new IllegalArgumentException(MessageFormat.format("updatedMobileNumber.mobileProvider.providerId={0} is invalid", updatedMobileNumber.getMobileProvider().getProviderId())); //NOI18M
+               }
+
                // Set it here
                this.updatedMobileNumber = updatedMobileNumber;
        }
diff --git a/src/org/mxchange/jphone/events/mobile/updated/AdminUpdatedMobileNumberEvent.java b/src/org/mxchange/jphone/events/mobile/updated/AdminUpdatedMobileNumberEvent.java
deleted file mode 100644 (file)
index 96530dd..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 - 2022 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.events.mobile.updated;
-
-import java.io.Serializable;
-import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
-
-/**
- * An interface for an event when a mobile number has been updated
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AdminUpdatedMobileNumberEvent extends Serializable {
-
-       /**
-        * Getter for updated mobile numbers
-        * <p>
-        * @return Updated mobile numbers
-        */
-       DialableMobileNumber getUpdatedMobileNumber ();
-
-}
diff --git a/src/org/mxchange/jphone/events/mobile/updated/ObservableAdminMobileNumberUpdatedEvent.java b/src/org/mxchange/jphone/events/mobile/updated/ObservableAdminMobileNumberUpdatedEvent.java
new file mode 100644 (file)
index 0000000..af8b8c4
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 - 2022 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.events.mobile.updated;
+
+import java.io.Serializable;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+
+/**
+ * An interface for an event when a mobile number has been updated
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminMobileNumberUpdatedEvent extends Serializable {
+
+       /**
+        * Getter for updated mobile numbers
+        * <p>
+        * @return Updated mobile numbers
+        */
+       DialableMobileNumber getUpdatedMobileNumber ();
+
+}
diff --git a/src/org/mxchange/jphone/events/mobileprovider/added/AdminAddedMobileProviderEvent.java b/src/org/mxchange/jphone/events/mobileprovider/added/AdminAddedMobileProviderEvent.java
deleted file mode 100644 (file)
index 86de879..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 - 2022 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.events.mobileprovider.added;
-
-import java.io.Serializable;
-import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
-
-/**
- * An interface for an event when a new mobile provider has been added.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AdminAddedMobileProviderEvent extends Serializable {
-
-       /**
-        * Getter for added mobile provider
-        * <p>
-        * @return Added mobile provider
-        */
-       MobileProvider getAddedMobileProvider ();
-
-}
index 6328291684e6c150ea5a17e0738cc311d862dc73..1345f9e3ae29074b42253b687ea4dc6fed976c15 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jphone.events.mobileprovider.added;
 
+import java.text.MessageFormat;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
 
 /**
@@ -23,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public class AdminMobileProviderAddedEvent implements AdminAddedMobileProviderEvent {
+public class AdminMobileProviderAddedEvent implements ObservableAdminMobileProviderAddedEvent {
 
        /**
         * Serial number
@@ -41,6 +42,39 @@ public class AdminMobileProviderAddedEvent implements AdminAddedMobileProviderEv
         * @param addedMobileProvider Added mobile provider instance
         */
        public AdminMobileProviderAddedEvent (final MobileProvider addedMobileProvider) {
+               // Check parameter
+               if (null == addedMobileProvider) {
+                       // Throw NPE
+                       throw new NullPointerException("Parameter 'addedMobileProvider' is null"); //NOI18M
+               } else if (addedMobileProvider.getProviderId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("addedMobileProvider.providerId is null"); //NOI18M
+               } else if (addedMobileProvider.getProviderId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("addedMobileProvider.providerId={0} is invalid", addedMobileProvider.getProviderId())); //NOI18M
+               } else if (addedMobileProvider.getProviderName() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("addedMobileProvider.providerMame is null"); //NOI18M
+               } else if (addedMobileProvider.getProviderName().isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("addedMobileProvider.providerName is empty"); //NOI18M
+               } else if (addedMobileProvider.getProviderDialPrefix() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("addedMobileProvider.providerDialPrefix is null"); //NOI18M
+               } else if (addedMobileProvider.getProviderDialPrefix() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("addedMobileProvider.providerDialPrefix={0} is invalid", addedMobileProvider.getProviderDialPrefix())); //NOI18M
+               } else if (addedMobileProvider.getProviderCountry() == null) {
+                       // Throw it again
+                       throw new NullPointerException("addedMobileProvider.providerCountry is null"); //NOI18M
+               } else if (addedMobileProvider.getProviderCountry().getCountryId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("addedMobileProvider.providerCountry.countryId is null"); //NOI18M
+               } else if (addedMobileProvider.getProviderCountry().getCountryId() < 1) {
+                       // Throw it again
+                       throw new NullPointerException(MessageFormat.format("addedMobileProvider.providerCountry.countryId={0} is invalid", addedMobileProvider.getProviderCountry().getCountryId())); //NOI18M
+               }
+
                // Set it here
                this.addedMobileProvider = addedMobileProvider;
        }
diff --git a/src/org/mxchange/jphone/events/mobileprovider/added/ObservableAdminMobileProviderAddedEvent.java b/src/org/mxchange/jphone/events/mobileprovider/added/ObservableAdminMobileProviderAddedEvent.java
new file mode 100644 (file)
index 0000000..378398b
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 - 2022 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.events.mobileprovider.added;
+
+import java.io.Serializable;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
+
+/**
+ * An interface for an event when a new mobile provider has been added.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminMobileProviderAddedEvent extends Serializable {
+
+       /**
+        * Getter for added mobile provider
+        * <p>
+        * @return Added mobile provider
+        */
+       MobileProvider getAddedMobileProvider ();
+
+}