From: Roland Häder Date: Wed, 17 Aug 2016 13:14:39 +0000 (+0200) Subject: Contined a bit: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d862a496a9d0c1949fe5f6c91590bf91dfc68adc;p=jphone-core.git Contined a bit: - added exceptions for not-linked fax/land-line numbers - renamed cellphone -> mobile --- diff --git a/src/org/mxchange/jphone/exceptions/FaxNumberNotLinkedException.java b/src/org/mxchange/jphone/exceptions/FaxNumberNotLinkedException.java new file mode 100644 index 0000000..971f8c8 --- /dev/null +++ b/src/org/mxchange/jphone/exceptions/FaxNumberNotLinkedException.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * 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; + +import java.text.MessageFormat; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; + +/** + * An exception thrown when a fax number is not linked but should be. + *

+ * @author Roland Haeder + */ +public class FaxNumberNotLinkedException extends Exception { + + /** + * Serial number + */ + private static final long serialVersionUID = 18_964_581_681_985_599L; + + /** + * Counstructor with fax number + *

+ * @param faxNumber Fax number + */ + public FaxNumberNotLinkedException (final DialableFaxNumber faxNumber) { + // Call super constructor with message + super(MessageFormat.format("faxNumber={0} with phoneId={1} is not linked.", faxNumber, faxNumber.getPhoneId())); //NOI18N + } + +} diff --git a/src/org/mxchange/jphone/exceptions/LandLineNumberNotLinkedException.java b/src/org/mxchange/jphone/exceptions/LandLineNumberNotLinkedException.java new file mode 100644 index 0000000..3fc798b --- /dev/null +++ b/src/org/mxchange/jphone/exceptions/LandLineNumberNotLinkedException.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * 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; + +import java.text.MessageFormat; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; + +/** + * An exception thrown when a land-line number is not linked but should be. + *

+ * @author Roland Haeder + */ +public class LandLineNumberNotLinkedException extends Exception { + + /** + * Serial number + */ + private static final long serialVersionUID = 18_964_581_681_985_598L; + + /** + * Counstructor with land-line number + *

+ * @param landLineNumber Cell phone number + */ + public LandLineNumberNotLinkedException (final DialableLandLineNumber landLineNumber) { + // Call super constructor with message + super(MessageFormat.format("landLineNumber={0} with phoneId={1} is not linked.", landLineNumber, landLineNumber.getPhoneId())); //NOI18N + } + +} diff --git a/src/org/mxchange/jphone/exceptions/MobileNumberNotLinkedException.java b/src/org/mxchange/jphone/exceptions/MobileNumberNotLinkedException.java index 4b959db..fefe450 100644 --- a/src/org/mxchange/jphone/exceptions/MobileNumberNotLinkedException.java +++ b/src/org/mxchange/jphone/exceptions/MobileNumberNotLinkedException.java @@ -20,7 +20,7 @@ import java.text.MessageFormat; import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; /** - * An exception thrown when a cell phone number is not linked but should be. + * An exception thrown when a mobile number is not linked but should be. *

* @author Roland Haeder */ @@ -32,13 +32,13 @@ public class MobileNumberNotLinkedException extends Exception { private static final long serialVersionUID = 18_964_581_681_985_597L; /** - * Counstructor with cell phone instance + * Counstructor with mobile number *

- * @param cellphoneNumber Cell phone instance + * @param mobileNumber Mobile number */ - public MobileNumberNotLinkedException (final DialableMobileNumber cellphoneNumber) { + public MobileNumberNotLinkedException (final DialableMobileNumber mobileNumber) { // Call super constructor with message - super(MessageFormat.format("cellphoneNumber={0} with phoneId={1} is not linked.", cellphoneNumber, cellphoneNumber.getPhoneId())); //NOI18N + super(MessageFormat.format("mobileNumber={0} with phoneId={1} is not linked.", mobileNumber, mobileNumber.getPhoneId())); //NOI18N } }