]> git.mxchange.org Git - jphone-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 15 Apr 2020 20:48:17 +0000 (22:48 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 15 Apr 2020 20:48:17 +0000 (22:48 +0200)
- added exception for non-existing mobile number

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jphone/exceptions/mobile/MobileEntityNotFoundException.java [new file with mode: 0644]

diff --git a/src/org/mxchange/jphone/exceptions/mobile/MobileEntityNotFoundException.java b/src/org/mxchange/jphone/exceptions/mobile/MobileEntityNotFoundException.java
new file mode 100644 (file)
index 0000000..fe2a455
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.exceptions.mobile;
+
+import java.text.MessageFormat;
+
+/**
+ * An exception thrown when a mobile entity is not found.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class MobileEntityNotFoundException extends Exception {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 18_964_581_681_985_600L;
+
+       /**
+        * Constructor with id number and causing exception
+        * <p>
+        * @param mobileId Id number that has no corresponding entity
+        * @param cause    Causing exception
+        */
+       public MobileEntityNotFoundException (final Long mobileId, final Throwable cause) {
+               // Construct message and call super constructor
+               super(MessageFormat.format("Mobile entity with id {0} not found.", mobileId), cause); //NOI18N
+       }
+
+       /**
+        * Constructor with id number
+        * <p>
+        * @param mobileId Id number that has no corresponding entity
+        */
+       public MobileEntityNotFoundException (final Long mobileId) {
+               // Construct message and call super constructor
+               super(MessageFormat.format("Mobile entity with id {0} not found.", mobileId)); //NOI18N
+       }
+
+}