2 * Copyright (C) 2016 - 2020 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.exceptions.phone;
19 import java.text.MessageFormat;
20 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
21 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
24 * An exception thrown when a fax or land-line number is not linked but should
27 * @author Roland Häder<roland@mxchange.org>
29 public class PhoneNumberNotLinkedException extends Exception {
34 private static final long serialVersionUID = 18_964_581_681_985_599L;
37 * Constructor with fax number
39 * @param faxNumber Fax number
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
47 * Constructor with landLine number
49 * @param landLineNumber Land-line number
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