*/
public interface DialableFaxNumber extends DialableNumber {
- /**
- * Copy all fields from source object to this
- * <p>
- * @param sourceNumber Source number object
- */
- void copyAll (final DialableFaxNumber sourceNumber);
-
@Override
boolean equals (final Object object);
@Override
int hashCode ();
+
}
this.phoneNumber = faxNumber;
}
- @Override
- public void copyAll (final DialableFaxNumber sourceNumber) {
- // Validate instance
- if (null == sourceNumber) {
- // Throw NPE
- throw new NullPointerException("sourceNumber is null"); //NOI18N
- }
-
- // Copy all
- this.setPhoneAreaCode(sourceNumber.getPhoneAreaCode());
- this.getPhoneCountry().copyAll(sourceNumber.getPhoneCountry());
- this.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
- this.setPhoneId(sourceNumber.getPhoneId());
- this.setPhoneNumber(sourceNumber.getPhoneNumber());
- }
-
@Override
public boolean equals (final Object object) {
if (null == object) {
--- /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 () {
+ }
+
+}
*/
public interface DialableLandLineNumber extends DialableNumber {
- /**
- * Copy all fields from source object to this
- * <p>
- * @param sourceNumber Source number object
- */
- void copyAll (final DialableLandLineNumber sourceNumber);
-
@Override
boolean equals (final Object object);
this.phoneNumber = phoneNumber;
}
- @Override
- public void copyAll (final DialableLandLineNumber sourceNumber) {
- // Validate instance
- if (null == sourceNumber) {
- // Throw NPE
- throw new NullPointerException("sourceNumber is null"); //NOI18N
- }
-
- // Copy all
- this.setPhoneAreaCode(sourceNumber.getPhoneAreaCode());
- this.getPhoneCountry().copyAll(sourceNumber.getPhoneCountry());
- this.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
- this.setPhoneId(sourceNumber.getPhoneId());
- this.setPhoneNumber(sourceNumber.getPhoneNumber());
- }
-
@Override
public boolean equals (final Object object) {
if (null == object) {
--- /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 () {
+ }
+
+}
*/
void setMobileProvider (final MobileProvider mobileProvider);
- /**
- * Copy all fields from source object to this
- * <p>
- * @param sourceNumber Source number object
- */
- void copyAll (final DialableMobileNumber sourceNumber);
-
@Override
boolean equals (final Object object);
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;
/**
* 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)
+ @OneToOne (targetEntity = MobileProvider.class, cascade = CascadeType.REFRESH, optional = false)
private MobileProvider mobileProvider;
/**
this.phoneNumber = mobileNumber;
}
- @Override
- public void copyAll (final DialableMobileNumber sourceNumber) {
- // Validate instance
- if (null == sourceNumber) {
- // Throw NPE
- throw new NullPointerException("sourceNumber is null"); //NOI18N
- }
-
- // Copy all
- this.getMobileProvider().copyAll(sourceNumber.getMobileProvider());
- this.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
- this.setPhoneId(sourceNumber.getPhoneId());
- this.setPhoneNumber(sourceNumber.getPhoneNumber());
- }
-
@Override
public boolean equals (final Object object) {
if (null == object) {
@Override
@Deprecated
public Integer getPhoneAreaCode () {
- throw new UnsupportedOperationException("Cellphone numbers don't have area codes. Please fix your code."); //NOI18N
+ 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("Cellphone numbers don't have area codes. Please fix your code."); //NOI18N
+ throw new UnsupportedOperationException("Mobile numbers don't have area codes. Please fix your code."); //NOI18N
}
@Override
--- /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 () {
+ }
+
+}
this.providerMailPattern = providerMailPattern;
}
- @Override
- public void copyAll (final MobileProvider sourceMobileProvider) {
- // Parameter should not be null
- if (null == sourceMobileProvider) {
- // Throw NPE
- throw new NullPointerException("sourceMobileProvider is null"); //NOI18N
- }
-
- // Copy all values
- this.getProviderCountry().copyAll(sourceMobileProvider.getProviderCountry());
- this.setProviderDialPrefix(sourceMobileProvider.getProviderDialPrefix());
- this.setProviderEntryCreated(sourceMobileProvider.getProviderEntryCreated());
- this.setProviderId(sourceMobileProvider.getProviderId());
- this.setProviderMailPattern(sourceMobileProvider.getProviderMailPattern());
- this.setProviderName(sourceMobileProvider.getProviderName());
- }
-
@Override
public boolean equals (final Object object) {
if (null == object) {
*/
public interface MobileProvider extends Serializable {
- /**
- * Copies all values from source mobile provider to this
- * <p>
- * @param sourceMobileProvider Source mobile provider
- */
- void copyAll (final MobileProvider sourceMobileProvider);
-
/**
* Getter for id number
* <p>
--- /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 () {
+ }
+
+}