]> git.mxchange.org Git - jcontacts-core.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Fri, 2 Oct 2015 10:00:43 +0000 (12:00 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 2 Oct 2015 10:00:43 +0000 (12:00 +0200)
- moved exception from jcore
- updated project name and imports
Signed-off-by:Roland Häder <roland@mxchange.org>

dist.sh
src/org/mxchange/jcontacts/contact/gender/GenderUtils.java
src/org/mxchange/jcontacts/exceptions/ContactAlreadyAddedException.java [new file with mode: 0644]

diff --git a/dist.sh b/dist.sh
index 91a23db53bca8d891780bcbbef9fcec4add1f8d0..e06bc9a2a851eba0796525eb0cd728b79479e1b2 100644 (file)
--- a/dist.sh
+++ b/dist.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-NAME="jcontacts"
+NAME="jcontacts-core"
 LIST=`find ../*/lib/${NAME}.jar`
 LIST="${LIST} `find ../*/*-ejb/lib/${NAME}.jar`"
 
index 2af62dc640d8472afe34f3dc7ae25dfb020b9cef..99d1d646c31c018afcbd6c68fb35a9ab7c6aa4ff 100644 (file)
@@ -19,8 +19,8 @@ package org.mxchange.jcontacts.contact.gender;
 import java.text.MessageFormat;
 import java.util.LinkedList;
 import java.util.List;
-import org.mxchange.jcore.BaseFrameworkSystem;
 import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcore.BaseFrameworkSystem;
 
 /**
  * Gender utils class
diff --git a/src/org/mxchange/jcontacts/exceptions/ContactAlreadyAddedException.java b/src/org/mxchange/jcontacts/exceptions/ContactAlreadyAddedException.java
new file mode 100644 (file)
index 0000000..1b8e63d
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2015 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 <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcontacts.exceptions;
+
+import java.text.MessageFormat;
+import org.mxchange.jcontacts.contact.Contact;
+
+/**
+ * Thrown if the given Contact instance is already added
+ * <p>
+ * @author Roland Haeder
+ */
+public class ContactAlreadyAddedException extends Exception {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 75844851467L;
+
+       /**
+        * Constructor with a Contact instance
+        * <p>
+        * @param contact Contact that is already added
+        */
+       public ContactAlreadyAddedException (final Contact contact) {
+               super(MessageFormat.format("Contact with gender={0}, firstName={1} and familyName={2} already added.", contact.getGender(), contact.getFirstName(), contact.getFamilyName()));
+       }
+
+       /**
+        * Default constructor, may be used if no contact instance is available
+        */
+       public ContactAlreadyAddedException () {
+               super("Contact already added");
+       }
+
+}