*/
package org.mxchange.jphone.phonenumbers.cellphone;
+import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
protected CellphoneNumber () {
}
+ @Override
+ public boolean equals (final Object object) {
+ if (object == null) {
+ return false;
+ } else if (getClass() != object.getClass()) {
+ return false;
+ }
+
+ final DialableCellphoneNumber other = (DialableCellphoneNumber) object;
+
+ if (!Objects.equals(this.getCellphoneProvider(), other.getCellphoneProvider())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
+ return false;
+ }
+
+ return true;
+ }
+
@Override
@Deprecated
public Country getPhoneCountry () {
public int compareTo (final DialableCellphoneNumber dialableCellphoneNumber) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
+
+ @Override
+ public int hashCode () {
+ int hash = 5;
+ hash = 97 * hash + Objects.hashCode(this.getCellphoneProvider());
+ hash = 97 * hash + Objects.hashCode(this.getPhoneNumber());
+ return hash;
+ }
}
* @param cellphoneProvider SMS provider instance
*/
public void setCellphoneProvider (final SmsProvider cellphoneProvider);
+
+ @Override
+ public boolean equals (final Object object);
+
+ @Override
+ public int hashCode ();
}
* @author Roland Haeder
*/
public interface DialableFaxNumber extends DialableNumber {
+
+ @Override
+ public boolean equals (final Object object);
+
+ @Override
+ public int hashCode ();
}
*/
package org.mxchange.jphone.phonenumbers.fax;
+import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
* Country instance ('s dial data)
*/
@JoinColumn (name = "fax_country_id", nullable = false)
- @OneToOne(targetEntity = CountryData.class, optional = false, fetch = FetchType.EAGER)
+ @OneToOne (targetEntity = CountryData.class, optional = false, fetch = FetchType.EAGER)
private Country faxCountry;
/**
protected FaxNumber () {
}
+ @Override
+ public boolean equals (final Object object) {
+ if (object == null) {
+ return false;
+ } else if (getClass() != object.getClass()) {
+ return false;
+ }
+
+ final DialableFaxNumber other = (DialableFaxNumber) object;
+
+ 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 Long getPhoneId () {
return this.phoneId;
this.faxCountry = faxCountry;
}
+ @Override
+ public int hashCode () {
+ int hash = 3;
+ hash = 23 * hash + Objects.hashCode(this.getPhoneNumber());
+ hash = 23 * hash + Objects.hashCode(this.getPhoneAreaCode());
+ hash = 23 * hash + Objects.hashCode(this.getPhoneCountry());
+ return hash;
+ }
+
}
/**
* A POJI for dialable land-line numbers
+ * <p>
* @author Roland Haeder
*/
public interface DialableLandLineNumber extends DialableNumber {
+
+ @Override
+ public boolean equals (final Object object);
+
+ @Override
+ public int hashCode ();
}
*/
package org.mxchange.jphone.phonenumbers.landline;
+import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
* Connection to table "country_data"
*/
@JoinColumn (name = "phone_country_id", nullable = false, updatable = false)
- @OneToOne(targetEntity = CountryData.class, optional = false, fetch = FetchType.EAGER)
+ @OneToOne (targetEntity = CountryData.class, optional = false, fetch = FetchType.EAGER)
private Country phoneCountry;
/**
protected LandLineNumber () {
}
+ @Override
+ public boolean equals (Object object) {
+ if (object == null) {
+ return false;
+ } else if (getClass() != object.getClass()) {
+ return false;
+ }
+
+ final DialableLandLineNumber other = (DialableLandLineNumber) object;
+
+ 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 Long getPhoneId () {
return this.phoneId;
public void setPhoneCountry (final Country phoneCountry) {
this.phoneCountry = phoneCountry;
}
+
+ @Override
+ public int hashCode () {
+ int hash = 7;
+ hash = 47 * hash + Objects.hashCode(this.getPhoneNumber());
+ hash = 47 * hash + Objects.hashCode(this.getPhoneAreaCode());
+ hash = 47 * hash + Objects.hashCode(this.getPhoneCountry());
+ return hash;
+ }
}
*/
package org.mxchange.jphone.phonenumbers.smsprovider;
+import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
@NamedQueries (
@NamedQuery (name = "AllSmsProvider", query = "SELECT p FROM cellphone_provider AS p ORDER BY p.providerId ASC")
)
-public class CellphoneProvider implements SmsProvider {
+public class CellphoneProvider implements SmsProvider, Comparable<SmsProvider> {
/**
* Serial number
* Country instance ('s dial data)
*/
@JoinColumn (name = "provider_country_id", nullable = false)
- @OneToOne(targetEntity = CountryData.class, optional = false, fetch = FetchType.EAGER)
+ @OneToOne (targetEntity = CountryData.class, optional = false, fetch = FetchType.EAGER)
private Country providerCountry;
+ @Override
+ public int compareTo (final SmsProvider provider) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public boolean equals (final Object object) {
+ if (object == null) {
+ return false;
+ } else if (getClass() != object.getClass()) {
+ return false;
+ }
+
+ final SmsProvider other = (SmsProvider) 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 Long getProviderId () {
return providerId;
this.providerCountry = providerCountry;
}
+ @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;
+ }
+
}
* @param country Country instance
*/
public void setProviderCountry (final Country country);
+
+ @Override
+ public boolean equals (final Object object);
+
+ @Override
+ public int hashCode ();
}