+ this.emailAddresses.remove(contact.getContactEmailAddress());
+ }
+
+ /**
+ * Removes given fax number from all contacts
+ * <p>
+ * @param faxNumber Fax number to remove
+ */
+ private void removeFromContacts (final DialableFaxNumber faxNumber) {
+ // Is it valid?
+ if (null == faxNumber) {
+ // Throw NPE
+ throw new NullPointerException("faxNumber is null"); //NOI18N
+ } else if (faxNumber.getPhoneId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("faxNumber.phoneId is null"); //NOI18N
+ } else if (faxNumber.getPhoneId() < 1) {
+ // Throw NPE again
+ throw new NullPointerException(MessageFormat.format("faxNumber.phoneId={0} is not valid", faxNumber.getPhoneId())); //NOI18N
+ }
+
+ // Loop through all contacts
+ for (final Contact contact : this.contacts) {
+ // Is the number set?
+ if (Objects.equals(contact.getContactFaxNumber(), faxNumber)) {
+ // Found it
+ contact.setContactFaxNumber(null);
+ }
+ }
+ }
+
+ /**
+ * Removes given land-line number from all contacts
+ * <p>
+ * @param landLineNumber Land-line number to remove
+ */
+ private void removeFromContacts (final DialableLandLineNumber landLineNumber) {
+ // Is it valid?
+ if (null == landLineNumber) {
+ // Throw NPE
+ throw new NullPointerException("landLineNumber is null"); //NOI18N
+ } else if (landLineNumber.getPhoneId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
+ } else if (landLineNumber.getPhoneId() < 1) {
+ // Throw NPE again
+ throw new NullPointerException(MessageFormat.format("landLineNumber.phoneId={0} is not valid", landLineNumber.getPhoneId())); //NOI18N
+ }
+
+ // Loop through all contacts
+ for (final Contact contact : this.contacts) {
+ // Is the number set?
+ if (Objects.equals(contact.getContactLandLineNumber(), landLineNumber)) {
+ // Found it
+ contact.setContactLandLineNumber(null);
+ }
+ }
+ }
+
+ /**
+ * Removes given mobile number from all contacts
+ * <p>
+ * @param mobileNumber Mobile number to remove
+ */
+ private void removeFromContacts (final DialableMobileNumber mobileNumber) {
+ // Log message
+ System.out.println(MessageFormat.format("{0}.removeFromContacts: CALLED!", this.getClass().getSimpleName())); //NOI18N
+
+ // Is it valid?
+ if (null == mobileNumber) {
+ // Throw NPE
+ throw new NullPointerException("mobileNumber is null"); //NOI18N
+ } else if (mobileNumber.getPhoneId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("mobileNumber.phoneId is null"); //NOI18N
+ } else if (mobileNumber.getPhoneId() < 1) {
+ // Throw NPE again
+ throw new NullPointerException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", mobileNumber.getPhoneId())); //NOI18N
+ }
+
+ // Loop through all contacts
+ for (final Contact contact : this.contacts) {
+ // Log message
+ System.out.println(MessageFormat.format("{0}.removeFromContacts: contact={1}", this.getClass().getSimpleName(), contact)); //NOI18N
+
+ // Is the number set?
+ if (Objects.equals(contact.getContactMobileNumber(), mobileNumber)) {
+ // Log message
+ System.out.println(MessageFormat.format("{0}.removeFromContacts: Unsetting ...", this.getClass().getSimpleName())); //NOI18N
+
+ // Unset it
+ contact.setContactMobileNumber(null);
+ }
+ }