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
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
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.
/**
* 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
// - 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());
}
@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
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;
/**
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
+++ /dev/null
-/*
- * 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;
- }
-
-}
--- /dev/null
+/*
+ * 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;
+ }
+
+}
+++ /dev/null
-/*
- * 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 ();
-
-}
--- /dev/null
+/*
+ * 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 ();
+
+}