]> git.mxchange.org Git - addressbook-swing.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 20 Jan 2023 02:37:17 +0000 (03:37 +0100)
committerRoland Häder <roland@mxchange.org>
Fri, 20 Jan 2023 02:37:17 +0000 (03:37 +0100)
- fixed some imports and names

src/org/mxchange/addressbook/client/AddressbookClient.java
src/org/mxchange/addressbook/client/console/ConsoleClient.java
src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java
src/org/mxchange/addressbook/facade/contact/ContactFacade.java

index 82cbec2f51177a29b3067c1c6cda6a46e7a8a679..c2c2b6b2d20306ef5458f3ff290c871f1cc64e17 100644 (file)
@@ -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
         * <p>
         * @param       validChars Valid chars that are accepted
-        * @param       message Message to user
+        * @param       message    Message to user
         * <p>
         * @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)
         * <p>
         * @param message Message to output
         * <p>
@@ -130,9 +131,9 @@ public interface AddressbookClient extends Client {
         * string should be generally not allowed, but might be okay for e.g.
         * company name.
         * <p>
-        * @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
         * <p>
         * @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
         * <p>
         * @param accessKey Key to press to access this menu
-        * @param text Text to show to user
+        * @param text      Text to show to user
         * <p>
         * @return
         */
index e03fc3c066649f0acdf4db5c2bb4585b266e23f9..baf7955cdebfab6ad213f8770baafa46ba4ec0d5 100644 (file)
@@ -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
index 5edd988ec7d140f1ed599d92187a7ff6c7199e5e..b2675c68b0a51911257459aecf607c1a7089b248 100644 (file)
@@ -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);
                }
index 73e192d390eac29f0e27e4d233abb905b99932eb..ab7a02b3c1abc5076112201494272137affac2b8 100644 (file)
 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 {
         * <p>
         * @param contact Contact instance to add
         * <p>
-        * @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