2 * Copyright (C) 2016 - 2018 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;
22 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
25 * An exception thrown when a fax, land-line or mobile number is not linked but
28 * @author Roland Häder<roland@mxchange.org>
30 public class PhoneNumberAlreadyLinkedException extends Exception {
35 private static final long serialVersionUID = 18_964_581_681_985_598L;
38 * Counstructor with fax number
40 * @param faxNumber Fax number
42 public PhoneNumberAlreadyLinkedException (final DialableFaxNumber faxNumber) {
43 // Call super constructor with message
44 super(MessageFormat.format("faxNumber={0} with phoneId={1} cannot be linked, link target has already fax number linked.", faxNumber, faxNumber.getPhoneId())); //NOI18N
48 * Counstructor with landLine number
50 * @param landLineNumber Land-line number
52 public PhoneNumberAlreadyLinkedException (final DialableLandLineNumber landLineNumber) {
53 // Call super constructor with message
54 super(MessageFormat.format("landLineNumber={0} with phoneId={1} cannot be linked, link target has already land-line number linked.", landLineNumber, landLineNumber.getPhoneId())); //NOI18N
58 * Counstructor with mobile number
60 * @param mobileNumber Mobile number
62 public PhoneNumberAlreadyLinkedException (final DialableMobileNumber mobileNumber) {
63 // Call super constructor with message
64 super(MessageFormat.format("mobileNumber={0} with phoneId={1} cannot be linked, link target has already mobile number linked.", mobileNumber, mobileNumber.getPhoneId())); //NOI18N