*/
package org.mxchange.addressbook.client;
-import org.mxchange.jcore.exceptions.MenuInitializationException;
import org.mxchange.addressbook.menu.item.SelectableMenuItem;
import org.mxchange.jcore.client.Client;
+import org.mxchange.jcore.exceptions.MenuInitializationException;
import org.mxchange.jcore.exceptions.UnhandledUserChoiceException;
import org.mxchange.jcore.model.contact.Contact;
import org.mxchange.jcore.model.contact.gender.Gender;
public interface AddressbookClient extends Client {
/**
- * The user changes own name data
+ * The user changes own address data
* <p>
- * @param contact
+ * @param contact Contact instance to change
*/
- public void doChangeOwnNameData (final Contact contact);
+ public void doChangeOwnAddressData (final Contact contact);
/**
- * The user changes own address data
+ * The user changes own name data
* <p>
- * @param contact Contact instance to change
+ * @param contact
*/
- public void doChangeOwnAddressData (final Contact contact);
+ public void doChangeOwnNameData (final Contact contact);
/**
* The user changes own other data
*/
public Contact doEnterOwnData ();
- /**
- * Asks the user to enter his/her gender (M=Male, F=Female, C=Company)
- * <p>
- * @param message Message to output
- * @return Gender enum
- */
- public Gender enterGender (final String message);
-
- /**
- * Let the user choose what to change on the address: [n]ame, [a]ddress,
- * [o]ther
- * <p>
- * @param contact Contact instance to let the user change data
- * @throws UnhandledUserChoiceException If choice is not supported
- */
- public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException;
-
/**
* Asks the user for a choice and proceeds accordingly
* <p>
public char enterChar (final char[] validChars, final String message);
/**
- * Reads a string of minimum and maximum length from the user. An empty
- * string should be generally not allowed, but might be okay for e.g.
- * company name.
+ * Asks the user to enter his/her gender (M=Male, F=Female, C=Company)
* <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 allowEmpty Whether empty strings are allowed
- * @return Entered string by user or null if empty string is allowed
+ * @param message Message to output
+ * @return Gender enum
*/
- public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty);
+ public Gender enterGender (final String message);
/**
* Reads an integer (int) from the user
*/
public int enterInt (final int minimum, final int maximum, final String message);
+ /**
+ * Reads a string of minimum and maximum length from the user. An empty
+ * 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 allowEmpty Whether empty strings are allowed
+ * @return Entered string by user or null if empty string is allowed
+ */
+ public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty);
+
/**
* Setter for current menu choice
* <p>
*/
public SelectableMenuItem getMenuItem (final char accessKey, final String text);
+ /**
+ * Shows current menu selection to the user
+ */
+ public void showCurrentMenu ();
+
/**
* Shows given menu entry in client
* <p>
public void showEntry (final SelectableMenuItem item);
/**
- * Shows current menu selection to the user
+ * Let the user choose what to change on the address: [n]ame, [a]ddress,
+ * [o]ther
+ * <p>
+ * @param contact Contact instance to let the user change data
+ * @throws UnhandledUserChoiceException If choice is not supported
*/
- public void showCurrentMenu ();
+ public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException;
}