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;
// 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
}
// 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
* <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
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)) {
}
// 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?
}
// 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);
}
}
// 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) {
}
// 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