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.deleted;
19 import java.text.MessageFormat;
20 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
23 * An event when a land-line number has been deleted
25 * @author Roland Häder<roland@mxchange.org>
27 public class AdminLandLineNumberDeletedEvent implements ObservableAdminLandLineNumberDeletedEvent {
32 private static final long serialVersionUID = 18_521_758_718_691_064L;
35 * Updated land-line number
37 private final DialableLandLineNumber deletedLandLineNumber;
40 * Constructor with deleted land-line number
42 * @param deletedLandLineNumber Deleted land-line number
44 public AdminLandLineNumberDeletedEvent (final DialableLandLineNumber deletedLandLineNumber) {
46 if (null == deletedLandLineNumber) {
48 throw new NullPointerException("Parameter 'deletedLandLineNumber' is null"); //NOI18M
49 } else if (deletedLandLineNumber.getPhoneId() == null) {
51 throw new NullPointerException("deletedLandLineNumber.phoneId is null"); //NOI18M
52 } else if (deletedLandLineNumber.getPhoneId() < 1) {
54 throw new IllegalArgumentException(MessageFormat.format("deletedLandLineNumber.phoneId={0} is invalid", deletedLandLineNumber.getPhoneId())); //NOI18M
55 } else if (deletedLandLineNumber.getPhoneAreaCode() == null) {
57 throw new NullPointerException("deletedLandLineNumber.phoneAreaCode is null"); //NOI18M
58 } else if (deletedLandLineNumber.getPhoneAreaCode() < 1) {
60 throw new IllegalArgumentException(MessageFormat.format("deletedLandLineNumber.phoneAreaCode={0} is invalid", deletedLandLineNumber.getPhoneAreaCode())); //NOI18M
61 } else if (deletedLandLineNumber.getPhoneNumber() == null) {
63 throw new NullPointerException("deletedLandLineNumber.phoneNumber is null"); //NOI18M
64 } else if (deletedLandLineNumber.getPhoneNumber() < 1) {
66 throw new IllegalArgumentException(MessageFormat.format("deletedLandLineNumber.phoneNumber={0} is invalid", deletedLandLineNumber.getPhoneNumber())); //NOI18M
67 } else if (deletedLandLineNumber.getPhoneCountry() == null) {
69 throw new NullPointerException("deletedLandLineNumber.phoneCountry is null"); //NOI18M
70 } else if (deletedLandLineNumber.getPhoneCountry().getCountryId() == null) {
72 throw new NullPointerException("deletedLandLineNumber.phoneCountry.countryId is null"); //NOI18M
73 } else if (deletedLandLineNumber.getPhoneCountry().getCountryId() < 1) {
75 throw new NullPointerException(MessageFormat.format("deletedLandLineNumber.phoneCountry.countryId={0} is invalid", deletedLandLineNumber.getPhoneCountry().getCountryId())); //NOI18M
79 this.deletedLandLineNumber = deletedLandLineNumber;
83 public DialableLandLineNumber getDeletedLandLineNumber () {
84 return this.deletedLandLineNumber;