From 1a0f1cd8a1ff113dd24954bf5903a70f5ec62225 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 22 Jan 2023 07:48:35 +0100 Subject: [PATCH] Continued: - added checks for parameters - renamed event interfaces with prefx "Observable" --- lib/jcoreee.jar | Bin 47956 -> 48290 bytes .../fax/created/CreatedFaxNumberEvent.java | 35 +++++++++++++++++ .../deleted/AdminFaxNumberDeletedEvent.java | 36 +++++++++++++++++- ...ObservableAdminFaxNumberDeletedEvent.java} | 2 +- .../AdminFaxNumberRemovedFromListEvent.java | 8 +++- ...leAdminFaxNumberRemovedFromListEvent.java} | 2 +- .../updated/AdminFaxNumberUpdatedEvent.java | 36 +++++++++++++++++- ...ObservableAdminFaxNumberUpdatedEvent.java} | 2 +- .../created/CreatedLandLineNumberEvent.java | 35 +++++++++++++++++ .../AdminLandLineNumberDeletedEvent.java | 36 +++++++++++++++++- ...vableAdminLandLineNumberDeletedEvent.java} | 2 +- ...minLandLineNumberRemovedFromListEvent.java | 2 +- ...inLandLineNumberRemovedFromListEvent.java} | 2 +- .../AdminLandLineNumberUpdatedEvent.java | 36 +++++++++++++++++- ...vableAdminLandLineNumberUpdatedEvent.java} | 2 +- .../created/CreatedMobileNumberEvent.java | 29 ++++++++++++++ .../AdminMobileNumberDeletedEvent.java | 30 ++++++++++++++- ...ervableAdminMobileNumberDeletedEvent.java} | 2 +- ...AdminMobileNumberRemovedFromListEvent.java | 8 +++- ...dminMobileNumberRemovedFromListEvent.java} | 2 +- .../AdminMobileNumberUpdatedEvent.java | 30 ++++++++++++++- ...ervableAdminMobileNumberUpdatedEvent.java} | 2 +- .../added/AdminMobileProviderAddedEvent.java | 36 +++++++++++++++++- ...ervableAdminMobileProviderAddedEvent.java} | 2 +- 24 files changed, 357 insertions(+), 20 deletions(-) rename src/org/mxchange/jphone/events/fax/deleted/{AdminDeletedFaxNumberEvent.java => ObservableAdminFaxNumberDeletedEvent.java} (93%) rename src/org/mxchange/jphone/events/fax/removed/{AdminRemoveFaxNumberFromListEvent.java => ObservableAdminFaxNumberRemovedFromListEvent.java} (93%) rename src/org/mxchange/jphone/events/fax/updated/{AdminUpdatedFaxNumberEvent.java => ObservableAdminFaxNumberUpdatedEvent.java} (93%) rename src/org/mxchange/jphone/events/landline/deleted/{AdminDeletedLandLineNumberEvent.java => ObservableAdminLandLineNumberDeletedEvent.java} (93%) rename src/org/mxchange/jphone/events/landline/removed/{AdminRemoveLandLineNumberFromListEvent.java => ObservableAdminLandLineNumberRemovedFromListEvent.java} (92%) rename src/org/mxchange/jphone/events/landline/updated/{AdminUpdatedLandLineNumberEvent.java => ObservableAdminLandLineNumberUpdatedEvent.java} (93%) rename src/org/mxchange/jphone/events/mobile/deleted/{AdminDeletedMobileNumberEvent.java => ObservableAdminMobileNumberDeletedEvent.java} (93%) rename src/org/mxchange/jphone/events/mobile/remove/{AdminRemoveMobileNumberFromListEvent.java => ObservableAdminMobileNumberRemovedFromListEvent.java} (93%) rename src/org/mxchange/jphone/events/mobile/updated/{AdminUpdatedMobileNumberEvent.java => ObservableAdminMobileNumberUpdatedEvent.java} (93%) rename src/org/mxchange/jphone/events/mobileprovider/added/{AdminAddedMobileProviderEvent.java => ObservableAdminMobileProviderAddedEvent.java} (93%) diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index fa82023e537b42f98b05c403a446c558650e5f35..f8e0c8ee536def3819e3f0122c9411cccfdb48cf 100644 GIT binary patch delta 5953 zcma)A34D~*wf}!Jleu5Md`Tt~vXd|gkdT=yELli^1VYN15Fij7S%(;wkS36XO>6@y zD$0JVEFvI9po%Q{APbSj_Vu-e_F3E7N2_A>)xN$~YJE$UK9zUQ_e}!m(_fR{e0M$f zoO{l>=lt*e)!%GKZrLKHPqjNVKm~rCUr@6vBE#_pm1m3QDrQCQRYqEsY4*V~*9g0d z;0K<98o8CaUBymgj4fPo@Dj!}dryc-VuXj@bVc!Ud&GO!KZ^zUH$uLv43wAqhs#lk zk!@k27=x{0*oN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{I7xiACQ}^0 z;4+_W#akELil=R4{1@w^Mfw{B%2yi*U82~~ktRKG~ljP7Y2|c0M~YG&HzSxpZ`-yU*aF^OZR9@S6#d_n(vy{||TL Bv@-wz diff --git a/src/org/mxchange/jphone/events/fax/created/CreatedFaxNumberEvent.java b/src/org/mxchange/jphone/events/fax/created/CreatedFaxNumberEvent.java index 706b1cc..b43edf9 100644 --- a/src/org/mxchange/jphone/events/fax/created/CreatedFaxNumberEvent.java +++ b/src/org/mxchange/jphone/events/fax/created/CreatedFaxNumberEvent.java @@ -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/AdminFaxNumberDeletedEvent.java b/src/org/mxchange/jphone/events/fax/deleted/AdminFaxNumberDeletedEvent.java index fea6a59..56f4314 100644 --- a/src/org/mxchange/jphone/events/fax/deleted/AdminFaxNumberDeletedEvent.java +++ b/src/org/mxchange/jphone/events/fax/deleted/AdminFaxNumberDeletedEvent.java @@ -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; *

* @author Roland Häder */ -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/AdminDeletedFaxNumberEvent.java b/src/org/mxchange/jphone/events/fax/deleted/ObservableAdminFaxNumberDeletedEvent.java similarity index 93% rename from src/org/mxchange/jphone/events/fax/deleted/AdminDeletedFaxNumberEvent.java rename to src/org/mxchange/jphone/events/fax/deleted/ObservableAdminFaxNumberDeletedEvent.java index d27752d..52aa0fe 100644 --- a/src/org/mxchange/jphone/events/fax/deleted/AdminDeletedFaxNumberEvent.java +++ b/src/org/mxchange/jphone/events/fax/deleted/ObservableAdminFaxNumberDeletedEvent.java @@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; *

* @author Roland Häder */ -public interface AdminDeletedFaxNumberEvent extends Serializable { +public interface ObservableAdminFaxNumberDeletedEvent extends Serializable { /** * Getter for deleted fax numbers diff --git a/src/org/mxchange/jphone/events/fax/removed/AdminFaxNumberRemovedFromListEvent.java b/src/org/mxchange/jphone/events/fax/removed/AdminFaxNumberRemovedFromListEvent.java index 8de0182..02147e5 100644 --- a/src/org/mxchange/jphone/events/fax/removed/AdminFaxNumberRemovedFromListEvent.java +++ b/src/org/mxchange/jphone/events/fax/removed/AdminFaxNumberRemovedFromListEvent.java @@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; *

* @author Roland Häder */ -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 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/ObservableAdminFaxNumberRemovedFromListEvent.java similarity index 93% rename from src/org/mxchange/jphone/events/fax/removed/AdminRemoveFaxNumberFromListEvent.java rename to src/org/mxchange/jphone/events/fax/removed/ObservableAdminFaxNumberRemovedFromListEvent.java index 37cb48d..efa789f 100644 --- a/src/org/mxchange/jphone/events/fax/removed/AdminRemoveFaxNumberFromListEvent.java +++ b/src/org/mxchange/jphone/events/fax/removed/ObservableAdminFaxNumberRemovedFromListEvent.java @@ -26,7 +26,7 @@ import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; *

* @author Roland Häder */ -public interface AdminRemoveFaxNumberFromListEvent extends Serializable { +public interface ObservableAdminFaxNumberRemovedFromListEvent extends Serializable { /** * Getter for fax numer list diff --git a/src/org/mxchange/jphone/events/fax/updated/AdminFaxNumberUpdatedEvent.java b/src/org/mxchange/jphone/events/fax/updated/AdminFaxNumberUpdatedEvent.java index 9905057..fa60783 100644 --- a/src/org/mxchange/jphone/events/fax/updated/AdminFaxNumberUpdatedEvent.java +++ b/src/org/mxchange/jphone/events/fax/updated/AdminFaxNumberUpdatedEvent.java @@ -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; *

* @author Roland Häder */ -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/ObservableAdminFaxNumberUpdatedEvent.java similarity index 93% rename from src/org/mxchange/jphone/events/fax/updated/AdminUpdatedFaxNumberEvent.java rename to src/org/mxchange/jphone/events/fax/updated/ObservableAdminFaxNumberUpdatedEvent.java index a7d53ae..2022c45 100644 --- a/src/org/mxchange/jphone/events/fax/updated/AdminUpdatedFaxNumberEvent.java +++ b/src/org/mxchange/jphone/events/fax/updated/ObservableAdminFaxNumberUpdatedEvent.java @@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; *

* @author Roland Häder */ -public interface AdminUpdatedFaxNumberEvent extends Serializable { +public interface ObservableAdminFaxNumberUpdatedEvent extends Serializable { /** * Getter for updated fax numbers diff --git a/src/org/mxchange/jphone/events/landline/created/CreatedLandLineNumberEvent.java b/src/org/mxchange/jphone/events/landline/created/CreatedLandLineNumberEvent.java index d069df6..27e75bf 100644 --- a/src/org/mxchange/jphone/events/landline/created/CreatedLandLineNumberEvent.java +++ b/src/org/mxchange/jphone/events/landline/created/CreatedLandLineNumberEvent.java @@ -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/AdminLandLineNumberDeletedEvent.java b/src/org/mxchange/jphone/events/landline/deleted/AdminLandLineNumberDeletedEvent.java index 1e6d235..55b467a 100644 --- a/src/org/mxchange/jphone/events/landline/deleted/AdminLandLineNumberDeletedEvent.java +++ b/src/org/mxchange/jphone/events/landline/deleted/AdminLandLineNumberDeletedEvent.java @@ -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; *

* @author Roland Häder */ -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/AdminDeletedLandLineNumberEvent.java b/src/org/mxchange/jphone/events/landline/deleted/ObservableAdminLandLineNumberDeletedEvent.java similarity index 93% rename from src/org/mxchange/jphone/events/landline/deleted/AdminDeletedLandLineNumberEvent.java rename to src/org/mxchange/jphone/events/landline/deleted/ObservableAdminLandLineNumberDeletedEvent.java index 72c1b4f..358c7ee 100644 --- a/src/org/mxchange/jphone/events/landline/deleted/AdminDeletedLandLineNumberEvent.java +++ b/src/org/mxchange/jphone/events/landline/deleted/ObservableAdminLandLineNumberDeletedEvent.java @@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; *

* @author Roland Häder */ -public interface AdminDeletedLandLineNumberEvent extends Serializable { +public interface ObservableAdminLandLineNumberDeletedEvent extends Serializable { /** * Getter for deleted land-line numbers diff --git a/src/org/mxchange/jphone/events/landline/removed/AdminLandLineNumberRemovedFromListEvent.java b/src/org/mxchange/jphone/events/landline/removed/AdminLandLineNumberRemovedFromListEvent.java index a58f470..478f596 100644 --- a/src/org/mxchange/jphone/events/landline/removed/AdminLandLineNumberRemovedFromListEvent.java +++ b/src/org/mxchange/jphone/events/landline/removed/AdminLandLineNumberRemovedFromListEvent.java @@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; *

* @author Roland Häder */ -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/ObservableAdminLandLineNumberRemovedFromListEvent.java similarity index 92% rename from src/org/mxchange/jphone/events/landline/removed/AdminRemoveLandLineNumberFromListEvent.java rename to src/org/mxchange/jphone/events/landline/removed/ObservableAdminLandLineNumberRemovedFromListEvent.java index 85cc674..7dac773 100644 --- a/src/org/mxchange/jphone/events/landline/removed/AdminRemoveLandLineNumberFromListEvent.java +++ b/src/org/mxchange/jphone/events/landline/removed/ObservableAdminLandLineNumberRemovedFromListEvent.java @@ -26,7 +26,7 @@ import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; *

* @author Roland Häder */ -public interface AdminRemoveLandLineNumberFromListEvent extends Serializable { +public interface ObservableAdminLandLineNumberRemovedFromListEvent extends Serializable { /** * Getter for land-line numer list diff --git a/src/org/mxchange/jphone/events/landline/updated/AdminLandLineNumberUpdatedEvent.java b/src/org/mxchange/jphone/events/landline/updated/AdminLandLineNumberUpdatedEvent.java index a3b57ef..db07df4 100644 --- a/src/org/mxchange/jphone/events/landline/updated/AdminLandLineNumberUpdatedEvent.java +++ b/src/org/mxchange/jphone/events/landline/updated/AdminLandLineNumberUpdatedEvent.java @@ -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; *

* @author Roland Häder */ -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/ObservableAdminLandLineNumberUpdatedEvent.java similarity index 93% rename from src/org/mxchange/jphone/events/landline/updated/AdminUpdatedLandLineNumberEvent.java rename to src/org/mxchange/jphone/events/landline/updated/ObservableAdminLandLineNumberUpdatedEvent.java index 1cd3207..d7e3155 100644 --- a/src/org/mxchange/jphone/events/landline/updated/AdminUpdatedLandLineNumberEvent.java +++ b/src/org/mxchange/jphone/events/landline/updated/ObservableAdminLandLineNumberUpdatedEvent.java @@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; *

* @author Roland Häder */ -public interface AdminUpdatedLandLineNumberEvent extends Serializable { +public interface ObservableAdminLandLineNumberUpdatedEvent extends Serializable { /** * Getter for updated land-line numbers diff --git a/src/org/mxchange/jphone/events/mobile/created/CreatedMobileNumberEvent.java b/src/org/mxchange/jphone/events/mobile/created/CreatedMobileNumberEvent.java index 4ba4878..a3c92a0 100644 --- a/src/org/mxchange/jphone/events/mobile/created/CreatedMobileNumberEvent.java +++ b/src/org/mxchange/jphone/events/mobile/created/CreatedMobileNumberEvent.java @@ -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/AdminMobileNumberDeletedEvent.java b/src/org/mxchange/jphone/events/mobile/deleted/AdminMobileNumberDeletedEvent.java index fd2fc01..eaf6fc6 100644 --- a/src/org/mxchange/jphone/events/mobile/deleted/AdminMobileNumberDeletedEvent.java +++ b/src/org/mxchange/jphone/events/mobile/deleted/AdminMobileNumberDeletedEvent.java @@ -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; *

* @author Roland Häder */ -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/AdminDeletedMobileNumberEvent.java b/src/org/mxchange/jphone/events/mobile/deleted/ObservableAdminMobileNumberDeletedEvent.java similarity index 93% rename from src/org/mxchange/jphone/events/mobile/deleted/AdminDeletedMobileNumberEvent.java rename to src/org/mxchange/jphone/events/mobile/deleted/ObservableAdminMobileNumberDeletedEvent.java index f86a63f..f0a7a28 100644 --- a/src/org/mxchange/jphone/events/mobile/deleted/AdminDeletedMobileNumberEvent.java +++ b/src/org/mxchange/jphone/events/mobile/deleted/ObservableAdminMobileNumberDeletedEvent.java @@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; *

* @author Roland Häder */ -public interface AdminDeletedMobileNumberEvent extends Serializable { +public interface ObservableAdminMobileNumberDeletedEvent extends Serializable { /** * Getter for deleted mobile numbers diff --git a/src/org/mxchange/jphone/events/mobile/remove/AdminMobileNumberRemovedFromListEvent.java b/src/org/mxchange/jphone/events/mobile/remove/AdminMobileNumberRemovedFromListEvent.java index 277a998..ce0e453 100644 --- a/src/org/mxchange/jphone/events/mobile/remove/AdminMobileNumberRemovedFromListEvent.java +++ b/src/org/mxchange/jphone/events/mobile/remove/AdminMobileNumberRemovedFromListEvent.java @@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; *

* @author Roland Häder */ -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 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/ObservableAdminMobileNumberRemovedFromListEvent.java similarity index 93% rename from src/org/mxchange/jphone/events/mobile/remove/AdminRemoveMobileNumberFromListEvent.java rename to src/org/mxchange/jphone/events/mobile/remove/ObservableAdminMobileNumberRemovedFromListEvent.java index cea2221..f62ebb7 100644 --- a/src/org/mxchange/jphone/events/mobile/remove/AdminRemoveMobileNumberFromListEvent.java +++ b/src/org/mxchange/jphone/events/mobile/remove/ObservableAdminMobileNumberRemovedFromListEvent.java @@ -26,7 +26,7 @@ import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; *

* @author Roland Häder */ -public interface AdminRemoveMobileNumberFromListEvent extends Serializable { +public interface ObservableAdminMobileNumberRemovedFromListEvent extends Serializable { /** * Getter for mobile numer list diff --git a/src/org/mxchange/jphone/events/mobile/updated/AdminMobileNumberUpdatedEvent.java b/src/org/mxchange/jphone/events/mobile/updated/AdminMobileNumberUpdatedEvent.java index b1dbca9..4460070 100644 --- a/src/org/mxchange/jphone/events/mobile/updated/AdminMobileNumberUpdatedEvent.java +++ b/src/org/mxchange/jphone/events/mobile/updated/AdminMobileNumberUpdatedEvent.java @@ -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; *

* @author Roland Häder */ -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/ObservableAdminMobileNumberUpdatedEvent.java similarity index 93% rename from src/org/mxchange/jphone/events/mobile/updated/AdminUpdatedMobileNumberEvent.java rename to src/org/mxchange/jphone/events/mobile/updated/ObservableAdminMobileNumberUpdatedEvent.java index 96530dd..af8b8c4 100644 --- a/src/org/mxchange/jphone/events/mobile/updated/AdminUpdatedMobileNumberEvent.java +++ b/src/org/mxchange/jphone/events/mobile/updated/ObservableAdminMobileNumberUpdatedEvent.java @@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; *

* @author Roland Häder */ -public interface AdminUpdatedMobileNumberEvent extends Serializable { +public interface ObservableAdminMobileNumberUpdatedEvent extends Serializable { /** * Getter for updated mobile numbers diff --git a/src/org/mxchange/jphone/events/mobileprovider/added/AdminMobileProviderAddedEvent.java b/src/org/mxchange/jphone/events/mobileprovider/added/AdminMobileProviderAddedEvent.java index 6328291..1345f9e 100644 --- a/src/org/mxchange/jphone/events/mobileprovider/added/AdminMobileProviderAddedEvent.java +++ b/src/org/mxchange/jphone/events/mobileprovider/added/AdminMobileProviderAddedEvent.java @@ -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; *

* @author Roland Häder */ -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/AdminAddedMobileProviderEvent.java b/src/org/mxchange/jphone/events/mobileprovider/added/ObservableAdminMobileProviderAddedEvent.java similarity index 93% rename from src/org/mxchange/jphone/events/mobileprovider/added/AdminAddedMobileProviderEvent.java rename to src/org/mxchange/jphone/events/mobileprovider/added/ObservableAdminMobileProviderAddedEvent.java index 86de879..378398b 100644 --- a/src/org/mxchange/jphone/events/mobileprovider/added/AdminAddedMobileProviderEvent.java +++ b/src/org/mxchange/jphone/events/mobileprovider/added/ObservableAdminMobileProviderAddedEvent.java @@ -24,7 +24,7 @@ import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider; *

* @author Roland Häder */ -public interface AdminAddedMobileProviderEvent extends Serializable { +public interface ObservableAdminMobileProviderAddedEvent extends Serializable { /** * Getter for added mobile provider -- 2.39.5