*/
package org.mxchange.jphone.events.fax.created;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
/**
* An event being fired when a fax number instance has been successfully
package org.mxchange.jphone.events.fax.created;
import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
/**
* An event being fired when a fax number instance has been successfully
package org.mxchange.jphone.events.fax.deleted;
import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
/**
* An interface for an event when a fax number has been deleted
*/
package org.mxchange.jphone.events.fax.deleted;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
/**
* An event when a land-line number has been deleted
package org.mxchange.jphone.events.fax.removed;
import java.util.List;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
/**
* An event when a mobile number list needs been cleared
import java.io.Serializable;
import java.util.List;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
/**
* An interface for an event when a list needs to be cleared from fax
*/
package org.mxchange.jphone.events.fax.updated;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
/**
* An event when a fax number has been updated
package org.mxchange.jphone.events.fax.updated;
import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
/**
* An interface for an event when a fax number has been updated
*/
package org.mxchange.jphone.events.landline.created;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
* An event being fired when a land-line number instance has been successfully
package org.mxchange.jphone.events.landline.created;
import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
* An event being fired when a land-line number instance has been successfully
package org.mxchange.jphone.events.landline.deleted;
import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
* An interface for an event when a land-line number has been deleted
*/
package org.mxchange.jphone.events.landline.deleted;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
* An event when a land-line number has been deleted
package org.mxchange.jphone.events.landline.removed;
import java.util.List;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
* An event when a mobile number list needs been cleared
import java.io.Serializable;
import java.util.List;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
* An interface for an event when a list needs to be cleared from land-line
*/
package org.mxchange.jphone.events.landline.updated;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
* An event when a mobile number has been updated
package org.mxchange.jphone.events.landline.updated;
import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
* An interface for an event when a land-line number has been updated
*/
package org.mxchange.jphone.events.mobile.created;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* An event being fired when a mobile number instance has been successfully
package org.mxchange.jphone.events.mobile.created;
import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* An event being fired when a mobile number instance has been successfully
package org.mxchange.jphone.events.mobile.deleted;
import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* An interface for an event when a mobile number has been deleted
*/
package org.mxchange.jphone.events.mobile.deleted;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* An event when a mobile number has been deleted
package org.mxchange.jphone.events.mobile.remove;
import java.util.List;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* An event when a mobile number list needs been cleared
import java.io.Serializable;
import java.util.List;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* An interface for an event when a list needs to be cleared from mobile
*/
package org.mxchange.jphone.events.mobile.updated;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* An event when a mobile number has been updated
package org.mxchange.jphone.events.mobile.updated;
import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* An interface for an event when a mobile number has been updated
package org.mxchange.jphone.events.mobileprovider.added;
import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
/**
* An interface for an event when a new mobile provider has been added.
* @return Added mobile provider
*/
MobileProvider getAddedMobileProvider ();
+
}
*/
package org.mxchange.jphone.events.mobileprovider.added;
-import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
/**
* An event when a new mobile provider has been added
package org.mxchange.jphone.exceptions;
import java.text.MessageFormat;
-import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
/**
* An exception thrown when the mobile provider is already added. This should be
package org.mxchange.jphone.exceptions;
import java.text.MessageFormat;
-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.model.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* An exception thrown when a fax, land-line or mobile number is not linked but
package org.mxchange.jphone.exceptions;
import java.text.MessageFormat;
-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.model.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* An exception thrown when a fax, land-line or mobile number is not linked but
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.jphone.model.phonenumbers;
+
+import java.io.Serializable;
+import java.util.Calendar;
+import org.mxchange.jcountry.model.data.Country;
+
+/**
+ * A POJI for dial-able numbers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface DialableNumber extends Serializable {
+
+ /**
+ * Getter for country instance ('s dial data)
+ * <p>
+ * @return Country instance
+ */
+ Country getPhoneCountry ();
+
+ /**
+ * Setter for country instance ('s dial data)
+ * <p>
+ * @param country Country instance
+ */
+ void setPhoneCountry (final Country country);
+
+ /**
+ * Getter for id number
+ * <p>
+ * @return Id number
+ */
+ Long getPhoneId ();
+
+ /**
+ * Setter for id number
+ * <p>
+ * @param phoneId Id number
+ */
+ void setPhoneId (final Long phoneId);
+
+ /**
+ * Getter for dial number without prefix
+ * <p>
+ * @return Dial number without prefix
+ */
+ Long getPhoneNumber ();
+
+ /**
+ * Setter for dial number without prefix
+ * <p>
+ * @param phoneNumber Dial number without prefix
+ */
+ void setPhoneNumber (final Long phoneNumber);
+
+ /**
+ * Getter for area code without dial prefix (example: 2151 for Krefeld)
+ * <p>
+ * @return Area code without dial prefix
+ */
+ Integer getPhoneAreaCode ();
+
+ /**
+ * Setter for area code without dial prefix (example: 2151 for Krefeld)
+ * <p>
+ * @param phoneAreaCode Area code without dial prefix
+ */
+ void setPhoneAreaCode (final Integer phoneAreaCode);
+
+ /**
+ * Getter for timestamp when this entry has been created
+ * <p>
+ * @return Timestamp when this entry has been created
+ */
+ Calendar getPhoneEntryCreated ();
+
+ /**
+ * Setter for timestamp when this entry has been created
+ * <p>
+ * @param phoneEntryCreated Timestamp when this entry has been created
+ */
+ void setPhoneEntryCreated (final Calendar phoneEntryCreated);
+
+ /**
+ * Getter for timestamp when this entry has been updated
+ * <p>
+ * @return Timestamp when this entry has been updated
+ */
+ Calendar getPhoneEntryUpdated ();
+
+ /**
+ * Setter for timestamp when this entry has been updated
+ * <p>
+ * @param phoneEntryUpdated Timestamp when this entry has been updated
+ */
+ void setPhoneEntryUpdated (final Calendar phoneEntryUpdated);
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.jphone.model.phonenumbers.fax;
+
+import org.mxchange.jphone.model.phonenumbers.DialableNumber;
+
+/**
+ * A POJI for dialable fax numbers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface DialableFaxNumber extends DialableNumber {
+
+ @Override
+ boolean equals (final Object object);
+
+ @Override
+ int hashCode ();
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.jphone.model.phonenumbers.fax;
+
+import java.util.Calendar;
+import java.util.Objects;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jcountry.model.data.CountryData;
+
+/**
+ * A POJO for dialable fax numbers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "fax_numbers")
+@Table (name = "fax_numbers")
+@NamedQueries (
+ {
+ @NamedQuery (name = "AllFaxNumbers", query = "SELECT f FROM fax_numbers AS f ORDER BY f.phoneId ASC"),
+ @NamedQuery (name = "SearchFaxNumberId", query = "SELECT f FROM fax_numbers AS f WHERE f.phoneId = :faxNumberId")
+ }
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class FaxNumber implements DialableFaxNumber {
+
+ /**
+ * Serial number
+ */
+ @Transient
+ private static final long serialVersionUID = 17_687_687_191_375L;
+
+ /**
+ * Area code (example: 2151 for Krefeld)
+ */
+ @Basic (optional = false)
+ @Column (name = "fax_area_code", length = 10, nullable = false)
+ private Integer faxAreaCode;
+
+ /**
+ * Country instance ('s dial data)
+ */
+ @JoinColumn (name = "fax_country_id", nullable = false)
+ @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
+ private Country faxCountry;
+
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "fax_entry_created", nullable = false, updatable = false)
+ private Calendar phoneEntryCreated;
+
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "phone_entry_updated", updatable = false)
+ private Calendar phoneEntryUpdated;
+
+ /**
+ * Id number
+ */
+ @Id
+ @GeneratedValue (strategy = GenerationType.IDENTITY)
+ @Column (name = "fax_id", nullable = false, updatable = false)
+ private Long phoneId;
+
+ /**
+ * Fax number without prefix
+ */
+ @Basic (optional = false)
+ @Column (name = "fax_number", nullable = false)
+ private Long phoneNumber;
+
+ /**
+ * Default constructor
+ */
+ public FaxNumber () {
+ }
+
+ /**
+ * Constructor with country, area code and number
+ * <p>
+ * @param faxCountry Country instance
+ * @param faxAreaCode Area code (without leading zeros)
+ * @param faxNumber Fax number (without area code and leading zero)
+ */
+ public FaxNumber (final Country faxCountry, final Integer faxAreaCode, final Long faxNumber) {
+ // Call default constructor
+ this();
+
+ // Set all values
+ this.faxCountry = faxCountry;
+ this.faxAreaCode = faxAreaCode;
+ this.phoneNumber = faxNumber;
+ }
+
+ @Override
+ public boolean equals (final Object object) {
+ if (null == object) {
+ return false;
+ } else if (this.getClass() != object.getClass()) {
+ return false;
+ }
+
+ final DialableFaxNumber other = (DialableFaxNumber) object;
+
+ if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneId(), other.getPhoneId())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneAreaCode(), other.getPhoneAreaCode())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneCountry(), other.getPhoneCountry())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public Integer getPhoneAreaCode () {
+ return this.faxAreaCode;
+ }
+
+ @Override
+ public void setPhoneAreaCode (final Integer faxAreaCode) {
+ this.faxAreaCode = faxAreaCode;
+ }
+
+ @Override
+ public Country getPhoneCountry () {
+ return this.faxCountry;
+ }
+
+ @Override
+ public void setPhoneCountry (final Country faxCountry) {
+ this.faxCountry = faxCountry;
+ }
+
+ @Override
+ @SuppressWarnings ("ReturnOfDateField")
+ public Calendar getPhoneEntryCreated () {
+ return this.phoneEntryCreated;
+ }
+
+ @Override
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setPhoneEntryCreated (final Calendar phoneEntryCreated) {
+ this.phoneEntryCreated = phoneEntryCreated;
+ }
+
+ @Override
+ @SuppressWarnings ("ReturnOfDateField")
+ public Calendar getPhoneEntryUpdated () {
+ return this.phoneEntryUpdated;
+ }
+
+ @Override
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setPhoneEntryUpdated (final Calendar phoneEntryUpdated) {
+ this.phoneEntryUpdated = phoneEntryUpdated;
+ }
+
+ @Override
+ public Long getPhoneId () {
+ return this.phoneId;
+ }
+
+ @Override
+ public void setPhoneId (final Long phoneId) {
+ this.phoneId = phoneId;
+ }
+
+ @Override
+ public Long getPhoneNumber () {
+ return this.phoneNumber;
+ }
+
+ @Override
+ public void setPhoneNumber (final Long phoneNumber) {
+ this.phoneNumber = phoneNumber;
+ }
+
+ @Override
+ public int hashCode () {
+ int hash = 3;
+
+ hash = 23 * hash + Objects.hashCode(this.getPhoneId());
+ hash = 23 * hash + Objects.hashCode(this.getPhoneNumber());
+ hash = 23 * hash + Objects.hashCode(this.getPhoneAreaCode());
+ hash = 23 * hash + Objects.hashCode(this.getPhoneCountry());
+
+ return hash;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * 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.jphone.model.phonenumbers.fax;
+
+import java.io.Serializable;
+
+/**
+ * An utilities class for fax numbers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class FaxNumbers implements Serializable {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 1_948_653_672_761L;
+
+ /**
+ * Copy all fields from source object to this
+ * <p>
+ * @param sourceNumber Source number object
+ * @param targetNumber Target number object
+ */
+ public static void copyAll (final DialableFaxNumber sourceNumber, final DialableFaxNumber targetNumber) {
+ // Validate instance
+ if (null == sourceNumber) {
+ // Throw NPE
+ throw new NullPointerException("sourceNumber is null"); //NOI18N
+ } else if (null == targetNumber) {
+ // Throw NPE
+ throw new NullPointerException("targetNumber is null"); //NOI18N
+ }
+
+ // Copy all
+ targetNumber.setPhoneAreaCode(sourceNumber.getPhoneAreaCode());
+ targetNumber.setPhoneCountry(sourceNumber.getPhoneCountry());
+ targetNumber.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
+ targetNumber.setPhoneId(sourceNumber.getPhoneId());
+ targetNumber.setPhoneNumber(sourceNumber.getPhoneNumber());
+ }
+
+ /**
+ * No constructor for utilities classes
+ */
+ private FaxNumbers () {
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.jphone.model.phonenumbers.landline;
+
+import org.mxchange.jphone.model.phonenumbers.DialableNumber;
+
+/**
+ * A POJI for dialable land-line numbers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface DialableLandLineNumber extends DialableNumber {
+
+ @Override
+ boolean equals (final Object object);
+
+ @Override
+ int hashCode ();
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.jphone.model.phonenumbers.landline;
+
+import java.util.Calendar;
+import java.util.Objects;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jcountry.model.data.CountryData;
+
+/**
+ * A POJO for dialable phone numbers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "landline_numbers")
+@Table (name = "landline_numbers")
+@NamedQueries (
+ {
+ @NamedQuery (name = "AllLandLineNumbers", query = "SELECT p FROM landline_numbers AS p ORDER BY p.phoneId ASC"),
+ @NamedQuery (name = "SearchLandLineNumberId", query = "SELECT p FROM landline_numbers AS p WHERE p.phoneId = :landLineNumberId")
+ }
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class LandLineNumber implements DialableLandLineNumber {
+
+ /**
+ * Serial number
+ */
+ @Transient
+ private static final long serialVersionUID = 18_563_748_781_956L;
+
+ /**
+ * Area code (example: 2151 for Krefeld)
+ */
+ @Basic (optional = false)
+ @Column (name = "landline_area_code", length = 10, nullable = false)
+ private Integer phoneAreaCode;
+
+ /**
+ * Connection to table "country_data"
+ */
+ @JoinColumn (name = "landline_country_id", nullable = false, updatable = false)
+ @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
+ private Country phoneCountry;
+
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "landline_entry_created", nullable = false, updatable = false)
+ private Calendar phoneEntryCreated;
+
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "landline_entry_updated", updatable = false)
+ private Calendar phoneEntryUpdated;
+
+ /**
+ * Id number
+ */
+ @Id
+ @GeneratedValue (strategy = GenerationType.IDENTITY)
+ @Column (name = "landline_id", length = 10, nullable = false, updatable = false)
+ private Long phoneId;
+
+ /**
+ * Phone number with out dial prefix
+ */
+ @Basic (optional = false)
+ @Column (name = "landline_number", nullable = false)
+ private Long phoneNumber;
+
+ /**
+ * Default constructor
+ */
+ public LandLineNumber () {
+ }
+
+ /**
+ * Constructor with country instance, area code and number
+ * <p>
+ * @param phoneCountry Country instance
+ * @param phoneAreaCode Phone area code
+ * @param phoneNumber Phone number
+ */
+ public LandLineNumber (final Country phoneCountry, final Integer phoneAreaCode, final Long phoneNumber) {
+ // Call default constructor
+ this();
+
+ // Set all values
+ this.phoneCountry = phoneCountry;
+ this.phoneAreaCode = phoneAreaCode;
+ this.phoneNumber = phoneNumber;
+ }
+
+ @Override
+ public boolean equals (final Object object) {
+ if (null == object) {
+ return false;
+ } else if (this.getClass() != object.getClass()) {
+ return false;
+ }
+
+ final DialableLandLineNumber other = (DialableLandLineNumber) object;
+
+ if (!Objects.equals(this.getPhoneId(), other.getPhoneId())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneAreaCode(), other.getPhoneAreaCode())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneCountry(), other.getPhoneCountry())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public Integer getPhoneAreaCode () {
+ return this.phoneAreaCode;
+ }
+
+ @Override
+ public void setPhoneAreaCode (final Integer phoneAreaCode) {
+ this.phoneAreaCode = phoneAreaCode;
+ }
+
+ @Override
+ public Country getPhoneCountry () {
+ return this.phoneCountry;
+ }
+
+ @Override
+ public void setPhoneCountry (final Country phoneCountry) {
+ this.phoneCountry = phoneCountry;
+ }
+
+ @Override
+ @SuppressWarnings ("ReturnOfDateField")
+ public Calendar getPhoneEntryCreated () {
+ return this.phoneEntryCreated;
+ }
+
+ @Override
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setPhoneEntryCreated (final Calendar phoneEntryCreated) {
+ this.phoneEntryCreated = phoneEntryCreated;
+ }
+
+ @Override
+ @SuppressWarnings ("ReturnOfDateField")
+ public Calendar getPhoneEntryUpdated () {
+ return this.phoneEntryUpdated;
+ }
+
+ @Override
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setPhoneEntryUpdated (final Calendar phoneEntryUpdated) {
+ this.phoneEntryUpdated = phoneEntryUpdated;
+ }
+
+ @Override
+ public Long getPhoneId () {
+ return this.phoneId;
+ }
+
+ @Override
+ public void setPhoneId (final Long phoneId) {
+ this.phoneId = phoneId;
+ }
+
+ @Override
+ public Long getPhoneNumber () {
+ return this.phoneNumber;
+ }
+
+ @Override
+ public void setPhoneNumber (final Long phoneNumber) {
+ this.phoneNumber = phoneNumber;
+ }
+
+ @Override
+ public int hashCode () {
+ int hash = 7;
+
+ hash = 47 * hash + Objects.hashCode(this.getPhoneId());
+ hash = 47 * hash + Objects.hashCode(this.getPhoneNumber());
+ hash = 47 * hash + Objects.hashCode(this.getPhoneAreaCode());
+ hash = 47 * hash + Objects.hashCode(this.getPhoneCountry());
+
+ return hash;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * 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 targetNumber program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.model.phonenumbers.landline;
+
+import java.io.Serializable;
+
+/**
+ * An utilities class for land-line numbers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class LandLineNumbers implements Serializable {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 18_698_467_372_167_561L;
+
+ /**
+ * Copy all fields from source object to this
+ * <p>
+ * @param sourceNumber Source number object
+ * @param targetNumber Target number object
+ */
+ public static void copyAll (final DialableLandLineNumber sourceNumber, final DialableLandLineNumber targetNumber) {
+ // Validate instance
+ if (null == sourceNumber) {
+ // Throw NPE
+ throw new NullPointerException("sourceNumber is null"); //NOI18N
+ } else if (null == targetNumber) {
+ // Throw NPE
+ throw new NullPointerException("targetNumber is null"); //NOI18N
+ }
+
+ // Copy all
+ targetNumber.setPhoneAreaCode(sourceNumber.getPhoneAreaCode());
+ targetNumber.setPhoneCountry(sourceNumber.getPhoneCountry());
+ targetNumber.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
+ targetNumber.setPhoneId(sourceNumber.getPhoneId());
+ targetNumber.setPhoneNumber(sourceNumber.getPhoneNumber());
+ }
+
+ /**
+ * No constructor for utilities classes
+ */
+ private LandLineNumbers () {
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.jphone.model.phonenumbers.mobile;
+
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.DialableNumber;
+
+/**
+ * A POJO for dialable mobile numbers with carriers.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface DialableMobileNumber extends DialableNumber {
+
+ /**
+ * Getter for mobile provider
+ * <p>
+ * @return Mobile provider
+ */
+ MobileProvider getMobileProvider ();
+
+ /**
+ * Setter for mobile provider
+ * <p>
+ * @param mobileProvider Mobile provider
+ */
+ void setMobileProvider (final MobileProvider mobileProvider);
+
+ @Override
+ boolean equals (final Object object);
+
+ @Override
+ int hashCode ();
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.jphone.model.phonenumbers.mobile;
+
+import java.util.Calendar;
+import java.util.Objects;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.CellphoneProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
+
+/**
+ * A POJO for dialable cellphone numbers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "mobile_numbers")
+@Table (name = "mobile_numbers")
+@NamedQueries (
+ {
+ @NamedQuery (name = "AllMobileNumbers", query = "SELECT c FROM mobile_numbers AS c ORDER BY c.phoneId ASC"),
+ @NamedQuery (name = "SearchMobileNumberId", query = "SELECT c FROM mobile_numbers AS c WHERE c.phoneId = :mobileNumberId")
+ }
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class MobileNumber implements DialableMobileNumber {
+
+ /**
+ * Serial number
+ */
+ @Transient
+ private static final long serialVersionUID = 13_859_879_482_106L;
+
+ /**
+ * Connection to table "mobile_provider" (for dial prefix and more data)
+ */
+ @JoinColumn (name = "mobile_provider_id", nullable = false)
+ @OneToOne (targetEntity = CellphoneProvider.class, cascade = CascadeType.REFRESH, optional = false)
+ private MobileProvider mobileProvider;
+
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "mobile_entry_created", nullable = false, updatable = false)
+ private Calendar phoneEntryCreated;
+
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "mobile_entry_updated", updatable = false)
+ private Calendar phoneEntryUpdated;
+
+ /**
+ * Id number
+ */
+ @Id
+ @GeneratedValue (strategy = GenerationType.IDENTITY)
+ @Column (name = "mobile_id", nullable = false, updatable = false)
+ private Long phoneId;
+
+ /**
+ * Number without prefix to dial
+ */
+ @Basic (optional = false)
+ @Column (name = "mobile_number", nullable = false)
+ private Long phoneNumber;
+
+ /**
+ * Default constructor
+ */
+ public MobileNumber () {
+ }
+
+ /**
+ * Constructor with cellphone provider and number
+ * <p>
+ * @param mobileProvider Mobile provider
+ * @param mobileNumber Mobile number
+ */
+ public MobileNumber (final MobileProvider mobileProvider, final Long mobileNumber) {
+ // Call default constructor
+ this();
+
+ // Set all values
+ this.mobileProvider = mobileProvider;
+ this.phoneNumber = mobileNumber;
+ }
+
+ @Override
+ public boolean equals (final Object object) {
+ if (null == object) {
+ return false;
+ } else if (this.getClass() != object.getClass()) {
+ return false;
+ }
+
+ final DialableMobileNumber other = (DialableMobileNumber) object;
+
+ if (!Objects.equals(this.getPhoneId(), other.getPhoneId())) {
+ return false;
+ } else if (!Objects.equals(this.getMobileProvider(), other.getMobileProvider())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public MobileProvider getMobileProvider () {
+ return this.mobileProvider;
+ }
+
+ @Override
+ public void setMobileProvider (final MobileProvider mobileProvider) {
+ this.mobileProvider = mobileProvider;
+ }
+
+ @Override
+ @Deprecated
+ public Integer getPhoneAreaCode () {
+ throw new UnsupportedOperationException("Mobile numbers don't have area codes. Please fix your code."); //NOI18N
+ }
+
+ @Override
+ @Deprecated
+ public void setPhoneAreaCode (final Integer phoneAreaCode) {
+ throw new UnsupportedOperationException("Mobile numbers don't have area codes. Please fix your code."); //NOI18N
+ }
+
+ @Override
+ @Deprecated
+ public Country getPhoneCountry () {
+ throw new UnsupportedOperationException("The country code is provided by MobileProvider."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ @Deprecated
+ public void setPhoneCountry (final Country country) {
+ throw new UnsupportedOperationException("The country code is provided by MobileProvider."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ @SuppressWarnings ("ReturnOfDateField")
+ public Calendar getPhoneEntryCreated () {
+ return this.phoneEntryCreated;
+ }
+
+ @Override
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setPhoneEntryCreated (final Calendar phoneEntryCreated) {
+ this.phoneEntryCreated = phoneEntryCreated;
+ }
+
+ @Override
+ @SuppressWarnings ("ReturnOfDateField")
+ public Calendar getPhoneEntryUpdated () {
+ return this.phoneEntryUpdated;
+ }
+
+ @Override
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setPhoneEntryUpdated (final Calendar phoneEntryUpdated) {
+ this.phoneEntryUpdated = phoneEntryUpdated;
+ }
+
+ @Override
+ public Long getPhoneId () {
+ return this.phoneId;
+ }
+
+ @Override
+ public void setPhoneId (final Long phoneId) {
+ this.phoneId = phoneId;
+ }
+
+ @Override
+ public Long getPhoneNumber () {
+ return this.phoneNumber;
+ }
+
+ @Override
+ public void setPhoneNumber (final Long phoneNumber) {
+ this.phoneNumber = phoneNumber;
+ }
+
+ @Override
+ public int hashCode () {
+ int hash = 5;
+
+ hash = 97 * hash + Objects.hashCode(this.getPhoneId());
+ hash = 97 * hash + Objects.hashCode(this.getMobileProvider());
+ hash = 97 * hash + Objects.hashCode(this.getPhoneNumber());
+
+ return hash;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * 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 targetNumber program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.model.phonenumbers.mobile;
+
+import java.io.Serializable;
+
+/**
+ * An utilities class for mobile numbers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class MobileNumbers implements Serializable {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 291_608_496_882_761L;
+
+ /**
+ * Copy all fields from source object to this
+ * <p>
+ * @param sourceNumber Source number object
+ * @param targetNumber Target number object
+ */
+ public static void copyAll (final DialableMobileNumber sourceNumber, final DialableMobileNumber targetNumber) {
+ // Validate instance
+ if (null == sourceNumber) {
+ // Throw NPE
+ throw new NullPointerException("sourceNumber is null"); //NOI18N
+ } else if (null == targetNumber) {
+ // Throw NPE
+ throw new NullPointerException("targetNumber is null"); //NOI18N
+ }
+
+ // Copy all fields
+ targetNumber.setMobileProvider(sourceNumber.getMobileProvider());
+ targetNumber.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
+ targetNumber.setPhoneId(sourceNumber.getPhoneId());
+ targetNumber.setPhoneNumber(sourceNumber.getPhoneNumber());
+ }
+
+ /**
+ * No constructor for utilities classes
+ */
+ private MobileNumbers () {
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.jphone.model.phonenumbers.mobileprovider;
+
+import java.util.Calendar;
+import java.util.Objects;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jcountry.model.data.CountryData;
+
+/**
+ * A POJO for cellphone providers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "mobile_provider")
+@Table (name = "mobile_provider")
+@NamedQueries (
+ @NamedQuery (name = "AllMobileProvider", query = "SELECT p FROM mobile_provider AS p ORDER BY p.providerId ASC")
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class CellphoneProvider implements MobileProvider {
+
+ /**
+ * Serial number
+ */
+ @Transient
+ private static final long serialVersionUID = 185_878_567_810_590L;
+
+ /**
+ * Country instance ('s dial data)
+ */
+ @JoinColumn (name = "provider_country_id", nullable = false)
+ @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
+ private Country providerCountry;
+
+ /**
+ * Provider dial prefix (example: 0177 for German E+)
+ */
+ @Basic (optional = false)
+ @Column (name = "provider_dial_prefix", length = 10, nullable = false)
+ private Long providerDialPrefix;
+
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "provider_entry_created", nullable = false, updatable = false)
+ private Calendar providerEntryCreated;
+
+ /**
+ * Id number
+ */
+ @Id
+ @GeneratedValue (strategy = GenerationType.IDENTITY)
+ @Column (name = "provider_id", nullable = false, updatable = false)
+ private Long providerId;
+
+ /**
+ * Pattern for mail gateway
+ */
+ @Column (name = "provider_mail_pattern", length = 30)
+ private String providerMailPattern;
+
+ /**
+ * Name of the provider
+ */
+ @Basic (optional = false)
+ @Column (name = "provider_name", length = 30, nullable = false)
+ private String providerName;
+
+ /**
+ * Default constructor
+ */
+ public CellphoneProvider () {
+ }
+
+ /**
+ * Constructor with all required data
+ * <p>
+ * @param providerDialPrefix Dial prefix
+ * @param providerName Name
+ * @param providerCountry Country
+ * @param providerMailPattern Pattern for email
+ */
+ public CellphoneProvider (final Long providerDialPrefix, final String providerName, final Country providerCountry, final String providerMailPattern) {
+ // Call default constructor
+ this();
+
+ // Set all values
+ this.providerDialPrefix = providerDialPrefix;
+ this.providerName = providerName;
+ this.providerCountry = providerCountry;
+ this.providerMailPattern = providerMailPattern;
+ }
+
+ @Override
+ public boolean equals (final Object object) {
+ if (null == object) {
+ return false;
+ } else if (this.getClass() != object.getClass()) {
+ return false;
+ }
+
+ final MobileProvider other = (MobileProvider) object;
+
+ if (!Objects.equals(this.getProviderDialPrefix(), other.getProviderDialPrefix())) {
+ return false;
+ } else if (!Objects.equals(this.getProviderName(), other.getProviderName())) {
+ return false;
+ } else if (!Objects.equals(this.getProviderCountry(), other.getProviderCountry())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode () {
+ int hash = 7;
+ hash = 19 * hash + Objects.hashCode(this.getProviderDialPrefix());
+ hash = 19 * hash + Objects.hashCode(this.getProviderName());
+ hash = 19 * hash + Objects.hashCode(this.getProviderCountry());
+ return hash;
+ }
+
+ @Override
+ public Country getProviderCountry () {
+ return this.providerCountry;
+ }
+
+ @Override
+ public void setProviderCountry (final Country providerCountry) {
+ this.providerCountry = providerCountry;
+ }
+
+ @Override
+ public Long getProviderDialPrefix () {
+ return this.providerDialPrefix;
+ }
+
+ @Override
+ public void setProviderDialPrefix (final Long providerDialPrefix) {
+ this.providerDialPrefix = providerDialPrefix;
+ }
+
+ @Override
+ @SuppressWarnings ("ReturnOfDateField")
+ public Calendar getProviderEntryCreated () {
+ return this.providerEntryCreated;
+ }
+
+ @Override
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setProviderEntryCreated (final Calendar providerEntryCreated) {
+ this.providerEntryCreated = providerEntryCreated;
+ }
+
+ @Override
+ public Long getProviderId () {
+ return this.providerId;
+ }
+
+ @Override
+ public void setProviderId (final Long providerId) {
+ this.providerId = providerId;
+ }
+
+ @Override
+ public String getProviderName () {
+ return this.providerName;
+ }
+
+ @Override
+ public void setProviderName (final String providerName) {
+ this.providerName = providerName;
+ }
+
+ @Override
+ public String getProviderMailPattern () {
+ return this.providerMailPattern;
+ }
+
+ @Override
+ public void setProviderMailPattern (final String providerMailPattern) {
+ this.providerMailPattern = providerMailPattern;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.jphone.model.phonenumbers.mobileprovider;
+
+import java.io.Serializable;
+import java.util.Calendar;
+import org.mxchange.jcountry.model.data.Country;
+
+/**
+ * A POJI for mobile providers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface MobileProvider extends Serializable {
+
+ /**
+ * Getter for id number
+ * <p>
+ * @return Id number
+ */
+ Long getProviderId ();
+
+ /**
+ * Setter for id number
+ * <p>
+ * @param providerId Id number
+ */
+ void setProviderId (final Long providerId);
+
+ /**
+ * Getter for provider dial prefix
+ * <p>
+ * @return Provider dial prefix
+ */
+ Long getProviderDialPrefix ();
+
+ /**
+ * Setter for provider dial prefix
+ * <p>
+ * @param providerDialPrefix Provider dial prefix
+ */
+ void setProviderDialPrefix (final Long providerDialPrefix);
+
+ /**
+ * Getter for provider name
+ * <p>
+ * @return Provider name
+ */
+ String getProviderName ();
+
+ /**
+ * Setter for provider name
+ * <p>
+ * @param providerName Provider name
+ */
+ void setProviderName (final String providerName);
+
+ /**
+ * Getter for country instance ('s dial data)
+ * <p>
+ * @return Country instance
+ */
+ Country getProviderCountry ();
+
+ /**
+ * Setter for country instance ('s dial data)
+ * <p>
+ * @param country Country instance
+ */
+ void setProviderCountry (final Country country);
+
+ /**
+ * Getter for timestamp when this entry has been created
+ * <p>
+ * @return Timestamp when this entry has been created
+ */
+ Calendar getProviderEntryCreated ();
+
+ /**
+ * Setter for timestamp when this entry has been created
+ * <p>
+ * @param providerEntryCreated Timestamp when this entry has been created
+ */
+ void setProviderEntryCreated (final Calendar providerEntryCreated);
+
+ /**
+ * Getter for pattern for mail gateway
+ * <p>
+ * @return Pattern for mail gateway
+ */
+ String getProviderMailPattern ();
+
+ /**
+ * Setter for pattern for mail gateway
+ * <p>
+ * @param providerMailRegex Pattern for mail gateway
+ */
+ void setProviderMailPattern (final String providerMailRegex);
+
+ @Override
+ boolean equals (final Object object);
+
+ @Override
+ int hashCode ();
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * 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 targetMobileProvider program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.model.phonenumbers.mobileprovider;
+
+import java.io.Serializable;
+
+/**
+ * An utilities class for mobile providers
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class MobileProviders implements Serializable {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 15_468_608_721_651L;
+
+ /**
+ * Copies all values from source mobile provider to this
+ * <p>
+ * @param sourceMobileProvider Source mobile provider
+ * @param targetMobileProvider Target mobile provider
+ */
+ public static void copyAll (final MobileProvider sourceMobileProvider, final MobileProvider targetMobileProvider) {
+ // Parameter should not be null
+ if (null == sourceMobileProvider) {
+ // Throw NPE
+ throw new NullPointerException("sourceMobileProvider is null"); //NOI18N
+ } else if (null == targetMobileProvider) {
+ // Throw NPE
+ throw new NullPointerException("targetMobileProvider is null"); //NOI18N
+ }
+
+ // Copy all values
+ targetMobileProvider.getProviderCountry().copyAll(sourceMobileProvider.getProviderCountry());
+ targetMobileProvider.setProviderDialPrefix(sourceMobileProvider.getProviderDialPrefix());
+ targetMobileProvider.setProviderEntryCreated(sourceMobileProvider.getProviderEntryCreated());
+ targetMobileProvider.setProviderId(sourceMobileProvider.getProviderId());
+ targetMobileProvider.setProviderMailPattern(sourceMobileProvider.getProviderMailPattern());
+ targetMobileProvider.setProviderName(sourceMobileProvider.getProviderName());
+ }
+
+ /**
+ * Private constructor, because there is no need for an instance of
+ * targetMobileProvider class.
+ */
+ private MobileProviders () {
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * 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.jphone.phonenumbers;
-
-import java.io.Serializable;
-import java.util.Calendar;
-import org.mxchange.jcountry.data.Country;
-
-/**
- * A POJI for dial-able numbers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface DialableNumber extends Serializable {
-
- /**
- * Getter for country instance ('s dial data)
- * <p>
- * @return Country instance
- */
- Country getPhoneCountry ();
-
- /**
- * Setter for country instance ('s dial data)
- * <p>
- * @param country Country instance
- */
- void setPhoneCountry (final Country country);
-
- /**
- * Getter for id number
- * <p>
- * @return Id number
- */
- Long getPhoneId ();
-
- /**
- * Setter for id number
- * <p>
- * @param phoneId Id number
- */
- void setPhoneId (final Long phoneId);
-
- /**
- * Getter for dial number without prefix
- * <p>
- * @return Dial number without prefix
- */
- Long getPhoneNumber ();
-
- /**
- * Setter for dial number without prefix
- * <p>
- * @param phoneNumber Dial number without prefix
- */
- void setPhoneNumber (final Long phoneNumber);
-
- /**
- * Getter for area code without dial prefix (example: 2151 for Krefeld)
- * <p>
- * @return Area code without dial prefix
- */
- Integer getPhoneAreaCode ();
-
- /**
- * Setter for area code without dial prefix (example: 2151 for Krefeld)
- * <p>
- * @param phoneAreaCode Area code without dial prefix
- */
- void setPhoneAreaCode (final Integer phoneAreaCode);
-
- /**
- * Getter for timestamp when this entry has been created
- * <p>
- * @return Timestamp when this entry has been created
- */
- Calendar getPhoneEntryCreated ();
-
- /**
- * Setter for timestamp when this entry has been created
- * <p>
- * @param phoneEntryCreated Timestamp when this entry has been created
- */
- void setPhoneEntryCreated (final Calendar phoneEntryCreated);
-
- /**
- * Getter for timestamp when this entry has been updated
- * <p>
- * @return Timestamp when this entry has been updated
- */
- Calendar getPhoneEntryUpdated ();
-
- /**
- * Setter for timestamp when this entry has been updated
- * <p>
- * @param phoneEntryUpdated Timestamp when this entry has been updated
- */
- void setPhoneEntryUpdated (final Calendar phoneEntryUpdated);
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * 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.jphone.phonenumbers.fax;
-
-import org.mxchange.jphone.phonenumbers.DialableNumber;
-
-/**
- * A POJI for dialable fax numbers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface DialableFaxNumber extends DialableNumber {
-
- @Override
- boolean equals (final Object object);
-
- @Override
- int hashCode ();
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * 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.jphone.phonenumbers.fax;
-
-import java.util.Calendar;
-import java.util.Objects;
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import org.mxchange.jcountry.data.Country;
-import org.mxchange.jcountry.data.CountryData;
-
-/**
- * A POJO for dialable fax numbers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "fax_numbers")
-@Table (name = "fax_numbers")
-@NamedQueries (
- {
- @NamedQuery (name = "AllFaxNumbers", query = "SELECT f FROM fax_numbers AS f ORDER BY f.phoneId ASC"),
- @NamedQuery (name = "SearchFaxNumberId", query = "SELECT f FROM fax_numbers AS f WHERE f.phoneId = :faxNumberId")
- }
-)
-@SuppressWarnings ("PersistenceUnitPresent")
-public class FaxNumber implements DialableFaxNumber {
-
- /**
- * Serial number
- */
- @Transient
- private static final long serialVersionUID = 17_687_687_191_375L;
-
- /**
- * Area code (example: 2151 for Krefeld)
- */
- @Basic (optional = false)
- @Column (name = "fax_area_code", length = 10, nullable = false)
- private Integer faxAreaCode;
-
- /**
- * Country instance ('s dial data)
- */
- @JoinColumn (name = "fax_country_id", nullable = false)
- @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
- private Country faxCountry;
-
- /**
- * Timestamp when this entry has been created
- */
- @Basic (optional = false)
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "fax_entry_created", nullable = false, updatable = false)
- private Calendar phoneEntryCreated;
-
- /**
- * Timestamp when this entry has been created
- */
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "phone_entry_updated", updatable = false)
- private Calendar phoneEntryUpdated;
-
- /**
- * Id number
- */
- @Id
- @GeneratedValue (strategy = GenerationType.IDENTITY)
- @Column (name = "fax_id", nullable = false, updatable = false)
- private Long phoneId;
-
- /**
- * Fax number without prefix
- */
- @Basic (optional = false)
- @Column (name = "fax_number", nullable = false)
- private Long phoneNumber;
-
- /**
- * Default constructor
- */
- public FaxNumber () {
- }
-
- /**
- * Constructor with country, area code and number
- * <p>
- * @param faxCountry Country instance
- * @param faxAreaCode Area code (without leading zeros)
- * @param faxNumber Fax number (without area code and leading zero)
- */
- public FaxNumber (final Country faxCountry, final Integer faxAreaCode, final Long faxNumber) {
- // Call default constructor
- this();
-
- // Set all values
- this.faxCountry = faxCountry;
- this.faxAreaCode = faxAreaCode;
- this.phoneNumber = faxNumber;
- }
-
- @Override
- public boolean equals (final Object object) {
- if (null == object) {
- return false;
- } else if (this.getClass() != object.getClass()) {
- return false;
- }
-
- final DialableFaxNumber other = (DialableFaxNumber) object;
-
- if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
- return false;
- } else if (!Objects.equals(this.getPhoneId(), other.getPhoneId())) {
- return false;
- } else if (!Objects.equals(this.getPhoneAreaCode(), other.getPhoneAreaCode())) {
- return false;
- } else if (!Objects.equals(this.getPhoneCountry(), other.getPhoneCountry())) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public Integer getPhoneAreaCode () {
- return this.faxAreaCode;
- }
-
- @Override
- public void setPhoneAreaCode (final Integer faxAreaCode) {
- this.faxAreaCode = faxAreaCode;
- }
-
- @Override
- public Country getPhoneCountry () {
- return this.faxCountry;
- }
-
- @Override
- public void setPhoneCountry (final Country faxCountry) {
- this.faxCountry = faxCountry;
- }
-
- @Override
- @SuppressWarnings ("ReturnOfDateField")
- public Calendar getPhoneEntryCreated () {
- return this.phoneEntryCreated;
- }
-
- @Override
- @SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setPhoneEntryCreated (final Calendar phoneEntryCreated) {
- this.phoneEntryCreated = phoneEntryCreated;
- }
-
- @Override
- @SuppressWarnings ("ReturnOfDateField")
- public Calendar getPhoneEntryUpdated () {
- return this.phoneEntryUpdated;
- }
-
- @Override
- @SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setPhoneEntryUpdated (final Calendar phoneEntryUpdated) {
- this.phoneEntryUpdated = phoneEntryUpdated;
- }
-
- @Override
- public Long getPhoneId () {
- return this.phoneId;
- }
-
- @Override
- public void setPhoneId (final Long phoneId) {
- this.phoneId = phoneId;
- }
-
- @Override
- public Long getPhoneNumber () {
- return this.phoneNumber;
- }
-
- @Override
- public void setPhoneNumber (final Long phoneNumber) {
- this.phoneNumber = phoneNumber;
- }
-
- @Override
- public int hashCode () {
- int hash = 3;
-
- hash = 23 * hash + Objects.hashCode(this.getPhoneId());
- hash = 23 * hash + Objects.hashCode(this.getPhoneNumber());
- hash = 23 * hash + Objects.hashCode(this.getPhoneAreaCode());
- hash = 23 * hash + Objects.hashCode(this.getPhoneCountry());
-
- return hash;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 Roland Häder
- *
- * 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.jphone.phonenumbers.fax;
-
-import java.io.Serializable;
-
-/**
- * An utilities class for fax numbers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class FaxNumbers implements Serializable {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 1_948_653_672_761L;
-
- /**
- * Copy all fields from source object to this
- * <p>
- * @param sourceNumber Source number object
- * @param targetNumber Target number object
- */
- public static void copyAll (final DialableFaxNumber sourceNumber, final DialableFaxNumber targetNumber) {
- // Validate instance
- if (null == sourceNumber) {
- // Throw NPE
- throw new NullPointerException("sourceNumber is null"); //NOI18N
- } else if (null == targetNumber) {
- // Throw NPE
- throw new NullPointerException("targetNumber is null"); //NOI18N
- }
-
- // Copy all
- targetNumber.setPhoneAreaCode(sourceNumber.getPhoneAreaCode());
- targetNumber.setPhoneCountry(sourceNumber.getPhoneCountry());
- targetNumber.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
- targetNumber.setPhoneId(sourceNumber.getPhoneId());
- targetNumber.setPhoneNumber(sourceNumber.getPhoneNumber());
- }
-
- /**
- * No constructor for utilities classes
- */
- private FaxNumbers () {
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * 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.jphone.phonenumbers.landline;
-
-import org.mxchange.jphone.phonenumbers.DialableNumber;
-
-/**
- * A POJI for dialable land-line numbers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface DialableLandLineNumber extends DialableNumber {
-
- @Override
- boolean equals (final Object object);
-
- @Override
- int hashCode ();
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * 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.jphone.phonenumbers.landline;
-
-import java.util.Calendar;
-import java.util.Objects;
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import org.mxchange.jcountry.data.Country;
-import org.mxchange.jcountry.data.CountryData;
-
-/**
- * A POJO for dialable phone numbers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "landline_numbers")
-@Table (name = "landline_numbers")
-@NamedQueries (
- {
- @NamedQuery (name = "AllLandLineNumbers", query = "SELECT p FROM landline_numbers AS p ORDER BY p.phoneId ASC"),
- @NamedQuery (name = "SearchLandLineNumberId", query = "SELECT p FROM landline_numbers AS p WHERE p.phoneId = :landLineNumberId")
- }
-)
-@SuppressWarnings ("PersistenceUnitPresent")
-public class LandLineNumber implements DialableLandLineNumber {
-
- /**
- * Serial number
- */
- @Transient
- private static final long serialVersionUID = 18_563_748_781_956L;
-
- /**
- * Area code (example: 2151 for Krefeld)
- */
- @Basic (optional = false)
- @Column (name = "landline_area_code", length = 10, nullable = false)
- private Integer phoneAreaCode;
-
- /**
- * Connection to table "country_data"
- */
- @JoinColumn (name = "landline_country_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
- private Country phoneCountry;
-
- /**
- * Timestamp when this entry has been created
- */
- @Basic (optional = false)
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "landline_entry_created", nullable = false, updatable = false)
- private Calendar phoneEntryCreated;
-
- /**
- * Timestamp when this entry has been created
- */
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "landline_entry_updated", updatable = false)
- private Calendar phoneEntryUpdated;
-
- /**
- * Id number
- */
- @Id
- @GeneratedValue (strategy = GenerationType.IDENTITY)
- @Column (name = "landline_id", length = 10, nullable = false, updatable = false)
- private Long phoneId;
-
- /**
- * Phone number with out dial prefix
- */
- @Basic (optional = false)
- @Column (name = "landline_number", nullable = false)
- private Long phoneNumber;
-
- /**
- * Default constructor
- */
- public LandLineNumber () {
- }
-
- /**
- * Constructor with country instance, area code and number
- * <p>
- * @param phoneCountry Country instance
- * @param phoneAreaCode Phone area code
- * @param phoneNumber Phone number
- */
- public LandLineNumber (final Country phoneCountry, final Integer phoneAreaCode, final Long phoneNumber) {
- // Call default constructor
- this();
-
- // Set all values
- this.phoneCountry = phoneCountry;
- this.phoneAreaCode = phoneAreaCode;
- this.phoneNumber = phoneNumber;
- }
-
- @Override
- public boolean equals (final Object object) {
- if (null == object) {
- return false;
- } else if (this.getClass() != object.getClass()) {
- return false;
- }
-
- final DialableLandLineNumber other = (DialableLandLineNumber) object;
-
- if (!Objects.equals(this.getPhoneId(), other.getPhoneId())) {
- return false;
- } else if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
- return false;
- } else if (!Objects.equals(this.getPhoneAreaCode(), other.getPhoneAreaCode())) {
- return false;
- } else if (!Objects.equals(this.getPhoneCountry(), other.getPhoneCountry())) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public Integer getPhoneAreaCode () {
- return this.phoneAreaCode;
- }
-
- @Override
- public void setPhoneAreaCode (final Integer phoneAreaCode) {
- this.phoneAreaCode = phoneAreaCode;
- }
-
- @Override
- public Country getPhoneCountry () {
- return this.phoneCountry;
- }
-
- @Override
- public void setPhoneCountry (final Country phoneCountry) {
- this.phoneCountry = phoneCountry;
- }
-
- @Override
- @SuppressWarnings ("ReturnOfDateField")
- public Calendar getPhoneEntryCreated () {
- return this.phoneEntryCreated;
- }
-
- @Override
- @SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setPhoneEntryCreated (final Calendar phoneEntryCreated) {
- this.phoneEntryCreated = phoneEntryCreated;
- }
-
- @Override
- @SuppressWarnings ("ReturnOfDateField")
- public Calendar getPhoneEntryUpdated () {
- return this.phoneEntryUpdated;
- }
-
- @Override
- @SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setPhoneEntryUpdated (final Calendar phoneEntryUpdated) {
- this.phoneEntryUpdated = phoneEntryUpdated;
- }
-
- @Override
- public Long getPhoneId () {
- return this.phoneId;
- }
-
- @Override
- public void setPhoneId (final Long phoneId) {
- this.phoneId = phoneId;
- }
-
- @Override
- public Long getPhoneNumber () {
- return this.phoneNumber;
- }
-
- @Override
- public void setPhoneNumber (final Long phoneNumber) {
- this.phoneNumber = phoneNumber;
- }
-
- @Override
- public int hashCode () {
- int hash = 7;
-
- hash = 47 * hash + Objects.hashCode(this.getPhoneId());
- hash = 47 * hash + Objects.hashCode(this.getPhoneNumber());
- hash = 47 * hash + Objects.hashCode(this.getPhoneAreaCode());
- hash = 47 * hash + Objects.hashCode(this.getPhoneCountry());
-
- return hash;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 Roland Häder
- *
- * 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 targetNumber program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.phonenumbers.landline;
-
-import java.io.Serializable;
-
-/**
- * An utilities class for land-line numbers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class LandLineNumbers implements Serializable {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 18_698_467_372_167_561L;
-
- /**
- * Copy all fields from source object to this
- * <p>
- * @param sourceNumber Source number object
- * @param targetNumber Target number object
- */
- public static void copyAll (final DialableLandLineNumber sourceNumber, final DialableLandLineNumber targetNumber) {
- // Validate instance
- if (null == sourceNumber) {
- // Throw NPE
- throw new NullPointerException("sourceNumber is null"); //NOI18N
- } else if (null == targetNumber) {
- // Throw NPE
- throw new NullPointerException("targetNumber is null"); //NOI18N
- }
-
- // Copy all
- targetNumber.setPhoneAreaCode(sourceNumber.getPhoneAreaCode());
- targetNumber.setPhoneCountry(sourceNumber.getPhoneCountry());
- targetNumber.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
- targetNumber.setPhoneId(sourceNumber.getPhoneId());
- targetNumber.setPhoneNumber(sourceNumber.getPhoneNumber());
- }
-
- /**
- * No constructor for utilities classes
- */
- private LandLineNumbers () {
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * 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.jphone.phonenumbers.mobile;
-
-import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
-
-/**
- * A POJO for dialable mobile numbers with carriers.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface DialableMobileNumber extends DialableNumber {
-
- /**
- * Getter for mobile provider
- * <p>
- * @return Mobile provider
- */
- MobileProvider getMobileProvider ();
-
- /**
- * Setter for mobile provider
- * <p>
- * @param mobileProvider Mobile provider
- */
- void setMobileProvider (final MobileProvider mobileProvider);
-
- @Override
- boolean equals (final Object object);
-
- @Override
- int hashCode ();
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * 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.jphone.phonenumbers.mobile;
-
-import java.util.Calendar;
-import java.util.Objects;
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.phonenumbers.mobileprovider.CellphoneProvider;
-import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
-
-/**
- * A POJO for dialable cellphone numbers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "mobile_numbers")
-@Table (name = "mobile_numbers")
-@NamedQueries (
- {
- @NamedQuery (name = "AllMobileNumbers", query = "SELECT c FROM mobile_numbers AS c ORDER BY c.phoneId ASC"),
- @NamedQuery (name = "SearchMobileNumberId", query = "SELECT c FROM mobile_numbers AS c WHERE c.phoneId = :mobileNumberId")
- }
-)
-@SuppressWarnings ("PersistenceUnitPresent")
-public class MobileNumber implements DialableMobileNumber {
-
- /**
- * Serial number
- */
- @Transient
- private static final long serialVersionUID = 13_859_879_482_106L;
-
- /**
- * Connection to table "mobile_provider" (for dial prefix and more data)
- */
- @JoinColumn (name = "mobile_provider_id", nullable = false)
- @OneToOne (targetEntity = CellphoneProvider.class, cascade = CascadeType.REFRESH, optional = false)
- private MobileProvider mobileProvider;
-
- /**
- * Timestamp when this entry has been created
- */
- @Basic (optional = false)
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "mobile_entry_created", nullable = false, updatable = false)
- private Calendar phoneEntryCreated;
-
- /**
- * Timestamp when this entry has been created
- */
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "mobile_entry_updated", updatable = false)
- private Calendar phoneEntryUpdated;
-
- /**
- * Id number
- */
- @Id
- @GeneratedValue (strategy = GenerationType.IDENTITY)
- @Column (name = "mobile_id", nullable = false, updatable = false)
- private Long phoneId;
-
- /**
- * Number without prefix to dial
- */
- @Basic (optional = false)
- @Column (name = "mobile_number", nullable = false)
- private Long phoneNumber;
-
- /**
- * Default constructor
- */
- public MobileNumber () {
- }
-
- /**
- * Constructor with cellphone provider and number
- * <p>
- * @param mobileProvider Mobile provider
- * @param mobileNumber Mobile number
- */
- public MobileNumber (final MobileProvider mobileProvider, final Long mobileNumber) {
- // Call default constructor
- this();
-
- // Set all values
- this.mobileProvider = mobileProvider;
- this.phoneNumber = mobileNumber;
- }
-
- @Override
- public boolean equals (final Object object) {
- if (null == object) {
- return false;
- } else if (this.getClass() != object.getClass()) {
- return false;
- }
-
- final DialableMobileNumber other = (DialableMobileNumber) object;
-
- if (!Objects.equals(this.getPhoneId(), other.getPhoneId())) {
- return false;
- } else if (!Objects.equals(this.getMobileProvider(), other.getMobileProvider())) {
- return false;
- } else if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public MobileProvider getMobileProvider () {
- return this.mobileProvider;
- }
-
- @Override
- public void setMobileProvider (final MobileProvider mobileProvider) {
- this.mobileProvider = mobileProvider;
- }
-
- @Override
- @Deprecated
- public Integer getPhoneAreaCode () {
- throw new UnsupportedOperationException("Mobile numbers don't have area codes. Please fix your code."); //NOI18N
- }
-
- @Override
- @Deprecated
- public void setPhoneAreaCode (final Integer phoneAreaCode) {
- throw new UnsupportedOperationException("Mobile numbers don't have area codes. Please fix your code."); //NOI18N
- }
-
- @Override
- @Deprecated
- public Country getPhoneCountry () {
- throw new UnsupportedOperationException("The country code is provided by MobileProvider."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
- @Deprecated
- public void setPhoneCountry (final Country country) {
- throw new UnsupportedOperationException("The country code is provided by MobileProvider."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
- @SuppressWarnings ("ReturnOfDateField")
- public Calendar getPhoneEntryCreated () {
- return this.phoneEntryCreated;
- }
-
- @Override
- @SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setPhoneEntryCreated (final Calendar phoneEntryCreated) {
- this.phoneEntryCreated = phoneEntryCreated;
- }
-
- @Override
- @SuppressWarnings ("ReturnOfDateField")
- public Calendar getPhoneEntryUpdated () {
- return this.phoneEntryUpdated;
- }
-
- @Override
- @SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setPhoneEntryUpdated (final Calendar phoneEntryUpdated) {
- this.phoneEntryUpdated = phoneEntryUpdated;
- }
-
- @Override
- public Long getPhoneId () {
- return this.phoneId;
- }
-
- @Override
- public void setPhoneId (final Long phoneId) {
- this.phoneId = phoneId;
- }
-
- @Override
- public Long getPhoneNumber () {
- return this.phoneNumber;
- }
-
- @Override
- public void setPhoneNumber (final Long phoneNumber) {
- this.phoneNumber = phoneNumber;
- }
-
- @Override
- public int hashCode () {
- int hash = 5;
-
- hash = 97 * hash + Objects.hashCode(this.getPhoneId());
- hash = 97 * hash + Objects.hashCode(this.getMobileProvider());
- hash = 97 * hash + Objects.hashCode(this.getPhoneNumber());
-
- return hash;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 Roland Häder
- *
- * 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 targetNumber program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.phonenumbers.mobile;
-
-import java.io.Serializable;
-
-/**
- * An utilities class for mobile numbers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class MobileNumbers implements Serializable {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 291_608_496_882_761L;
-
- /**
- * Copy all fields from source object to this
- * <p>
- * @param sourceNumber Source number object
- * @param targetNumber Target number object
- */
- public static void copyAll (final DialableMobileNumber sourceNumber, final DialableMobileNumber targetNumber) {
- // Validate instance
- if (null == sourceNumber) {
- // Throw NPE
- throw new NullPointerException("sourceNumber is null"); //NOI18N
- } else if (null == targetNumber) {
- // Throw NPE
- throw new NullPointerException("targetNumber is null"); //NOI18N
- }
-
- // Copy all fields
- targetNumber.setMobileProvider(sourceNumber.getMobileProvider());
- targetNumber.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
- targetNumber.setPhoneId(sourceNumber.getPhoneId());
- targetNumber.setPhoneNumber(sourceNumber.getPhoneNumber());
- }
-
- /**
- * No constructor for utilities classes
- */
- private MobileNumbers () {
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * 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.jphone.phonenumbers.mobileprovider;
-
-import java.util.Calendar;
-import java.util.Objects;
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import org.mxchange.jcountry.data.Country;
-import org.mxchange.jcountry.data.CountryData;
-
-/**
- * A POJO for cellphone providers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "mobile_provider")
-@Table (name = "mobile_provider")
-@NamedQueries (
- @NamedQuery (name = "AllMobileProvider", query = "SELECT p FROM mobile_provider AS p ORDER BY p.providerId ASC")
-)
-@SuppressWarnings ("PersistenceUnitPresent")
-public class CellphoneProvider implements MobileProvider {
-
- /**
- * Serial number
- */
- @Transient
- private static final long serialVersionUID = 185_878_567_810_590L;
-
- /**
- * Country instance ('s dial data)
- */
- @JoinColumn (name = "provider_country_id", nullable = false)
- @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
- private Country providerCountry;
-
- /**
- * Provider dial prefix (example: 0177 for German E+)
- */
- @Basic (optional = false)
- @Column (name = "provider_dial_prefix", length = 10, nullable = false)
- private Long providerDialPrefix;
-
- /**
- * Timestamp when this entry has been created
- */
- @Basic (optional = false)
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "provider_entry_created", nullable = false, updatable = false)
- private Calendar providerEntryCreated;
-
- /**
- * Id number
- */
- @Id
- @GeneratedValue (strategy = GenerationType.IDENTITY)
- @Column (name = "provider_id", nullable = false, updatable = false)
- private Long providerId;
-
- /**
- * Pattern for mail gateway
- */
- @Column (name = "provider_mail_pattern", length = 30)
- private String providerMailPattern;
-
- /**
- * Name of the provider
- */
- @Basic (optional = false)
- @Column (name = "provider_name", length = 30, nullable = false)
- private String providerName;
-
- /**
- * Default constructor
- */
- public CellphoneProvider () {
- }
-
- /**
- * Constructor with all required data
- * <p>
- * @param providerDialPrefix Dial prefix
- * @param providerName Name
- * @param providerCountry Country
- * @param providerMailPattern Pattern for email
- */
- public CellphoneProvider (final Long providerDialPrefix, final String providerName, final Country providerCountry, final String providerMailPattern) {
- // Call default constructor
- this();
-
- // Set all values
- this.providerDialPrefix = providerDialPrefix;
- this.providerName = providerName;
- this.providerCountry = providerCountry;
- this.providerMailPattern = providerMailPattern;
- }
-
- @Override
- public boolean equals (final Object object) {
- if (null == object) {
- return false;
- } else if (this.getClass() != object.getClass()) {
- return false;
- }
-
- final MobileProvider other = (MobileProvider) object;
-
- if (!Objects.equals(this.getProviderDialPrefix(), other.getProviderDialPrefix())) {
- return false;
- } else if (!Objects.equals(this.getProviderName(), other.getProviderName())) {
- return false;
- } else if (!Objects.equals(this.getProviderCountry(), other.getProviderCountry())) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode () {
- int hash = 7;
- hash = 19 * hash + Objects.hashCode(this.getProviderDialPrefix());
- hash = 19 * hash + Objects.hashCode(this.getProviderName());
- hash = 19 * hash + Objects.hashCode(this.getProviderCountry());
- return hash;
- }
-
- @Override
- public Country getProviderCountry () {
- return this.providerCountry;
- }
-
- @Override
- public void setProviderCountry (final Country providerCountry) {
- this.providerCountry = providerCountry;
- }
-
- @Override
- public Long getProviderDialPrefix () {
- return this.providerDialPrefix;
- }
-
- @Override
- public void setProviderDialPrefix (final Long providerDialPrefix) {
- this.providerDialPrefix = providerDialPrefix;
- }
-
- @Override
- @SuppressWarnings ("ReturnOfDateField")
- public Calendar getProviderEntryCreated () {
- return this.providerEntryCreated;
- }
-
- @Override
- @SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setProviderEntryCreated (final Calendar providerEntryCreated) {
- this.providerEntryCreated = providerEntryCreated;
- }
-
- @Override
- public Long getProviderId () {
- return this.providerId;
- }
-
- @Override
- public void setProviderId (final Long providerId) {
- this.providerId = providerId;
- }
-
- @Override
- public String getProviderName () {
- return this.providerName;
- }
-
- @Override
- public void setProviderName (final String providerName) {
- this.providerName = providerName;
- }
-
- @Override
- public String getProviderMailPattern () {
- return this.providerMailPattern;
- }
-
- @Override
- public void setProviderMailPattern (final String providerMailPattern) {
- this.providerMailPattern = providerMailPattern;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * 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.jphone.phonenumbers.mobileprovider;
-
-import java.io.Serializable;
-import java.util.Calendar;
-import org.mxchange.jcountry.data.Country;
-
-/**
- * A POJI for mobile providers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface MobileProvider extends Serializable {
-
- /**
- * Getter for id number
- * <p>
- * @return Id number
- */
- Long getProviderId ();
-
- /**
- * Setter for id number
- * <p>
- * @param providerId Id number
- */
- void setProviderId (final Long providerId);
-
- /**
- * Getter for provider dial prefix
- * <p>
- * @return Provider dial prefix
- */
- Long getProviderDialPrefix ();
-
- /**
- * Setter for provider dial prefix
- * <p>
- * @param providerDialPrefix Provider dial prefix
- */
- void setProviderDialPrefix (final Long providerDialPrefix);
-
- /**
- * Getter for provider name
- * <p>
- * @return Provider name
- */
- String getProviderName ();
-
- /**
- * Setter for provider name
- * <p>
- * @param providerName Provider name
- */
- void setProviderName (final String providerName);
-
- /**
- * Getter for country instance ('s dial data)
- * <p>
- * @return Country instance
- */
- Country getProviderCountry ();
-
- /**
- * Setter for country instance ('s dial data)
- * <p>
- * @param country Country instance
- */
- void setProviderCountry (final Country country);
-
- /**
- * Getter for timestamp when this entry has been created
- * <p>
- * @return Timestamp when this entry has been created
- */
- Calendar getProviderEntryCreated ();
-
- /**
- * Setter for timestamp when this entry has been created
- * <p>
- * @param providerEntryCreated Timestamp when this entry has been created
- */
- void setProviderEntryCreated (final Calendar providerEntryCreated);
-
- /**
- * Getter for pattern for mail gateway
- * <p>
- * @return Pattern for mail gateway
- */
- String getProviderMailPattern ();
-
- /**
- * Setter for pattern for mail gateway
- * <p>
- * @param providerMailRegex Pattern for mail gateway
- */
- void setProviderMailPattern (final String providerMailRegex);
-
- @Override
- boolean equals (final Object object);
-
- @Override
- int hashCode ();
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 Roland Häder
- *
- * 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 targetMobileProvider program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.phonenumbers.mobileprovider;
-
-import java.io.Serializable;
-
-/**
- * An utilities class for mobile providers
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class MobileProviders implements Serializable {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 15_468_608_721_651L;
-
- /**
- * Copies all values from source mobile provider to this
- * <p>
- * @param sourceMobileProvider Source mobile provider
- * @param targetMobileProvider Target mobile provider
- */
- public static void copyAll (final MobileProvider sourceMobileProvider, final MobileProvider targetMobileProvider) {
- // Parameter should not be null
- if (null == sourceMobileProvider) {
- // Throw NPE
- throw new NullPointerException("sourceMobileProvider is null"); //NOI18N
- } else if (null == targetMobileProvider) {
- // Throw NPE
- throw new NullPointerException("targetMobileProvider is null"); //NOI18N
- }
-
- // Copy all values
- targetMobileProvider.getProviderCountry().copyAll(sourceMobileProvider.getProviderCountry());
- targetMobileProvider.setProviderDialPrefix(sourceMobileProvider.getProviderDialPrefix());
- targetMobileProvider.setProviderEntryCreated(sourceMobileProvider.getProviderEntryCreated());
- targetMobileProvider.setProviderId(sourceMobileProvider.getProviderId());
- targetMobileProvider.setProviderMailPattern(sourceMobileProvider.getProviderMailPattern());
- targetMobileProvider.setProviderName(sourceMobileProvider.getProviderName());
- }
-
- /**
- * Private constructor, because there is no need for an instance of
- * targetMobileProvider class.
- */
- private MobileProviders () {
- }
-
-}
import java.io.Serializable;
import java.util.Objects;
-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.model.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
*