From: Roland Haeder Date: Tue, 12 Apr 2016 18:03:17 +0000 (+0200) Subject: Changed interface (POJI) name SmsProvider to MobileProvider X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5ab87abe1b2277ebc0eb148fe26120334ba8a256;p=jphone-core.git Changed interface (POJI) name SmsProvider to MobileProvider --- diff --git a/src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java b/src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java index 882fd9b..4c4e524 100644 --- a/src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java +++ b/src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java @@ -32,7 +32,7 @@ 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.SmsProvider; +import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider; /** * A POJO for dialable cellphone numbers @@ -53,7 +53,7 @@ public class CellphoneNumber implements DialableCellphoneNumber { */ @JoinColumn (name = "cellphone_provider_id", nullable = false) @OneToOne (targetEntity = CellphoneProvider.class, cascade = CascadeType.REFRESH, optional = false) - private SmsProvider cellphoneProvider; + private MobileProvider cellphoneProvider; /** * Timestamp when this entry has been created @@ -90,7 +90,7 @@ public class CellphoneNumber implements DialableCellphoneNumber { * @param cellphoneProvider Cellphone provider instance * @param cellphoneNumber Cellphone number */ - public CellphoneNumber (final SmsProvider cellphoneProvider, final Long cellphoneNumber) { + public CellphoneNumber (final MobileProvider cellphoneProvider, final Long cellphoneNumber) { // Call default constructor this(); @@ -136,12 +136,12 @@ public class CellphoneNumber implements DialableCellphoneNumber { } @Override - public SmsProvider getCellphoneProvider () { + public MobileProvider getCellphoneProvider () { return this.cellphoneProvider; } @Override - public void setCellphoneProvider (final SmsProvider cellphoneProvider) { + public void setCellphoneProvider (final MobileProvider cellphoneProvider) { this.cellphoneProvider = cellphoneProvider; } @@ -160,13 +160,13 @@ public class CellphoneNumber implements DialableCellphoneNumber { @Override @Deprecated public Country getPhoneCountry () { - throw new UnsupportedOperationException("The country code is provided by SmsProvider."); //To change body of generated methods, choose Tools | Templates. + 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 SmsProvider."); //To change body of generated methods, choose Tools | Templates. + throw new UnsupportedOperationException("The country code is provided by MobileProvider."); //To change body of generated methods, choose Tools | Templates. } @Override diff --git a/src/org/mxchange/jphone/phonenumbers/cellphone/DialableCellphoneNumber.java b/src/org/mxchange/jphone/phonenumbers/cellphone/DialableCellphoneNumber.java index 8776426..8a52e4b 100644 --- a/src/org/mxchange/jphone/phonenumbers/cellphone/DialableCellphoneNumber.java +++ b/src/org/mxchange/jphone/phonenumbers/cellphone/DialableCellphoneNumber.java @@ -17,7 +17,7 @@ package org.mxchange.jphone.phonenumbers.cellphone; import org.mxchange.jphone.phonenumbers.DialableNumber; -import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider; +import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider; /** * A POJO for dialable cellphone numbers with carriers. @@ -31,14 +31,14 @@ public interface DialableCellphoneNumber extends DialableNumber { *

* @return SMS provider instance */ - SmsProvider getCellphoneProvider (); + MobileProvider getCellphoneProvider (); /** * Setter for SMS provider instance *

* @param cellphoneProvider SMS provider instance */ - void setCellphoneProvider (final SmsProvider cellphoneProvider); + void setCellphoneProvider (final MobileProvider cellphoneProvider); /** * Copy all fields from source object to this diff --git a/src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java b/src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java index a41afe5..16f6b72 100644 --- a/src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java +++ b/src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java @@ -43,9 +43,9 @@ import org.mxchange.jcountry.data.CountryData; @Entity (name = "cellphone_provider") @Table (name = "cellphone_provider") @NamedQueries ( - @NamedQuery (name = "AllSmsProvider", query = "SELECT p FROM cellphone_provider AS p ORDER BY p.providerId ASC") + @NamedQuery (name = "AllMobileProvider", query = "SELECT p FROM cellphone_provider AS p ORDER BY p.providerId ASC") ) -public class CellphoneProvider implements SmsProvider { +public class CellphoneProvider implements MobileProvider { /** * Serial number @@ -126,7 +126,7 @@ public class CellphoneProvider implements SmsProvider { return false; } - final SmsProvider other = (SmsProvider) object; + final MobileProvider other = (MobileProvider) object; if (!Objects.equals(this.getProviderDialPrefix(), other.getProviderDialPrefix())) { return false; diff --git a/src/org/mxchange/jphone/phonenumbers/smsprovider/MobileProvider.java b/src/org/mxchange/jphone/phonenumbers/smsprovider/MobileProvider.java new file mode 100644 index 0000000..a3b35a8 --- /dev/null +++ b/src/org/mxchange/jphone/phonenumbers/smsprovider/MobileProvider.java @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.phonenumbers.smsprovider; + +import java.io.Serializable; +import java.util.Calendar; +import org.mxchange.jcountry.data.Country; + +/** + * A POJI for mobile providers + *

+ * @author Roland Haeder + */ +public interface MobileProvider extends Serializable { + + /** + * Getter for id number + *

+ * @return Id number + */ + Long getProviderId (); + + /** + * Setter for id number + *

+ * @param providerId Id number + */ + void setProviderId (final Long providerId); + + /** + * Getter for provider dial prefix + *

+ * @return Provider dial prefix + */ + Long getProviderDialPrefix (); + + /** + * Setter for provider dial prefix + *

+ * @param providerDialPrefix Provider dial prefix + */ + void setProviderDialPrefix (final Long providerDialPrefix); + + /** + * Getter for provider name + *

+ * @return Provider name + */ + String getProviderName (); + + /** + * Setter for provider name + *

+ * @param providerName Provider name + */ + void setProviderName (final String providerName); + + /** + * Getter for country instance ('s dial data) + *

+ * @return Country instance + */ + Country getProviderCountry (); + + /** + * Setter for country instance ('s dial data) + *

+ * @param country Country instance + */ + void setProviderCountry (final Country country); + + /** + * Getter for timestamp when this entry has been created + *

+ * @return Timestamp when this entry has been created + */ + Calendar getProviderEntryCreated (); + + /** + * Setter for timestamp when this entry has been created + *

+ * @param providerEntryCreated Timestamp when this entry has been created + */ + void setProviderEntryCreated (final Calendar providerEntryCreated); + + /** + * Getter for regular expression for mail gateway + *

+ * @return Regular expression for mail gateway + */ + String getProviderMailRegex (); + + /** + * Setter for regular expression for mail gateway + *

+ * @param providerMailRegex Regular expression for mail gateway + */ + void setProviderMailRegex (final String providerMailRegex); + + @Override + boolean equals (final Object object); + + @Override + int hashCode (); + +} diff --git a/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java b/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java deleted file mode 100644 index 18de431..0000000 --- a/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2016 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jphone.phonenumbers.smsprovider; - -import java.io.Serializable; -import java.util.Calendar; -import org.mxchange.jcountry.data.Country; - -/** - * A POJO for SMS provider - *

- * @author Roland Haeder - */ -public interface SmsProvider extends Serializable { - - /** - * Getter for id number - *

- * @return Id number - */ - Long getProviderId (); - - /** - * Setter for id number - *

- * @param providerId Id number - */ - void setProviderId (final Long providerId); - - /** - * Getter for provider dial prefix - *

- * @return Provider dial prefix - */ - Long getProviderDialPrefix (); - - /** - * Setter for provider dial prefix - *

- * @param providerDialPrefix Provider dial prefix - */ - void setProviderDialPrefix (final Long providerDialPrefix); - - /** - * Getter for provider name - *

- * @return Provider name - */ - String getProviderName (); - - /** - * Setter for provider name - *

- * @param providerName Provider name - */ - void setProviderName (final String providerName); - - /** - * Getter for country instance ('s dial data) - *

- * @return Country instance - */ - Country getProviderCountry (); - - /** - * Setter for country instance ('s dial data) - *

- * @param country Country instance - */ - void setProviderCountry (final Country country); - - /** - * Getter for timestamp when this entry has been created - *

- * @return Timestamp when this entry has been created - */ - Calendar getProviderEntryCreated (); - - /** - * Setter for timestamp when this entry has been created - *

- * @param providerEntryCreated Timestamp when this entry has been created - */ - void setProviderEntryCreated (final Calendar providerEntryCreated); - - /** - * Getter for regular expression for mail gateway - *

- * @return Regular expression for mail gateway - */ - String getProviderMailRegex (); - - /** - * Setter for regular expression for mail gateway - *

- * @param providerMailRegex Regular expression for mail gateway - */ - void setProviderMailRegex (final String providerMailRegex); - - @Override - boolean equals (final Object object); - - @Override - int hashCode (); - -}