*/
package org.mxchange.jphone.events.fax.created;
+import java.text.MessageFormat;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
/**
* @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;
}
+++ /dev/null
-/*
- * 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 ();
-
-}
*/
package org.mxchange.jphone.events.fax.deleted;
+import java.text.MessageFormat;
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
* @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;
}
--- /dev/null
+/*
+ * 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 ();
+
+}
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-public class AdminFaxNumberRemovedFromListEvent implements AdminRemoveFaxNumberFromListEvent {
+public class AdminFaxNumberRemovedFromListEvent implements ObservableAdminFaxNumberRemovedFromListEvent {
/**
* Serial number
* @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;
}
+++ /dev/null
-/*
- * 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 ();
-
-}
--- /dev/null
+/*
+ * 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 ();
+
+}
*/
package org.mxchange.jphone.events.fax.updated;
+import java.text.MessageFormat;
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
* @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;
}
+++ /dev/null
-/*
- * 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 ();
-
-}
--- /dev/null
+/*
+ * 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 ();
+
+}
*/
package org.mxchange.jphone.events.landline.created;
+import java.text.MessageFormat;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
* @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;
}
+++ /dev/null
-/*
- * 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 ();
-
-}
*/
package org.mxchange.jphone.events.landline.deleted;
+import java.text.MessageFormat;
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
* @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;
}
--- /dev/null
+/*
+ * 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 ();
+
+}
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-public class AdminLandLineNumberRemovedFromListEvent implements AdminRemoveLandLineNumberFromListEvent {
+public class AdminLandLineNumberRemovedFromListEvent implements ObservableAdminLandLineNumberRemovedFromListEvent {
/**
* Serial number
+++ /dev/null
-/*
- * 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 ();
-
-}
--- /dev/null
+/*
+ * 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 ();
+
+}
*/
package org.mxchange.jphone.events.landline.updated;
+import java.text.MessageFormat;
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
* @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;
}
+++ /dev/null
-/*
- * 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 ();
-
-}
--- /dev/null
+/*
+ * 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 ();
+
+}
*/
package org.mxchange.jphone.events.mobile.created;
+import java.text.MessageFormat;
import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* @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;
}
+++ /dev/null
-/*
- * 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 ();
-
-}
*/
package org.mxchange.jphone.events.mobile.deleted;
+import java.text.MessageFormat;
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
* @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;
}
--- /dev/null
+/*
+ * 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 ();
+
+}
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-public class AdminMobileNumberRemovedFromListEvent implements AdminRemoveMobileNumberFromListEvent {
+public class AdminMobileNumberRemovedFromListEvent implements ObservableAdminMobileNumberRemovedFromListEvent {
/**
* Serial number
* @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;
}
+++ /dev/null
-/*
- * 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 ();
-
-}
--- /dev/null
+/*
+ * 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 ();
+
+}
*/
package org.mxchange.jphone.events.mobile.updated;
+import java.text.MessageFormat;
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
* @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;
}
+++ /dev/null
-/*
- * 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 ();
-
-}
--- /dev/null
+/*
+ * 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 ();
+
+}
+++ /dev/null
-/*
- * 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 ();
-
-}
*/
package org.mxchange.jphone.events.mobileprovider.added;
+import java.text.MessageFormat;
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
* @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;
}
--- /dev/null
+/*
+ * 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 ();
+
+}