import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.phonenumbers.smsprovider.CellphoneProvider;
-import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider;
+import org.mxchange.jphone.phonenumbers.mobileprovider.CellphoneProvider;
+import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
/**
* A POJO for dialable cellphone numbers
package org.mxchange.jphone.phonenumbers.cellphone;
import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider;
+import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
/**
* A POJO for dialable cellphone numbers with carriers.
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.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 org.mxchange.jcountry.data.Country;
+import org.mxchange.jcountry.data.CountryData;
+
+/**
+ * A POJO for cellphone providers
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Entity (name = "cellphone_provider")
+@Table (name = "cellphone_provider")
+@NamedQueries (
+ @NamedQuery (name = "AllMobileProvider", query = "SELECT p FROM cellphone_provider AS p ORDER BY p.providerId ASC")
+)
+public class CellphoneProvider implements MobileProvider {
+
+ /**
+ * Serial number
+ */
+ 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;
+
+ /**
+ * Regular expression for mail gateway
+ */
+ @Column (name = "provider_mail_regex", length = 30)
+ private String providerMailRegex;
+
+ /**
+ * Name of the provider
+ */
+ @Basic (optional = false)
+ @Column (name = "provider_name", length = 30, nullable = false)
+ private String providerName;
+
+ /**
+ * Constructor with all required data
+ * <p>
+ * @param providerDialPrefix Dial prefix
+ * @param providerName Name
+ * @param providerCountry Country
+ */
+ public CellphoneProvider (final Long providerDialPrefix, final String providerName, final Country providerCountry) {
+ // Call default constructor
+ this();
+
+ // Set all values
+ this.providerDialPrefix = providerDialPrefix;
+ this.providerName = providerName;
+ this.providerCountry = providerCountry;
+ }
+
+ /**
+ * Default constructor
+ */
+ public CellphoneProvider () {
+ }
+
+ @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
+ public Calendar getProviderEntryCreated () {
+ return this.providerEntryCreated;
+ }
+
+ @Override
+ 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 getProviderMailRegex () {
+ return this.providerMailRegex;
+ }
+
+ @Override
+ public void setProviderMailRegex (final String providerMailRegex) {
+ this.providerMailRegex = providerMailRegex;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.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 Haeder<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 regular expression for mail gateway
+ * <p>
+ * @return Regular expression for mail gateway
+ */
+ String getProviderMailRegex ();
+
+ /**
+ * Setter for regular expression for mail gateway
+ * <p>
+ * @param providerMailRegex Regular expression for mail gateway
+ */
+ void setProviderMailRegex (final String providerMailRegex);
+
+ @Override
+ boolean equals (final Object object);
+
+ @Override
+ int hashCode ();
+
+}
+++ /dev/null
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.phonenumbers.smsprovider;
-
-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 org.mxchange.jcountry.data.Country;
-import org.mxchange.jcountry.data.CountryData;
-
-/**
- * A POJO for cellphone providers
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-@Entity (name = "cellphone_provider")
-@Table (name = "cellphone_provider")
-@NamedQueries (
- @NamedQuery (name = "AllMobileProvider", query = "SELECT p FROM cellphone_provider AS p ORDER BY p.providerId ASC")
-)
-public class CellphoneProvider implements MobileProvider {
-
- /**
- * Serial number
- */
- 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;
-
- /**
- * Regular expression for mail gateway
- */
- @Column (name = "provider_mail_regex", length = 30)
- private String providerMailRegex;
-
- /**
- * Name of the provider
- */
- @Basic (optional = false)
- @Column (name = "provider_name", length = 30, nullable = false)
- private String providerName;
-
- /**
- * Constructor with all required data
- * <p>
- * @param providerDialPrefix Dial prefix
- * @param providerName Name
- * @param providerCountry Country
- */
- public CellphoneProvider (final Long providerDialPrefix, final String providerName, final Country providerCountry) {
- // Call default constructor
- this();
-
- // Set all values
- this.providerDialPrefix = providerDialPrefix;
- this.providerName = providerName;
- this.providerCountry = providerCountry;
- }
-
- /**
- * Default constructor
- */
- public CellphoneProvider () {
- }
-
- @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
- public Calendar getProviderEntryCreated () {
- return this.providerEntryCreated;
- }
-
- @Override
- 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 getProviderMailRegex () {
- return this.providerMailRegex;
- }
-
- @Override
- public void setProviderMailRegex (final String providerMailRegex) {
- this.providerMailRegex = providerMailRegex;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.phonenumbers.smsprovider;
-
-import java.io.Serializable;
-import java.util.Calendar;
-import org.mxchange.jcountry.data.Country;
-
-/**
- * A POJI for mobile providers
- * <p>
- * @author Roland Haeder<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 regular expression for mail gateway
- * <p>
- * @return Regular expression for mail gateway
- */
- String getProviderMailRegex ();
-
- /**
- * Setter for regular expression for mail gateway
- * <p>
- * @param providerMailRegex Regular expression for mail gateway
- */
- void setProviderMailRegex (final String providerMailRegex);
-
- @Override
- boolean equals (final Object object);
-
- @Override
- int hashCode ();
-
-}