From 23b4c17cd3e407ea28c8c5269e44b00aca4bf680 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 20 Jan 2023 03:37:17 +0100 Subject: [PATCH] Continued: - fixed some imports and names --- .../addressbook/client/AddressbookClient.java | 17 ++++---- .../client/console/ConsoleClient.java | 40 +++++++++---------- .../contact/AddressbookContactFacade.java | 21 +++++----- .../facade/contact/ContactFacade.java | 20 +++++----- 4 files changed, 46 insertions(+), 52 deletions(-) diff --git a/src/org/mxchange/addressbook/client/AddressbookClient.java b/src/org/mxchange/addressbook/client/AddressbookClient.java index 82cbec2..c2c2b6b 100644 --- a/src/org/mxchange/addressbook/client/AddressbookClient.java +++ b/src/org/mxchange/addressbook/client/AddressbookClient.java @@ -17,8 +17,8 @@ package org.mxchange.addressbook.client; import org.mxchange.addressbook.menu.item.SelectableMenuItem; -import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jcontacts.contact.title.PersonalTitle; +import org.mxchange.jcontacts.model.contact.Contact; +import org.mxchange.jcontacts.model.contact.title.PersonalTitle; import org.mxchange.jcore.client.Client; import org.mxchange.jcore.exceptions.MenuInitializationException; import org.mxchange.jcore.exceptions.UnhandledUserChoiceException; @@ -99,14 +99,15 @@ public interface AddressbookClient extends Client { * Asks the the user to enter a single character which must match validChars *

* @param validChars Valid chars that are accepted - * @param message Message to user + * @param message Message to user *

* @return Allowed character */ char enterChar (final char[] validChars, final String message); /** - * Asks the user to enter his/her personal title (M=Male, F=Female, C=Company) + * Asks the user to enter his/her personal title (M=Male, F=Female, + * C=Company) *

* @param message Message to output *

@@ -130,9 +131,9 @@ public interface AddressbookClient extends Client { * string should be generally not allowed, but might be okay for e.g. * company name. *

- * @param minLength Minimum length of the string to read - * @param maxLength Maximum length of the string to read - * @param message Message to user + * @param minLength Minimum length of the string to read + * @param maxLength Maximum length of the string to read + * @param message Message to user * @param allowEmpty Whether empty strings are allowed *

* @return Entered string by user or null if empty string is allowed @@ -150,7 +151,7 @@ public interface AddressbookClient extends Client { * Some "Getter" for menu item *

* @param accessKey Key to press to access this menu - * @param text Text to show to user + * @param text Text to show to user *

* @return */ diff --git a/src/org/mxchange/addressbook/client/console/ConsoleClient.java b/src/org/mxchange/addressbook/client/console/ConsoleClient.java index e03fc3c..baf7955 100644 --- a/src/org/mxchange/addressbook/client/console/ConsoleClient.java +++ b/src/org/mxchange/addressbook/client/console/ConsoleClient.java @@ -30,18 +30,14 @@ import org.mxchange.addressbook.menu.MenuTools; import org.mxchange.addressbook.menu.console.ConsoleMenu; import org.mxchange.addressbook.menu.item.SelectableMenuItem; import org.mxchange.addressbook.menu.item.console.ConsoleMenuItem; -import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jcontacts.contact.UserContact; -import org.mxchange.jcontacts.contact.title.PersonalTitle; -import org.mxchange.jcontacts.contact.title.PersonalTitleUtils; -import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataAlreadyAddedException; +import org.mxchange.jcontacts.model.contact.Contact; +import org.mxchange.jcontacts.model.contact.UserContact; +import org.mxchange.jcontacts.model.contact.title.PersonalTitle; +import org.mxchange.jcontacts.model.utils.PersonalTitleUtils; +import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataAlreadyAddedException; import org.mxchange.jcore.application.Application; import org.mxchange.jcore.exceptions.MenuInitializationException; import org.mxchange.jcore.exceptions.UnhandledUserChoiceException; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; /** * A client for the console @@ -315,13 +311,13 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC switch (choice) { case '1': try { - // Enter/add own data - manager.doEnterOwnData(); - } catch (final BusinessDataAlreadyAddedException ex) { - // Already added - this.outputMessage("Sie haben bereits Ihre eigenen Daten eingegeben."); - } - break; + // Enter/add own data + manager.doEnterOwnData(); + } catch (final BasicDataAlreadyAddedException ex) { + // Already added + this.outputMessage("Sie haben bereits Ihre eigenen Daten eingegeben."); + } + break; case '2': // Change own data manager.doChangeOwnData(); @@ -349,12 +345,12 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC case '0': try { - // Program exit - this.getApplication().doShutdown(); - } catch (final SQLException | IOException ex) { - this.abortProgramWithException(ex); - } - break; + // Program exit + this.getApplication().doShutdown(); + } catch (final SQLException | IOException ex) { + this.abortProgramWithException(ex); + } + break; default: // TODO throw own exception diff --git a/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java b/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java index 5edd988..b2675c6 100644 --- a/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java +++ b/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java @@ -24,18 +24,17 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; import org.mxchange.addressbook.client.AddressbookClient; -import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jcontacts.contact.title.PersonalTitle; -import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataAlreadyAddedException; +import org.mxchange.jcontacts.model.contact.Contact; +import org.mxchange.jcontacts.model.contact.title.PersonalTitle; +import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataAlreadyAddedException; import org.mxchange.jcore.client.Client; import org.mxchange.jcore.exceptions.UnhandledUserChoiceException; import org.mxchange.jcore.facade.BaseFacade; import org.mxchange.jcoreeelogger.beans.local.logger.Log; import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; /** * A facade for contacts. @@ -94,7 +93,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } @Override - public void addContact (final Contact contact) throws BusinessDataAlreadyAddedException { + public void addContact (final Contact contact) throws BasicDataAlreadyAddedException { // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N @@ -261,14 +260,14 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } @Override - public void doEnterOwnData () throws BusinessDataAlreadyAddedException { + public void doEnterOwnData () throws BasicDataAlreadyAddedException { // Trace message this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N // Is own contact already added? if (this.isOwnContactAdded()) { // Don't continue here - throw new BusinessDataAlreadyAddedException(); + throw new BasicDataAlreadyAddedException(); } // Get and cast client instance @@ -533,7 +532,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad // Add contact to internal list this.addContact(contact); - } catch (final BusinessDataAlreadyAddedException ex) { + } catch (final BasicDataAlreadyAddedException ex) { // Abort here this.abortProgramWithException(ex); } diff --git a/src/org/mxchange/addressbook/facade/contact/ContactFacade.java b/src/org/mxchange/addressbook/facade/contact/ContactFacade.java index 73e192d..ab7a02b 100644 --- a/src/org/mxchange/addressbook/facade/contact/ContactFacade.java +++ b/src/org/mxchange/addressbook/facade/contact/ContactFacade.java @@ -17,15 +17,15 @@ package org.mxchange.addressbook.facade.contact; import java.io.IOException; -import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jcontacts.contact.title.PersonalTitle; import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException; -import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataAlreadyAddedException; +import org.mxchange.jcontacts.model.contact.Contact; +import org.mxchange.jcontacts.model.contact.title.PersonalTitle; +import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataAlreadyAddedException; import org.mxchange.jcore.facade.Facade; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jcountry.model.data.Country; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; /** * An interface for addressbook contact manager @@ -39,11 +39,9 @@ public interface ContactFacade extends Facade { *

* @param contact Contact instance to add *

- * @throws - * org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataAlreadyAddedException - * If the contact is already added + * @throws BasicDataAlreadyAddedException If the contact is already added */ - void addContact (final Contact contact) throws BusinessDataAlreadyAddedException; + void addContact (final Contact contact) throws BasicDataAlreadyAddedException; /** * Let the user add a new other address -- 2.39.5