]> git.mxchange.org Git - jphone-core.git/blob - src/org/mxchange/jphone/exceptions/phone/PhoneNumberNotLinkedException.java
Changed copyright notice to the FSF, so after my death they will continue my
[jphone-core.git] / src / org / mxchange / jphone / exceptions / phone / PhoneNumberNotLinkedException.java
1 /*
2  * Copyright (C) 2016, 2017 Free Software Foundation
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.jphone.exceptions.phone;
18
19 import java.text.MessageFormat;
20 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
21 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
22 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
23
24 /**
25  * An exception thrown when a fax, land-line or mobile number is not linked but
26  * should be.
27  * <p>
28  * @author Roland Häder<roland@mxchange.org>
29  */
30 public class PhoneNumberNotLinkedException extends Exception {
31
32         /**
33          * Serial number
34          */
35         private static final long serialVersionUID = 18_964_581_681_985_599L;
36
37         /**
38          * Counstructor with fax number
39          * <p>
40          * @param faxNumber Fax number
41          */
42         public PhoneNumberNotLinkedException (final DialableFaxNumber faxNumber) {
43                 // Call super constructor with message
44                 super(MessageFormat.format("faxNumber={0} with phoneId={1} is not linked.", faxNumber, faxNumber.getPhoneId())); //NOI18N
45         }
46
47         /**
48                 * Counstructor with landLine number
49          * <p>
50          * @param landLineNumber Land-line number
51          */
52         public PhoneNumberNotLinkedException (final DialableLandLineNumber landLineNumber) {
53                 // Call super constructor with message
54                 super(MessageFormat.format("landLineNumber={0} with phoneId={1} is not linked.", landLineNumber, landLineNumber.getPhoneId())); //NOI18N
55         }
56
57         /**
58          * Counstructor with mobile number
59          * <p>
60          * @param mobileNumber Mobile number
61          */
62         public PhoneNumberNotLinkedException (final DialableMobileNumber mobileNumber) {
63                 // Call super constructor with message
64                 super(MessageFormat.format("mobileNumber={0} with phoneId={1} is not linked.", mobileNumber, mobileNumber.getPhoneId())); //NOI18N
65         }
66
67 }