From: Roland Haeder Date: Fri, 2 Oct 2015 10:00:43 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fa0908441bbb34bd7ec69faa68ce0869105a4200;p=jcontacts-core.git Continued: - moved exception from jcore - updated project name and imports Signed-off-by:Roland Häder --- diff --git a/dist.sh b/dist.sh index 91a23db..e06bc9a 100644 --- 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`" diff --git a/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java b/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java index 2af62dc..99d1d64 100644 --- a/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java +++ b/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java @@ -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 index 0000000..1b8e63d --- /dev/null +++ b/src/org/mxchange/jcontacts/exceptions/ContactAlreadyAddedException.java @@ -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 . + */ +package org.mxchange.jcontacts.exceptions; + +import java.text.MessageFormat; +import org.mxchange.jcontacts.contact.Contact; + +/** + * Thrown if the given Contact instance is already added + *

+ * @author Roland Haeder + */ +public class ContactAlreadyAddedException extends Exception { + + /** + * Serial number + */ + private static final long serialVersionUID = 75844851467L; + + /** + * Constructor with a Contact instance + *

+ * @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"); + } + +}