From 6f8021a65c06b44c234c84447f8ceac2ff39157c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 16 Aug 2016 10:05:07 +0200 Subject: [PATCH] Renaming season has started: - renamed cellphone to mobile (all occurences) - let's don't discrimite other mobile phones, right? --- .../mxchange/jcontacts/contact/Contact.java | 14 ++++++------- .../jcontacts/contact/UserContact.java | 20 +++++++++---------- .../jcontacts/contact/utils/ContactUtils.java | 16 +++++++-------- ...va => AdminMobileNumberUnlinkedEvent.java} | 10 +++++----- ...va => AdminUnlinkedMobileNumberEvent.java} | 6 +++--- 5 files changed, 33 insertions(+), 33 deletions(-) rename src/org/mxchange/jcontacts/events/cellphone/unlinked/{AdminCellphoneNumberUnlinkedEvent.java => AdminMobileNumberUnlinkedEvent.java} (78%) rename src/org/mxchange/jcontacts/events/cellphone/unlinked/{AdminUnlinkedCellphoneNumberEvent.java => AdminUnlinkedMobileNumberEvent.java} (85%) diff --git a/src/org/mxchange/jcontacts/contact/Contact.java b/src/org/mxchange/jcontacts/contact/Contact.java index 35b3e63..bc9c6fe 100644 --- a/src/org/mxchange/jcontacts/contact/Contact.java +++ b/src/org/mxchange/jcontacts/contact/Contact.java @@ -21,9 +21,9 @@ import java.util.Calendar; import java.util.Date; import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcountry.data.Country; -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; /** * A general contact POJI @@ -54,18 +54,18 @@ public interface Contact extends Serializable { void setContactBirthday (final Date birthday); /** - * Getter for cellphone number + * Getter for mobile number *

- * @return Cellphone number + * @return Mobile number */ - DialableCellphoneNumber getContactCellphoneNumber (); + DialableMobileNumber getContactMobileNumber (); /** - * Setter for cellphone number + * Setter for mobile number *

- * @param cellphoneNumber Cellphone number + * @param mobileNumber Mobile number */ - void setContactCellphoneNumber (final DialableCellphoneNumber cellphoneNumber); + void setContactMobileNumber (final DialableMobileNumber mobileNumber); /** * City diff --git a/src/org/mxchange/jcontacts/contact/UserContact.java b/src/org/mxchange/jcontacts/contact/UserContact.java index e68e985..b3f66a0 100644 --- a/src/org/mxchange/jcontacts/contact/UserContact.java +++ b/src/org/mxchange/jcontacts/contact/UserContact.java @@ -41,12 +41,12 @@ import javax.persistence.Transient; import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcountry.data.Country; import org.mxchange.jcountry.data.CountryData; -import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber; -import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.phonenumbers.fax.FaxNumber; import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; +import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.phonenumbers.mobile.MobileNumber; /** * A general contact class which serves as an entity. @@ -92,9 +92,9 @@ public class UserContact implements Contact { /** * Cellphone number */ - @JoinColumn (name = "contact_cellphone_number_id", referencedColumnName = "cellphone_id", unique = true) - @OneToOne (targetEntity = CellphoneNumber.class, cascade = CascadeType.ALL) - private DialableCellphoneNumber contactCellphoneNumber; + @JoinColumn (name = "contact_mobile_number_id", referencedColumnName = "mobile_id", unique = true) + @OneToOne (targetEntity = MobileNumber.class, cascade = CascadeType.ALL) + private DialableMobileNumber contactMobileNumber; /** * City @@ -271,7 +271,7 @@ public class UserContact implements Contact { // - phone, fax, email this.setContactLandLineNumber(contact.getContactLandLineNumber()); this.setContactFaxNumber(contact.getContactFaxNumber()); - this.setContactCellphoneNumber(contact.getContactCellphoneNumber()); + this.setContactMobileNumber(contact.getContactMobileNumber()); // - other data this.setContactBirthday(contact.getContactBirthday()); @@ -337,13 +337,13 @@ public class UserContact implements Contact { } @Override - public DialableCellphoneNumber getContactCellphoneNumber () { - return this.contactCellphoneNumber; + public DialableMobileNumber getContactMobileNumber () { + return this.contactMobileNumber; } @Override - public void setContactCellphoneNumber (final DialableCellphoneNumber contactCellphoneNumber) { - this.contactCellphoneNumber = contactCellphoneNumber; + public void setContactMobileNumber (final DialableMobileNumber contactMobileNumber) { + this.contactMobileNumber = contactMobileNumber; } @Override diff --git a/src/org/mxchange/jcontacts/contact/utils/ContactUtils.java b/src/org/mxchange/jcontacts/contact/utils/ContactUtils.java index 82c2908..00bfef4 100644 --- a/src/org/mxchange/jcontacts/contact/utils/ContactUtils.java +++ b/src/org/mxchange/jcontacts/contact/utils/ContactUtils.java @@ -20,12 +20,12 @@ import java.io.Serializable; import java.util.Objects; import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcountry.data.Country; -import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber; -import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.phonenumbers.fax.FaxNumber; import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; +import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.phonenumbers.mobile.MobileNumber; import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; /** @@ -97,25 +97,25 @@ public class ContactUtils implements Serializable { boolean isUnlinked = false; // Is there a cellphone number? - if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) { + if (contact.getContactMobileNumber() instanceof DialableMobileNumber) { // Is provider null? if ((null == cellphoneProvider) || (null == cellphoneNumber) || (cellphoneNumber == 0)) { // Remove instance - contact.setContactCellphoneNumber(null); + contact.setContactMobileNumber(null); // Mark as unlinked isUnlinked = true; } else { // Yes, then update as well - contact.getContactCellphoneNumber().setCellphoneProvider(cellphoneProvider); - contact.getContactCellphoneNumber().setPhoneNumber(cellphoneNumber); + contact.getContactMobileNumber().setMobileProvider(cellphoneProvider); + contact.getContactMobileNumber().setPhoneNumber(cellphoneNumber); } } else if ((cellphoneProvider instanceof MobileProvider) && (cellphoneNumber > 0)) { // Create new instance - DialableCellphoneNumber cellphone = new CellphoneNumber(cellphoneProvider, cellphoneNumber); + DialableMobileNumber cellphone = new MobileNumber(cellphoneProvider, cellphoneNumber); // Set it in contact - contact.setContactCellphoneNumber(cellphone); + contact.setContactMobileNumber(cellphone); } // Return status diff --git a/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminCellphoneNumberUnlinkedEvent.java b/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminMobileNumberUnlinkedEvent.java similarity index 78% rename from src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminCellphoneNumberUnlinkedEvent.java rename to src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminMobileNumberUnlinkedEvent.java index 0807799..0cc2bd6 100644 --- a/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminCellphoneNumberUnlinkedEvent.java +++ b/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminMobileNumberUnlinkedEvent.java @@ -17,14 +17,14 @@ package org.mxchange.jcontacts.events.cellphone.unlinked; import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; +import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; /** * An event when a cell phone number has been updated *

* @author Roland Haeder */ -public class AdminCellphoneNumberUnlinkedEvent implements AdminUnlinkedCellphoneNumberEvent { +public class AdminMobileNumberUnlinkedEvent implements AdminUnlinkedMobileNumberEvent { /** * Serial number @@ -39,7 +39,7 @@ public class AdminCellphoneNumberUnlinkedEvent implements AdminUnlinkedCellphone /** * Unlinked mobile provider instance */ - private final DialableCellphoneNumber unlinkedCellphoneNumber; + private final DialableMobileNumber unlinkedCellphoneNumber; /** * Constructor with unlinked cell phone number @@ -47,7 +47,7 @@ public class AdminCellphoneNumberUnlinkedEvent implements AdminUnlinkedCellphone * @param contact Contact with linked cell phone instance * @param unlinkedCellphoneNumber Unlinked cell phone number */ - public AdminCellphoneNumberUnlinkedEvent (final Contact contact, final DialableCellphoneNumber unlinkedCellphoneNumber) { + public AdminMobileNumberUnlinkedEvent (final Contact contact, final DialableMobileNumber unlinkedCellphoneNumber) { // Set it here this.contact = contact; this.unlinkedCellphoneNumber = unlinkedCellphoneNumber; @@ -59,7 +59,7 @@ public class AdminCellphoneNumberUnlinkedEvent implements AdminUnlinkedCellphone } @Override - public DialableCellphoneNumber getUnlinkedCellphoneNumber () { + public DialableMobileNumber getUnlinkedCellphoneNumber () { return this.unlinkedCellphoneNumber; } diff --git a/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedCellphoneNumberEvent.java b/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedMobileNumberEvent.java similarity index 85% rename from src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedCellphoneNumberEvent.java rename to src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedMobileNumberEvent.java index ccb8a23..dd3fc0d 100644 --- a/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedCellphoneNumberEvent.java +++ b/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedMobileNumberEvent.java @@ -18,21 +18,21 @@ package org.mxchange.jcontacts.events.cellphone.unlinked; import java.io.Serializable; import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; +import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; /** * An interface for an event when a cell phone number has been updated *

* @author Roland Haeder */ -public interface AdminUnlinkedCellphoneNumberEvent extends Serializable { +public interface AdminUnlinkedMobileNumberEvent extends Serializable { /** * Getter for updated cell phone numbers *

* @return Updated cell phone numbers */ - DialableCellphoneNumber getUnlinkedCellphoneNumber (); + DialableMobileNumber getUnlinkedCellphoneNumber (); /** * Getter for contact instance -- 2.39.5