2 * Copyright (C) 2016 - 2024 Free Software Foundation
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jphone.events.landline.updated;
19 import java.text.MessageFormat;
20 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
23 * An event when a mobile number has been updated
25 * @author Roland Häder<roland@mxchange.org>
27 public class AdminLandLineNumberUpdatedEvent implements ObservableAdminLandLineNumberUpdatedEvent {
32 private static final long serialVersionUID = 18_521_758_718_691_064L;
35 * Updated mobile provider instance
37 private final DialableLandLineNumber updatedLandLineNumber;
40 * Constructor with updated mobile number
42 * @param updatedLandLineNumber Updated mobile number
44 public AdminLandLineNumberUpdatedEvent (final DialableLandLineNumber updatedLandLineNumber) {
46 if (null == updatedLandLineNumber) {
48 throw new NullPointerException("Parameter 'updatedLandLineNumber' is null"); //NOI18M
49 } else if (updatedLandLineNumber.getPhoneId() == null) {
51 throw new NullPointerException("updatedLandLineNumber.phoneId is null"); //NOI18M
52 } else if (updatedLandLineNumber.getPhoneId() < 1) {
54 throw new IllegalArgumentException(MessageFormat.format("updatedLandLineNumber.phoneId={0} is invalid", updatedLandLineNumber.getPhoneId())); //NOI18M
55 } else if (updatedLandLineNumber.getPhoneAreaCode() == null) {
57 throw new NullPointerException("updatedLandLineNumber.phoneAreaCode is null"); //NOI18M
58 } else if (updatedLandLineNumber.getPhoneAreaCode() < 1) {
60 throw new IllegalArgumentException(MessageFormat.format("updatedLandLineNumber.phoneAreaCode={0} is invalid", updatedLandLineNumber.getPhoneAreaCode())); //NOI18M
61 } else if (updatedLandLineNumber.getPhoneNumber() == null) {
63 throw new NullPointerException("updatedLandLineNumber.phoneNumber is null"); //NOI18M
64 } else if (updatedLandLineNumber.getPhoneNumber() < 1) {
66 throw new IllegalArgumentException(MessageFormat.format("updatedLandLineNumber.phoneNumber={0} is invalid", updatedLandLineNumber.getPhoneNumber())); //NOI18M
67 } else if (updatedLandLineNumber.getPhoneCountry() == null) {
69 throw new NullPointerException("updatedLandLineNumber.phoneCountry is null"); //NOI18M
70 } else if (updatedLandLineNumber.getPhoneCountry().getCountryId() == null) {
72 throw new NullPointerException("updatedLandLineNumber.phoneCountry.countryId is null"); //NOI18M
73 } else if (updatedLandLineNumber.getPhoneCountry().getCountryId() < 1) {
75 throw new NullPointerException(MessageFormat.format("updatedLandLineNumber.phoneCountry.countryId={0} is invalid", updatedLandLineNumber.getPhoneCountry().getCountryId())); //NOI18M
79 this.updatedLandLineNumber = updatedLandLineNumber;
83 public DialableLandLineNumber getUpdatedLandLineNumber () {
84 return this.updatedLandLineNumber;