From 20cb6de1aae1d2a77f0d34f8856447a2b58f2428 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Roland=20H=C3=A4der?= <roland@mxchange.org>
Date: Tue, 16 Aug 2016 10:04:19 +0200
Subject: [PATCH] Renaming season has started: - renamed cellphone to mobile
 (all occurences) - let's don't discrimite other mobile phones, right?

---
 .../database/BaseAddressbookDatabaseBean.java | 44 +++++++++----------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java b/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java
index dd8bd9e..0843b75 100644
--- a/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java
+++ b/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java
@@ -37,9 +37,9 @@ import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcoreee.database.BaseDatabaseBean;
 import org.mxchange.jmailee.model.delivery.wrapper.EmailDeliveryWrapper;
 import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 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.utils.PhoneUtils;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.UserUtils;
@@ -125,7 +125,7 @@ public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
 		// Get all phone instances
 		DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
 		DialableFaxNumber faxNumber = contact.getContactFaxNumber();
-		DialableCellphoneNumber cellphoneNumber = contact.getContactCellphoneNumber();
+		DialableMobileNumber cellphoneNumber = contact.getContactMobileNumber();
 
 		// Debug message
 		this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntriesCreated: landLineNumber={0},faxNumber={1},cellphoneNumber={2}", landLineNumber, faxNumber, cellphoneNumber)); //NOI18N
@@ -149,7 +149,7 @@ public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
 		}
 
 		// Is a mobile number instance set?
-		if ((cellphoneNumber instanceof DialableCellphoneNumber) && (cellphoneNumber.getPhoneId() == null)) {
+		if ((cellphoneNumber instanceof DialableMobileNumber) && (cellphoneNumber.getPhoneId() == null)) {
 			// Debug message
 			this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesCreated: Setting created timestamp for cellphone number ..."); //NOI18N
 
@@ -169,7 +169,7 @@ public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
 	 * <p>
 	 * @return Detached instance
 	 */
-	protected DialableCellphoneNumber getDetached (final DialableCellphoneNumber cellphoneNumber, final DialableCellphoneNumber fetchedNumber) {
+	protected DialableMobileNumber getDetached (final DialableMobileNumber cellphoneNumber, final DialableMobileNumber fetchedNumber) {
 		// Trace message
 		this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: cellphoneNumber={0},fetchedNumber={1} - CALLED!", cellphoneNumber, fetchedNumber)); //NOI18N
 
@@ -186,13 +186,13 @@ public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
 		this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
 
 		// Init query instance
-		DialableCellphoneNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
+		DialableMobileNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
 
 		// Debug message
 		this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
 
 		// Default is null
-		DialableCellphoneNumber detachedNumber = null;
+		DialableMobileNumber detachedNumber = null;
 
 		// Is there a difference?
 		if (!PhoneUtils.isSameCellphoneNumber(cellphoneNumber, fetchedNumber)) {
@@ -371,32 +371,32 @@ public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
 		}
 
 		// Get all instances
-		DialableCellphoneNumber cellphone = detachedContact.getContactCellphoneNumber();
+		DialableMobileNumber cellphone = detachedContact.getContactMobileNumber();
 		DialableLandLineNumber landLine = detachedContact.getContactLandLineNumber();
 		DialableFaxNumber fax = detachedContact.getContactFaxNumber();
 
 		// Is there a  cellphone instance set?
-		if (cellphone instanceof DialableCellphoneNumber) {
+		if (cellphone instanceof DialableMobileNumber) {
 			// Debug message
 			this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: cellphone.phoneId={0} is being updated ...", cellphone.getPhoneId())); //NOI18N
 
 			// Then find it, too
-			DialableCellphoneNumber foundCellphone = this.getEntityManager().find(cellphone.getClass(), cellphone.getPhoneId());
+			DialableMobileNumber foundCellphone = this.getEntityManager().find(cellphone.getClass(), cellphone.getPhoneId());
 
 			// Should be there
-			assert (foundCellphone instanceof DialableCellphoneNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", foundCellphone.getPhoneId()); //NOI18N
+			assert (foundCellphone instanceof DialableMobileNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", foundCellphone.getPhoneId()); //NOI18N
 
 			// Then merge it, too
-			DialableCellphoneNumber detachedCellphone = this.getEntityManager().merge(foundCellphone);
+			DialableMobileNumber detachedCellphone = this.getEntityManager().merge(foundCellphone);
 
 			// Should be there
-			assert (detachedCellphone instanceof DialableCellphoneNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", detachedCellphone.getPhoneId()); //NOI18N
+			assert (detachedCellphone instanceof DialableMobileNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", detachedCellphone.getPhoneId()); //NOI18N
 
 			// Copy all
-			detachedCellphone.copyAll(detachedContact.getContactCellphoneNumber());
+			detachedCellphone.copyAll(detachedContact.getContactMobileNumber());
 
 			// Set it back
-			detachedContact.setContactCellphoneNumber(detachedCellphone);
+			detachedContact.setContactMobileNumber(detachedCellphone);
 		}
 
 		// Is there a  fax instance set?
@@ -540,20 +540,20 @@ public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
 		}
 
 		// Debug message
-		this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactCellphoneNumber={0}", other.getContactCellphoneNumber())); //NOI18N
+		this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactCellphoneNumber={0}", other.getContactMobileNumber())); //NOI18N
 
 		// Is other cellphone not set?
-		if ((other.getContactCellphoneNumber() == null) || (PhoneUtils.isSameCellphoneNumber(contact.getContactCellphoneNumber(), other.getContactCellphoneNumber()))) {
+		if ((other.getContactMobileNumber() == null) || (PhoneUtils.isSameCellphoneNumber(contact.getContactMobileNumber(), other.getContactMobileNumber()))) {
 			// Debug message
 			this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying cellphone entry ..."); //NOI18N
 
 			// Is the fax number set?
-			if (other.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
+			if (other.getContactMobileNumber() instanceof DialableMobileNumber) {
 				// Copy cellphone number
-				contact.setContactCellphoneNumber(this.getDetached(other.getContactCellphoneNumber(), contact.getContactCellphoneNumber()));
+				contact.setContactMobileNumber(this.getDetached(other.getContactMobileNumber(), contact.getContactMobileNumber()));
 			} else {
 				// Null it
-				contact.setContactCellphoneNumber(null);
+				contact.setContactMobileNumber(null);
 			}
 		}
 
@@ -627,10 +627,10 @@ public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
 		// Get all phone instances
 		DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
 		DialableFaxNumber faxNumber = contact.getContactFaxNumber();
-		DialableCellphoneNumber cellphoneNumber = contact.getContactCellphoneNumber();
+		DialableMobileNumber cellphoneNumber = contact.getContactMobileNumber();
 
 		// Flags and instances must be constistent
-		if (isCellphoneUnlinked && cellphoneNumber instanceof DialableCellphoneNumber) {
+		if (isCellphoneUnlinked && cellphoneNumber instanceof DialableMobileNumber) {
 			// Bad state
 			throw new IllegalStateException("isCellPhoneUnlinked is TRUE, but cellphoneNumber is set."); //NOI18N
 		} else if (isLandlineUnlinked && landLineNumber instanceof DialableLandLineNumber) {
@@ -660,7 +660,7 @@ public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
 		}
 
 		// Is a mobile number instance set?
-		if ((cellphoneNumber instanceof DialableCellphoneNumber) && (cellphoneNumber.getPhoneId() instanceof Long) && (cellphoneNumber.getPhoneId() > 0)) {
+		if ((cellphoneNumber instanceof DialableMobileNumber) && (cellphoneNumber.getPhoneId() instanceof Long) && (cellphoneNumber.getPhoneId() > 0)) {
 			// Debug message
 			this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesUpdated: Setting updated timestamp for cellphone number ..."); //NOI18N
 
-- 
2.39.5