+++ /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.events.cellphone.deleted;
-
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
-
-/**
- * An event when a cell phone number has been updated
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public class AdminCellphoneNumberDeletedEvent implements AdminDeletedCellphoneNumberEvent {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 18_521_758_718_691_064L;
-
- /**
- * Added mobile provider instance
- */
- private final DialableCellphoneNumber deletedCellphoneNumber;
-
- /**
- * Constructor with deleted cell phone number
- * <p>
- * @param deletedCellphoneNumber Updated cell phone number
- */
- public AdminCellphoneNumberDeletedEvent (final DialableCellphoneNumber deletedCellphoneNumber) {
- // Set it here
- this.deletedCellphoneNumber = deletedCellphoneNumber;
- }
-
- @Override
- public DialableCellphoneNumber getDeletedCellphoneNumber () {
- return this.deletedCellphoneNumber;
- }
-
-}
+++ /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.events.cellphone.deleted;
-
-import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
-
-/**
- * An interface for an event when a cell phone number has been updated
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public interface AdminDeletedCellphoneNumberEvent extends Serializable {
-
- /**
- * Getter for deleted cell phone numbers
- * <p>
- * @return Deleted cell phone numbers
- */
- DialableCellphoneNumber getDeletedCellphoneNumber ();
-
-}
+++ /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.events.cellphone.remove;
-
-import java.util.List;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
-
-/**
- * An event when a cell phone number has been updated
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public class AdminCellphoneNumberRemovedFromListEvent implements AdminRemoveCellphoneNumberFromListEvent {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 18_521_758_718_691_064L;
-
- /**
- * Updated mobile provider instance
- */
- private final List<DialableCellphoneNumber> cellphoneList;
-
- /**
- * Constructor with updated cell phone number
- * <p>
- * @param cellphoneList Updated cell phone number
- */
- public AdminCellphoneNumberRemovedFromListEvent (final List<DialableCellphoneNumber> cellphoneList) {
- // Set it here
- this.cellphoneList = cellphoneList;
- }
-
- @Override
- @SuppressWarnings ("ReturnOfCollectionOrArrayField")
- public List<DialableCellphoneNumber> getCellphoneList () {
- return this.cellphoneList;
- }
-
-}
+++ /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.events.cellphone.remove;
-
-import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
-
-/**
- * An interface for an event when a list needs to be cleared from cell phone
- * numbers.
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public interface AdminRemoveCellphoneNumberFromListEvent extends Serializable {
-
- /**
- * Getter for cell phone numer list
- * <p>
- * @return Cell phone number list
- */
- List<DialableCellphoneNumber> getCellphoneList ();
-
-}
+++ /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.events.cellphone.updated;
-
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
-
-/**
- * An event when a cell phone number has been updated
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public class AdminCellphoneNumberUpdatedEvent implements AdminUpdatedCellphoneNumberEvent {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 18_521_758_718_691_064L;
-
- /**
- * Updated mobile provider instance
- */
- private final DialableCellphoneNumber updatedCellphoneNumber;
-
- /**
- * Constructor with updated cell phone number
- * <p>
- * @param updatedCellphoneNumber Updated cell phone number
- */
- public AdminCellphoneNumberUpdatedEvent (final DialableCellphoneNumber updatedCellphoneNumber) {
- // Set it here
- this.updatedCellphoneNumber = updatedCellphoneNumber;
- }
-
- @Override
- public DialableCellphoneNumber getUpdatedCellphoneNumber () {
- return this.updatedCellphoneNumber;
- }
-
-}
+++ /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.events.cellphone.updated;
-
-import java.io.Serializable;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
-
-/**
- * An interface for an event when a cell phone number has been updated
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public interface AdminUpdatedCellphoneNumberEvent extends Serializable {
-
- /**
- * Getter for updated cell phone numbers
- * <p>
- * @return Updated cell phone numbers
- */
- DialableCellphoneNumber getUpdatedCellphoneNumber ();
-
-}
--- /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.events.mobile.deleted;
+
+import java.io.Serializable;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+
+/**
+ * An interface for an event when a cell phone number has been updated
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface AdminDeletedMobileNumberEvent extends Serializable {
+
+ /**
+ * Getter for deleted cell phone numbers
+ * <p>
+ * @return Deleted cell phone numbers
+ */
+ DialableMobileNumber getDeletedCellphoneNumber ();
+
+}
--- /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.events.mobile.deleted;
+
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+
+/**
+ * An event when a cell phone number has been updated
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public class AdminMobileNumberDeletedEvent implements AdminDeletedMobileNumberEvent {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 18_521_758_718_691_064L;
+
+ /**
+ * Added mobile provider instance
+ */
+ private final DialableMobileNumber deletedCellphoneNumber;
+
+ /**
+ * Constructor with deleted cell phone number
+ * <p>
+ * @param deletedCellphoneNumber Updated cell phone number
+ */
+ public AdminMobileNumberDeletedEvent (final DialableMobileNumber deletedCellphoneNumber) {
+ // Set it here
+ this.deletedCellphoneNumber = deletedCellphoneNumber;
+ }
+
+ @Override
+ public DialableMobileNumber getDeletedCellphoneNumber () {
+ return this.deletedCellphoneNumber;
+ }
+
+}
--- /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.events.mobile.remove;
+
+import java.util.List;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+
+/**
+ * An event when a cell phone number has been updated
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public class AdminMobileNumberRemovedFromListEvent implements AdminRemoveMobileNumberFromListEvent {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 18_521_758_718_691_064L;
+
+ /**
+ * Updated mobile provider instance
+ */
+ private final List<DialableMobileNumber> cellphoneList;
+
+ /**
+ * Constructor with updated cell phone number
+ * <p>
+ * @param cellphoneList Updated cell phone number
+ */
+ public AdminMobileNumberRemovedFromListEvent (final List<DialableMobileNumber> cellphoneList) {
+ // Set it here
+ this.cellphoneList = cellphoneList;
+ }
+
+ @Override
+ @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+ public List<DialableMobileNumber> getCellphoneList () {
+ return this.cellphoneList;
+ }
+
+}
--- /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.events.mobile.remove;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+
+/**
+ * An interface for an event when a list needs to be cleared from cell phone
+ * numbers.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface AdminRemoveMobileNumberFromListEvent extends Serializable {
+
+ /**
+ * Getter for cell phone numer list
+ * <p>
+ * @return Cell phone number list
+ */
+ List<DialableMobileNumber> getCellphoneList ();
+
+}
--- /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.events.mobile.updated;
+
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+
+/**
+ * An event when a cell phone number has been updated
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public class AdminMobileNumberUpdatedEvent implements AdminUpdatedMobileNumberEvent {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 18_521_758_718_691_064L;
+
+ /**
+ * Updated mobile provider instance
+ */
+ private final DialableMobileNumber updatedCellphoneNumber;
+
+ /**
+ * Constructor with updated cell phone number
+ * <p>
+ * @param updatedCellphoneNumber Updated cell phone number
+ */
+ public AdminMobileNumberUpdatedEvent (final DialableMobileNumber updatedCellphoneNumber) {
+ // Set it here
+ this.updatedCellphoneNumber = updatedCellphoneNumber;
+ }
+
+ @Override
+ public DialableMobileNumber getUpdatedCellphoneNumber () {
+ return this.updatedCellphoneNumber;
+ }
+
+}
--- /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.events.mobile.updated;
+
+import java.io.Serializable;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+
+/**
+ * An interface for an event when a cell phone number has been updated
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface AdminUpdatedMobileNumberEvent extends Serializable {
+
+ /**
+ * Getter for updated cell phone numbers
+ * <p>
+ * @return Updated cell phone numbers
+ */
+ DialableMobileNumber getUpdatedCellphoneNumber ();
+
+}
+++ /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.exceptions;
-
-import java.text.MessageFormat;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
-
-/**
- * An exception thrown when a cell phone number is not linked but should be.
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public class CellphoneNotLinkedException extends Exception {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 18_964_581_681_985_597L;
-
- /**
- * Counstructor with cell phone instance
- * <p>
- * @param cellphoneNumber Cell phone instance
- */
- public CellphoneNotLinkedException (final DialableCellphoneNumber cellphoneNumber) {
- // Call super constructor with message
- super(MessageFormat.format("cellphoneNumber={0} with phoneId={1} is not linked.", cellphoneNumber, cellphoneNumber.getPhoneId())); //NOI18N
- }
-
-}
--- /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.exceptions;
+
+import java.text.MessageFormat;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+
+/**
+ * An exception thrown when a cell phone number is not linked but should be.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public class MobileNumberNotLinkedException extends Exception {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 18_964_581_681_985_597L;
+
+ /**
+ * Counstructor with cell phone instance
+ * <p>
+ * @param cellphoneNumber Cell phone instance
+ */
+ public MobileNumberNotLinkedException (final DialableMobileNumber cellphoneNumber) {
+ // Call super constructor with message
+ super(MessageFormat.format("cellphoneNumber={0} with phoneId={1} is not linked.", cellphoneNumber, cellphoneNumber.getPhoneId())); //NOI18N
+ }
+
+}
+++ /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.cellphone;
-
-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 Haeder<roland@mxchange.org>
- */
-@Entity (name = "cellphone_numbers")
-@Table (name = "cellphone_numbers")
-@NamedQueries (
- {
- @NamedQuery (name = "AllCellphoneNumbers", query = "SELECT c FROM cellphone_numbers AS c ORDER BY c.phoneId ASC"),
- @NamedQuery (name = "SearchCellphoneId", query = "SELECT c FROM cellphone_numbers AS c WHERE c.phoneId = :cellphoneId")
- }
-)
-@SuppressWarnings ("PersistenceUnitPresent")
-public class CellphoneNumber implements DialableCellphoneNumber {
-
- /**
- * Serial number
- */
- @Transient
- private static final long serialVersionUID = 13_859_879_482_106L;
-
- /**
- * Connection to table "cellphone_provider" (for dial prefix and more data)
- */
- @JoinColumn (name = "cellphone_provider_id", nullable = false)
- @OneToOne (targetEntity = CellphoneProvider.class, cascade = CascadeType.REFRESH, optional = false)
- private MobileProvider cellphoneProvider;
-
- /**
- * Timestamp when this entry has been created
- */
- @Basic (optional = false)
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "cellphone_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 = "cellphone_id", nullable = false, updatable = false)
- private Long phoneId;
-
- /**
- * Number without prefix to dial
- */
- @Basic (optional = false)
- @Column (name = "cellphone_number", nullable = false)
- private Long phoneNumber;
-
- /**
- * Default constructor
- */
- public CellphoneNumber () {
- }
-
- /**
- * Constructor with cellphone provider and number
- * <p>
- * @param cellphoneProvider Cellphone provider instance
- * @param cellphoneNumber Cellphone number
- */
- public CellphoneNumber (final MobileProvider cellphoneProvider, final Long cellphoneNumber) {
- // Call default constructor
- this();
-
- // Set all values
- this.cellphoneProvider = cellphoneProvider;
- this.phoneNumber = cellphoneNumber;
- }
-
- @Override
- public void copyAll (final DialableCellphoneNumber sourceNumber) {
- // Copy all
- this.setCellphoneProvider(sourceNumber.getCellphoneProvider());
- this.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
- this.setPhoneId(sourceNumber.getPhoneId());
- this.setPhoneNumber(sourceNumber.getPhoneNumber());
- }
-
- @Override
- public boolean equals (final Object object) {
- if (null == object) {
- return false;
- } else if (this.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
- public MobileProvider getCellphoneProvider () {
- return this.cellphoneProvider;
- }
-
- @Override
- public void setCellphoneProvider (final MobileProvider cellphoneProvider) {
- this.cellphoneProvider = cellphoneProvider;
- }
-
- @Override
- @Deprecated
- public Integer getPhoneAreaCode () {
- throw new UnsupportedOperationException("Cellphone 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
- }
-
- @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.getCellphoneProvider());
- hash = 97 * hash + Objects.hashCode(this.getPhoneNumber());
-
- return hash;
- }
-
-}
+++ /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.cellphone;
-
-import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
-
-/**
- * A POJO for dialable cellphone numbers with carriers.
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public interface DialableCellphoneNumber extends DialableNumber {
-
- /**
- * Getter for SMS provider instance
- * <p>
- * @return SMS provider instance
- */
- MobileProvider getCellphoneProvider ();
-
- /**
- * Setter for SMS provider instance
- * <p>
- * @param cellphoneProvider SMS provider instance
- */
- void setCellphoneProvider (final MobileProvider cellphoneProvider);
-
- /**
- * Copy all fields from source object to this
- * <p>
- * @param sourceNumber Source number object
- */
- void copyAll (final DialableCellphoneNumber sourceNumber);
-
- @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.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 Haeder<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);
+
+ /**
+ * 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);
+
+ @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.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 Haeder<roland@mxchange.org>
+ */
+@Entity (name = "mobile_numbers")
+@Table (name = "mobile_numbers")
+@NamedQueries (
+ {
+ @NamedQuery (name = "AllCellphoneNumbers", query = "SELECT c FROM mobile_numbers AS c ORDER BY c.phoneId ASC"),
+ @NamedQuery (name = "SearchCellphoneId", query = "SELECT c FROM mobile_numbers AS c WHERE c.phoneId = :cellphoneId")
+ }
+)
+@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 void copyAll (final DialableMobileNumber sourceNumber) {
+ // Copy all
+ this.setMobileProvider(sourceNumber.getMobileProvider());
+ this.setPhoneEntryCreated(sourceNumber.getPhoneEntryCreated());
+ this.setPhoneId(sourceNumber.getPhoneId());
+ this.setPhoneNumber(sourceNumber.getPhoneNumber());
+ }
+
+ @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.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("Cellphone 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
+ }
+
+ @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.getMobileProvider());
+ hash = 97 * hash + Objects.hashCode(this.getPhoneNumber());
+
+ return hash;
+ }
+
+}
-/*
- * 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.utils;
-
-import java.io.Serializable;
-import java.util.Objects;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
-
-/**
- *
- * @author Roland Haeder<roland@mxchange.org>
- */
-public class PhoneUtils implements Serializable {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 183_598_328_176_450L;
-
- /**
- * Checks if both are the same
- * <p>
- * @param cellphoneNumber Cellphone number 1
- * @param otherNumber Cellphone number 2
- * <p>
- * @return Whether both are the same number
- */
- public static boolean isSameCellphoneNumber (final DialableCellphoneNumber cellphoneNumber, final DialableCellphoneNumber otherNumber) {
- // Test object equality first
- if (Objects.equals(cellphoneNumber, otherNumber)) {
- // Both the same object (null/null or same object)
- return true;
- } else if (((null == cellphoneNumber) && (otherNumber instanceof DialableCellphoneNumber)) || ((null == otherNumber) && (cellphoneNumber instanceof DialableCellphoneNumber))) {
- // One is null the other not
- return false;
- }
-
- // Now compare deeper
- @SuppressWarnings ("null")
- boolean sameProvider = Objects.equals(cellphoneNumber.getCellphoneProvider(), otherNumber.getCellphoneProvider());
- boolean sameNumber = Objects.equals(cellphoneNumber.getPhoneNumber(), otherNumber.getPhoneNumber());
-
- // All are the same?
- return (sameProvider && sameNumber);
- }
-
- /**
- * Checks if both are the same
- * <p>
- * @param faxNumber First fax number
- * @param otherNumber Second fax number
- * <p>
- * @return Whether both are the same
- */
- public static boolean isSameFaxNumber (final DialableFaxNumber faxNumber, DialableFaxNumber otherNumber) {
- // Test object equality first
- if (Objects.equals(faxNumber, otherNumber)) {
- // Both the same object (null/null or same object)
- return true;
- } else if (((null == faxNumber) && (otherNumber instanceof DialableFaxNumber)) || ((null == otherNumber) && (faxNumber instanceof DialableFaxNumber))) {
- // One is null the other not
- return false;
- }
-
- // Now compare deeper
- @SuppressWarnings ("null")
- boolean sameCountry = Objects.equals(faxNumber.getPhoneCountry(), otherNumber.getPhoneCountry());
- boolean sameAreaCode = Objects.equals(faxNumber.getPhoneAreaCode(), otherNumber.getPhoneAreaCode());
- boolean sameNumber = Objects.equals(faxNumber.getPhoneNumber(), otherNumber.getPhoneNumber());
-
- // All are the same?
- return (sameCountry && sameAreaCode && sameNumber);
- }
-
- /**
- * Checks if both are the same
- * <p>
- * @param landLineNumber First land-line number
- * @param otherNumber Second land-line number
- * <p>
- * @return Whether both are the same
- */
- public static boolean isSameLandLineNumber (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber otherNumber) {
- // Test object equality first
- if (Objects.equals(landLineNumber, otherNumber)) {
- // Both the same object (null/null or same object)
- return true;
- } else if (((null == landLineNumber) && (otherNumber instanceof DialableLandLineNumber)) || ((null == otherNumber) && (landLineNumber instanceof DialableLandLineNumber))) {
- // One is null the other not
- return false;
- }
-
- // Now compare deeper
- @SuppressWarnings ("null")
- boolean sameCountry = Objects.equals(landLineNumber.getPhoneCountry(), otherNumber.getPhoneCountry());
- boolean sameAreaCode = Objects.equals(landLineNumber.getPhoneAreaCode(), otherNumber.getPhoneAreaCode());
- boolean sameNumber = Objects.equals(landLineNumber.getPhoneNumber(), otherNumber.getPhoneNumber());
-
- // All are the same?
- return (sameCountry && sameAreaCode && sameNumber);
- }
-
- /**
- * Private constructor for utility classes
- */
- private PhoneUtils () {
- }
-
-}
+/*\r
+ * Copyright (C) 2016 Roland Haeder\r
+ *\r
+ * This program is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.\r
+ */\r
+package org.mxchange.jphone.utils;\r
+\r
+import java.io.Serializable;\r
+import java.util.Objects;\r
+import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;\r
+import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;\r
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;\r
+\r
+/**\r
+ *\r
+ * @author Roland Haeder<roland@mxchange.org>\r
+ */\r
+public class PhoneUtils implements Serializable {\r
+\r
+ /**\r
+ * Serial number\r
+ */\r
+ private static final long serialVersionUID = 183_598_328_176_450L;\r
+\r
+ /**\r
+ * Checks if both are the same\r
+ * <p>\r
+ * @param cellphoneNumber Cellphone number 1\r
+ * @param otherNumber Cellphone number 2\r
+ * <p>\r
+ * @return Whether both are the same number\r
+ */\r
+ public static boolean isSameCellphoneNumber (final DialableMobileNumber cellphoneNumber, final DialableMobileNumber otherNumber) {\r
+ // Test object equality first\r
+ if (Objects.equals(cellphoneNumber, otherNumber)) {\r
+ // Both the same object (null/null or same object)\r
+ return true;\r
+ } else if (((null == cellphoneNumber) && (otherNumber instanceof DialableMobileNumber)) || ((null == otherNumber) && (cellphoneNumber instanceof DialableMobileNumber))) {\r
+ // One is null the other not\r
+ return false;\r
+ }\r
+\r
+ // Now compare deeper\r
+ @SuppressWarnings ("null")\r
+ boolean sameProvider = Objects.equals(cellphoneNumber.getMobileProvider(), otherNumber.getMobileProvider());\r
+ boolean sameNumber = Objects.equals(cellphoneNumber.getPhoneNumber(), otherNumber.getPhoneNumber());\r
+\r
+ // All are the same?\r
+ return (sameProvider && sameNumber);\r
+ }\r
+\r
+ /**\r
+ * Checks if both are the same\r
+ * <p>\r
+ * @param faxNumber First fax number\r
+ * @param otherNumber Second fax number\r
+ * <p>\r
+ * @return Whether both are the same\r
+ */\r
+ public static boolean isSameFaxNumber (final DialableFaxNumber faxNumber, DialableFaxNumber otherNumber) {\r
+ // Test object equality first\r
+ if (Objects.equals(faxNumber, otherNumber)) {\r
+ // Both the same object (null/null or same object)\r
+ return true;\r
+ } else if (((null == faxNumber) && (otherNumber instanceof DialableFaxNumber)) || ((null == otherNumber) && (faxNumber instanceof DialableFaxNumber))) {\r
+ // One is null the other not\r
+ return false;\r
+ }\r
+\r
+ // Now compare deeper\r
+ @SuppressWarnings ("null")\r
+ boolean sameCountry = Objects.equals(faxNumber.getPhoneCountry(), otherNumber.getPhoneCountry());\r
+ boolean sameAreaCode = Objects.equals(faxNumber.getPhoneAreaCode(), otherNumber.getPhoneAreaCode());\r
+ boolean sameNumber = Objects.equals(faxNumber.getPhoneNumber(), otherNumber.getPhoneNumber());\r
+\r
+ // All are the same?\r
+ return (sameCountry && sameAreaCode && sameNumber);\r
+ }\r
+\r
+ /**\r
+ * Checks if both are the same\r
+ * <p>\r
+ * @param landLineNumber First land-line number\r
+ * @param otherNumber Second land-line number\r
+ * <p>\r
+ * @return Whether both are the same\r
+ */\r
+ public static boolean isSameLandLineNumber (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber otherNumber) {\r
+ // Test object equality first\r
+ if (Objects.equals(landLineNumber, otherNumber)) {\r
+ // Both the same object (null/null or same object)\r
+ return true;\r
+ } else if (((null == landLineNumber) && (otherNumber instanceof DialableLandLineNumber)) || ((null == otherNumber) && (landLineNumber instanceof DialableLandLineNumber))) {\r
+ // One is null the other not\r
+ return false;\r
+ }\r
+\r
+ // Now compare deeper\r
+ @SuppressWarnings ("null")\r
+ boolean sameCountry = Objects.equals(landLineNumber.getPhoneCountry(), otherNumber.getPhoneCountry());\r
+ boolean sameAreaCode = Objects.equals(landLineNumber.getPhoneAreaCode(), otherNumber.getPhoneAreaCode());\r
+ boolean sameNumber = Objects.equals(landLineNumber.getPhoneNumber(), otherNumber.getPhoneNumber());\r
+\r
+ // All are the same?\r
+ return (sameCountry && sameAreaCode && sameNumber);\r
+ }\r
+\r
+ /**\r
+ * Private constructor for utility classes\r
+ */\r
+ private PhoneUtils () {\r
+ }\r
+\r
+}\r