From: Roland Häder Date: Tue, 16 Aug 2016 08:05:07 +0000 (+0200) Subject: Renaming season has started: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6f8021a65c06b44c234c84447f8ceac2ff39157c;p=jcontacts-core.git Renaming season has started: - renamed cellphone to mobile (all occurences) - let's don't discrimite other mobile phones, right? --- 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/AdminCellphoneNumberUnlinkedEvent.java deleted file mode 100644 index 0807799..0000000 --- a/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminCellphoneNumberUnlinkedEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2016 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jcontacts.events.cellphone.unlinked; - -import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; - -/** - * An event when a cell phone number has been updated - *

- * @author Roland Haeder - */ -public class AdminCellphoneNumberUnlinkedEvent implements AdminUnlinkedCellphoneNumberEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 18_521_758_718_691_064L; - - /** - * Contact instance - */ - private final Contact contact; - - /** - * Unlinked mobile provider instance - */ - private final DialableCellphoneNumber unlinkedCellphoneNumber; - - /** - * Constructor with unlinked cell phone number - *

- * @param contact Contact with linked cell phone instance - * @param unlinkedCellphoneNumber Unlinked cell phone number - */ - public AdminCellphoneNumberUnlinkedEvent (final Contact contact, final DialableCellphoneNumber unlinkedCellphoneNumber) { - // Set it here - this.contact = contact; - this.unlinkedCellphoneNumber = unlinkedCellphoneNumber; - } - - @Override - public Contact getContact () { - return this.contact; - } - - @Override - public DialableCellphoneNumber getUnlinkedCellphoneNumber () { - return this.unlinkedCellphoneNumber; - } - -} diff --git a/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminMobileNumberUnlinkedEvent.java b/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminMobileNumberUnlinkedEvent.java new file mode 100644 index 0000000..0cc2bd6 --- /dev/null +++ b/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminMobileNumberUnlinkedEvent.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontacts.events.cellphone.unlinked; + +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; + +/** + * An event when a cell phone number has been updated + *

+ * @author Roland Haeder + */ +public class AdminMobileNumberUnlinkedEvent implements AdminUnlinkedMobileNumberEvent { + + /** + * Serial number + */ + private static final long serialVersionUID = 18_521_758_718_691_064L; + + /** + * Contact instance + */ + private final Contact contact; + + /** + * Unlinked mobile provider instance + */ + private final DialableMobileNumber unlinkedCellphoneNumber; + + /** + * Constructor with unlinked cell phone number + *

+ * @param contact Contact with linked cell phone instance + * @param unlinkedCellphoneNumber Unlinked cell phone number + */ + public AdminMobileNumberUnlinkedEvent (final Contact contact, final DialableMobileNumber unlinkedCellphoneNumber) { + // Set it here + this.contact = contact; + this.unlinkedCellphoneNumber = unlinkedCellphoneNumber; + } + + @Override + public Contact getContact () { + return this.contact; + } + + @Override + 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/AdminUnlinkedCellphoneNumberEvent.java deleted file mode 100644 index ccb8a23..0000000 --- a/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedCellphoneNumberEvent.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2016 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jcontacts.events.cellphone.unlinked; - -import java.io.Serializable; -import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; - -/** - * An interface for an event when a cell phone number has been updated - *

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

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

- * @return Contact instance - */ - Contact getContact (); - -} diff --git a/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedMobileNumberEvent.java b/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedMobileNumberEvent.java new file mode 100644 index 0000000..dd3fc0d --- /dev/null +++ b/src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedMobileNumberEvent.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontacts.events.cellphone.unlinked; + +import java.io.Serializable; +import org.mxchange.jcontacts.contact.Contact; +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 AdminUnlinkedMobileNumberEvent extends Serializable { + + /** + * Getter for updated cell phone numbers + *

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

+ * @return Contact instance + */ + Contact getContact (); + +}