From 504eec1d2b7094edf5e64839616463bc3ae5911f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 10 Aug 2016 17:10:35 +0200 Subject: [PATCH] added new exception --- .../CellphoneNotLinkedException.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/org/mxchange/jphone/exceptions/CellphoneNotLinkedException.java diff --git a/src/org/mxchange/jphone/exceptions/CellphoneNotLinkedException.java b/src/org/mxchange/jphone/exceptions/CellphoneNotLinkedException.java new file mode 100644 index 0000000..037b0bb --- /dev/null +++ b/src/org/mxchange/jphone/exceptions/CellphoneNotLinkedException.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.cellphone.DialableCellphoneNumber; + +/** + * An exception thrown when a cell phone number is not linked but should be. + *

+ * @author Roland Haeder + */ +public class CellphoneNotLinkedException extends Exception { + + /** + * Serial number + */ + private static final long serialVersionUID = 18_964_581_681_985_597L; + + /** + * Counstructor with cell phone instance + *

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