]> git.mxchange.org Git - jphone-core.git/blob - src/org/mxchange/jphone/exceptions/phone/PhoneNumberNotLinkedException.java
Updated copyright year
[jphone-core.git] / src / org / mxchange / jphone / exceptions / phone / PhoneNumberNotLinkedException.java
1 /*
2  * Copyright (C) 2016 - 2024 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
23 /**
24  * An exception thrown when a fax or land-line number is not linked but should
25  * be.
26  * <p>
27  * @author Roland Häder<roland@mxchange.org>
28  */
29 public class PhoneNumberNotLinkedException extends Exception {
30
31         /**
32          * Serial number
33          */
34         private static final long serialVersionUID = 18_964_581_681_985_599L;
35
36         /**
37          * Constructor with fax number
38          * <p>
39          * @param faxNumber Fax number
40          */
41         public PhoneNumberNotLinkedException (final DialableFaxNumber faxNumber) {
42                 // Call super constructor with message
43                 super(MessageFormat.format("faxNumber={0} with phoneId={1} is not linked.", faxNumber, faxNumber.getPhoneId())); //NOI18N
44         }
45
46         /**
47          * Constructor with landLine number
48          * <p>
49          * @param landLineNumber Land-line number
50          */
51         public PhoneNumberNotLinkedException (final DialableLandLineNumber landLineNumber) {
52                 // Call super constructor with message
53                 super(MessageFormat.format("landLineNumber={0} with phoneId={1} is not linked.", landLineNumber, landLineNumber.getPhoneId())); //NOI18N
54         }
55
56 }