From fa0908441bbb34bd7ec69faa68ce0869105a4200 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 2 Oct 2015 12:00:43 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20moved=20exception=20from=20jcor?= =?utf8?q?e=20-=20updated=20project=20name=20and=20imports=20Signed-off-by?= =?utf8?q?:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- dist.sh | 2 +- .../jcontacts/contact/gender/GenderUtils.java | 2 +- .../ContactAlreadyAddedException.java | 50 +++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 src/org/mxchange/jcontacts/exceptions/ContactAlreadyAddedException.java 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"); + } + +} -- 2.39.5