]> git.mxchange.org Git - jcontacts-core.git/commitdiff
Renaming season has started:
authorRoland Häder <roland@mxchange.org>
Tue, 16 Aug 2016 08:05:07 +0000 (10:05 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 16 Aug 2016 08:18:59 +0000 (10:18 +0200)
- renamed cellphone to mobile (all occurences)
- let's don't discrimite other mobile phones, right?

src/org/mxchange/jcontacts/contact/Contact.java
src/org/mxchange/jcontacts/contact/UserContact.java
src/org/mxchange/jcontacts/contact/utils/ContactUtils.java
src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminCellphoneNumberUnlinkedEvent.java [deleted file]
src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminMobileNumberUnlinkedEvent.java [new file with mode: 0644]
src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedCellphoneNumberEvent.java [deleted file]
src/org/mxchange/jcontacts/events/cellphone/unlinked/AdminUnlinkedMobileNumberEvent.java [new file with mode: 0644]

index 35b3e637149342adf25ab3374da8332a43493352..bc9c6fe464a0570114fa4d2dd00f87139b859f21 100644 (file)
@@ -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
         * <p>
-        * @return Cellphone number
+        * @return Mobile number
         */
-       DialableCellphoneNumber getContactCellphoneNumber ();
+       DialableMobileNumber getContactMobileNumber ();
 
        /**
-        * Setter for cellphone number
+        * Setter for mobile number
         * <p>
-        * @param cellphoneNumber Cellphone number
+        * @param mobileNumber Mobile number
         */
-       void setContactCellphoneNumber (final DialableCellphoneNumber cellphoneNumber);
+       void setContactMobileNumber (final DialableMobileNumber mobileNumber);
 
        /**
         * City
index e68e985cf027e5e50fa50bdd1c4e431780d30365..b3f66a081bf0ad66a15b0991d12fe776d989d749 100644 (file)
@@ -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
index 82c290839d79ce0ca4cc6bb24ae3709b5784a7e6..00bfef48a7b17b1772a330ddbcc1e1b5a1457a0a 100644 (file)
@@ -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 (file)
index 0807799..0000000
+++ /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 <http://www.gnu.org/licenses/>.
- */
-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
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-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
-        * <p>
-        * @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 (file)
index 0000000..0cc2bd6
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+ */
+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
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+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
+        * <p>
+        * @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 (file)
index ccb8a23..0000000
+++ /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 <http://www.gnu.org/licenses/>.
- */
-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
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public interface AdminUnlinkedCellphoneNumberEvent extends Serializable {
-
-       /**
-        * Getter for updated cell phone numbers
-        * <p>
-        * @return Updated cell phone numbers
-        */
-       DialableCellphoneNumber getUnlinkedCellphoneNumber ();
-
-       /**
-        * Getter for contact instance
-        * <p>
-        * @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 (file)
index 0000000..dd3fc0d
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+ */
+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
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface AdminUnlinkedMobileNumberEvent extends Serializable {
+
+       /**
+        * Getter for updated cell phone numbers
+        * <p>
+        * @return Updated cell phone numbers
+        */
+       DialableMobileNumber getUnlinkedCellphoneNumber ();
+
+       /**
+        * Getter for contact instance
+        * <p>
+        * @return Contact instance
+        */
+       Contact getContact ();
+
+}