From: Roland Häder Date: Fri, 24 Apr 2020 00:03:34 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0c2370c287feff770ff58bd2f7a09378eb8f9f3b;p=jphone-core.git Continued: - splitted further phone <-> mobile numbers Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jphone/exceptions/mobile/MobileNumberAlreadyLinkedException.java b/src/org/mxchange/jphone/exceptions/mobile/MobileNumberAlreadyLinkedException.java new file mode 100644 index 0000000..226d437 --- /dev/null +++ b/src/org/mxchange/jphone/exceptions/mobile/MobileNumberAlreadyLinkedException.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2016 - 2020 Free Software Foundation + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.exceptions.mobile; + +import java.text.MessageFormat; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; + +/** + * An exception thrown when a mobile number is not linked but should be. + *

+ * @author Roland Häder + */ +public class MobileNumberAlreadyLinkedException extends Exception { + + /** + * Serial number + */ + private static final long serialVersionUID = 18_964_581_681_985_601L; + + /** + * Constructor with mobile number + *

+ * @param mobileNumber Mobile number + */ + public MobileNumberAlreadyLinkedException (final DialableMobileNumber mobileNumber) { + // Call super constructor with message + super(MessageFormat.format("mobileNumber={0} with phoneId={1} cannot be linked, link target has already mobile number linked.", mobileNumber, mobileNumber.getMobileId())); //NOI18N + } + +} diff --git a/src/org/mxchange/jphone/exceptions/mobile/MobileNumberNotLinkedException.java b/src/org/mxchange/jphone/exceptions/mobile/MobileNumberNotLinkedException.java new file mode 100644 index 0000000..d19ce9a --- /dev/null +++ b/src/org/mxchange/jphone/exceptions/mobile/MobileNumberNotLinkedException.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2016 - 2020 Free Software Foundation + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.exceptions.mobile; + +import java.text.MessageFormat; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; + +/** + * An exception thrown when a mobile number is not linked but should be. + *

+ * @author Roland Häder + */ +public class MobileNumberNotLinkedException extends Exception { + + /** + * Serial number + */ + private static final long serialVersionUID = 18_964_581_681_985_602L; + + /** + * Constructor with mobile number + *

+ * @param mobileNumber Mobile number + */ + public MobileNumberNotLinkedException (final DialableMobileNumber mobileNumber) { + // Call super constructor with message + super(MessageFormat.format("mobileNumber={0} with phoneId={1} is not linked.", mobileNumber, mobileNumber.getMobileId())); //NOI18N + } + +} diff --git a/src/org/mxchange/jphone/exceptions/phone/PhoneNumberAlreadyLinkedException.java b/src/org/mxchange/jphone/exceptions/phone/PhoneNumberAlreadyLinkedException.java index 7aea5a0..017e2d4 100644 --- a/src/org/mxchange/jphone/exceptions/phone/PhoneNumberAlreadyLinkedException.java +++ b/src/org/mxchange/jphone/exceptions/phone/PhoneNumberAlreadyLinkedException.java @@ -19,11 +19,10 @@ package org.mxchange.jphone.exceptions.phone; import java.text.MessageFormat; import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; /** - * An exception thrown when a fax, land-line or mobile number is not linked but - * should be. + * An exception thrown when a fax or land-linenumber is not linked but should + * be. *

* @author Roland Häder */ @@ -54,14 +53,4 @@ public class PhoneNumberAlreadyLinkedException extends Exception { super(MessageFormat.format("landLineNumber={0} with phoneId={1} cannot be linked, link target has already land-line number linked.", landLineNumber, landLineNumber.getPhoneId())); //NOI18N } - /** - * Constructor with mobile number - *

- * @param mobileNumber Mobile number - */ - public PhoneNumberAlreadyLinkedException (final DialableMobileNumber mobileNumber) { - // Call super constructor with message - super(MessageFormat.format("mobileNumber={0} with phoneId={1} cannot be linked, link target has already mobile number linked.", mobileNumber, mobileNumber.getMobileId())); //NOI18N - } - } diff --git a/src/org/mxchange/jphone/exceptions/phone/PhoneNumberNotLinkedException.java b/src/org/mxchange/jphone/exceptions/phone/PhoneNumberNotLinkedException.java index dc8211c..ad5b4f3 100644 --- a/src/org/mxchange/jphone/exceptions/phone/PhoneNumberNotLinkedException.java +++ b/src/org/mxchange/jphone/exceptions/phone/PhoneNumberNotLinkedException.java @@ -19,11 +19,10 @@ package org.mxchange.jphone.exceptions.phone; import java.text.MessageFormat; import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; /** - * An exception thrown when a fax, land-line or mobile number is not linked but - * should be. + * An exception thrown when a fax or land-line number is not linked but should + * be. *

* @author Roland Häder */ @@ -54,14 +53,4 @@ public class PhoneNumberNotLinkedException extends Exception { super(MessageFormat.format("landLineNumber={0} with phoneId={1} is not linked.", landLineNumber, landLineNumber.getPhoneId())); //NOI18N } - /** - * Constructor with mobile number - *

- * @param mobileNumber Mobile number - */ - public PhoneNumberNotLinkedException (final DialableMobileNumber mobileNumber) { - // Call super constructor with message - super(MessageFormat.format("mobileNumber={0} with phoneId={1} is not linked.", mobileNumber, mobileNumber.getMobileId())); //NOI18N - } - }