From 8c894cbd48763ba6e77ebe756b9276dd1c25d5ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 18 Aug 2016 16:47:52 +0200 Subject: [PATCH] Continued a bit: - added new events for linking fax, land-line and mobile numbers with contacts --- .../fax/linked/AdminFaxNumberLinkedEvent.java | 66 +++++++++++++++++++ .../fax/linked/AdminLinkedFaxNumberEvent.java | 44 +++++++++++++ .../unlinked/AdminFaxNumberUnlinkedEvent.java | 12 ++-- .../unlinked/AdminUnlinkedFaxNumberEvent.java | 4 +- .../AdminLandLineNumberLinkedEvent.java | 66 +++++++++++++++++++ .../AdminLinkedLandLineNumberEvent.java | 45 +++++++++++++ .../AdminUnlinkedLandLineNumberEvent.java | 4 +- .../linked/AdminLinkedMobileNumberEvent.java | 44 +++++++++++++ .../linked/AdminMobileNumberLinkedEvent.java | 66 +++++++++++++++++++ .../AdminUnlinkedMobileNumberEvent.java | 4 +- 10 files changed, 343 insertions(+), 12 deletions(-) create mode 100644 src/org/mxchange/jcontacts/events/fax/linked/AdminFaxNumberLinkedEvent.java create mode 100644 src/org/mxchange/jcontacts/events/fax/linked/AdminLinkedFaxNumberEvent.java create mode 100644 src/org/mxchange/jcontacts/events/landline/linked/AdminLandLineNumberLinkedEvent.java create mode 100644 src/org/mxchange/jcontacts/events/landline/linked/AdminLinkedLandLineNumberEvent.java create mode 100644 src/org/mxchange/jcontacts/events/mobile/linked/AdminLinkedMobileNumberEvent.java create mode 100644 src/org/mxchange/jcontacts/events/mobile/linked/AdminMobileNumberLinkedEvent.java diff --git a/src/org/mxchange/jcontacts/events/fax/linked/AdminFaxNumberLinkedEvent.java b/src/org/mxchange/jcontacts/events/fax/linked/AdminFaxNumberLinkedEvent.java new file mode 100644 index 0000000..c189b3a --- /dev/null +++ b/src/org/mxchange/jcontacts/events/fax/linked/AdminFaxNumberLinkedEvent.java @@ -0,0 +1,66 @@ +/* + * 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.jcontacts.events.fax.linked; + +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; + +/** + * An event when a fax number has been linked with a contact + *

+ * @author Roland Haeder + */ +public class AdminFaxNumberLinkedEvent implements AdminLinkedFaxNumberEvent { + + /** + * Serial number + */ + private static final long serialVersionUID = 18_521_758_718_691_064L; + + /** + * Contact instance + */ + private final Contact contact; + + /** + * Linked fax number + */ + private final DialableFaxNumber linkedFaxNumber; + + /** + * Constructor with unlinked fax number + *

+ * @param contact Contact with linked fax instance + * @param linkedFaxNumber Unlinked fax number + */ + public AdminFaxNumberLinkedEvent (final Contact contact, final DialableFaxNumber linkedFaxNumber) { + // Set it here + this.contact = contact; + this.linkedFaxNumber = linkedFaxNumber; + } + + @Override + public Contact getContact () { + return this.contact; + } + + @Override + public DialableFaxNumber getLinkedFaxNumber () { + return this.linkedFaxNumber; + } + +} diff --git a/src/org/mxchange/jcontacts/events/fax/linked/AdminLinkedFaxNumberEvent.java b/src/org/mxchange/jcontacts/events/fax/linked/AdminLinkedFaxNumberEvent.java new file mode 100644 index 0000000..07878e7 --- /dev/null +++ b/src/org/mxchange/jcontacts/events/fax/linked/AdminLinkedFaxNumberEvent.java @@ -0,0 +1,44 @@ +/* + * 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.jcontacts.events.fax.linked; + +import java.io.Serializable; +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; + +/** + * An interface for an event when a fax number has been linked with a contact + *

+ * @author Roland Haeder + */ +public interface AdminLinkedFaxNumberEvent extends Serializable { + + /** + * Getter for linked fax numbers + *

+ * @return Linked fax numbers + */ + DialableFaxNumber getLinkedFaxNumber (); + + /** + * Getter for contact instance + *

+ * @return Contact instance + */ + Contact getContact (); + +} diff --git a/src/org/mxchange/jcontacts/events/fax/unlinked/AdminFaxNumberUnlinkedEvent.java b/src/org/mxchange/jcontacts/events/fax/unlinked/AdminFaxNumberUnlinkedEvent.java index 327c963..2c0735a 100644 --- a/src/org/mxchange/jcontacts/events/fax/unlinked/AdminFaxNumberUnlinkedEvent.java +++ b/src/org/mxchange/jcontacts/events/fax/unlinked/AdminFaxNumberUnlinkedEvent.java @@ -20,7 +20,7 @@ import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; /** - * An event when a cell phone number has been unlinked + * An event when a fax number has been unlinked *

* @author Roland Haeder */ @@ -42,15 +42,15 @@ public class AdminFaxNumberUnlinkedEvent implements AdminUnlinkedFaxNumberEvent private final DialableFaxNumber unlinkedFaxNumber; /** - * Constructor with unlinked cell phone number + * Constructor with unlinked fax number *

- * @param contact Contact with linked cell phone instance - * @param unlinkedCellphoneNumber Unlinked cell phone number + * @param contact Contact with linked fax instance + * @param unlinkedFaxNumber Unlinked fax number */ - public AdminFaxNumberUnlinkedEvent (final Contact contact, final DialableFaxNumber unlinkedCellphoneNumber) { + public AdminFaxNumberUnlinkedEvent (final Contact contact, final DialableFaxNumber unlinkedFaxNumber) { // Set it here this.contact = contact; - this.unlinkedFaxNumber = unlinkedCellphoneNumber; + this.unlinkedFaxNumber = unlinkedFaxNumber; } @Override diff --git a/src/org/mxchange/jcontacts/events/fax/unlinked/AdminUnlinkedFaxNumberEvent.java b/src/org/mxchange/jcontacts/events/fax/unlinked/AdminUnlinkedFaxNumberEvent.java index e8c044f..69f1f9c 100644 --- a/src/org/mxchange/jcontacts/events/fax/unlinked/AdminUnlinkedFaxNumberEvent.java +++ b/src/org/mxchange/jcontacts/events/fax/unlinked/AdminUnlinkedFaxNumberEvent.java @@ -28,9 +28,9 @@ import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; public interface AdminUnlinkedFaxNumberEvent extends Serializable { /** - * Getter for updated fax numbers + * Getter for unlinked fax numbers *

- * @return Updated fax numbers + * @return Unlinked fax numbers */ DialableFaxNumber getUnlinkedFaxNumber (); diff --git a/src/org/mxchange/jcontacts/events/landline/linked/AdminLandLineNumberLinkedEvent.java b/src/org/mxchange/jcontacts/events/landline/linked/AdminLandLineNumberLinkedEvent.java new file mode 100644 index 0000000..b7c9a3b --- /dev/null +++ b/src/org/mxchange/jcontacts/events/landline/linked/AdminLandLineNumberLinkedEvent.java @@ -0,0 +1,66 @@ +/* + * 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.jcontacts.events.landline.linked; + +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; + +/** + * An event when a land-line number has been linked with a contact + *

+ * @author Roland Haeder + */ +public class AdminLandLineNumberLinkedEvent implements AdminLinkedLandLineNumberEvent { + + /** + * Serial number + */ + private static final long serialVersionUID = 18_521_758_718_691_065L; + + /** + * Contact instance + */ + private final Contact contact; + + /** + * Linked land-line number + */ + private final DialableLandLineNumber linkedLandLineNumber; + + /** + * Constructor with unlinked land-line number + *

+ * @param contact Contact with linked land-line instance + * @param linkedLandLineNumber Linked land-line number + */ + public AdminLandLineNumberLinkedEvent (final Contact contact, final DialableLandLineNumber linkedLandLineNumber) { + // Set it here + this.contact = contact; + this.linkedLandLineNumber = linkedLandLineNumber; + } + + @Override + public Contact getContact () { + return this.contact; + } + + @Override + public DialableLandLineNumber getLinkedLandLineNumber () { + return this.linkedLandLineNumber; + } + +} diff --git a/src/org/mxchange/jcontacts/events/landline/linked/AdminLinkedLandLineNumberEvent.java b/src/org/mxchange/jcontacts/events/landline/linked/AdminLinkedLandLineNumberEvent.java new file mode 100644 index 0000000..6b09520 --- /dev/null +++ b/src/org/mxchange/jcontacts/events/landline/linked/AdminLinkedLandLineNumberEvent.java @@ -0,0 +1,45 @@ +/* + * 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.jcontacts.events.landline.linked; + +import java.io.Serializable; +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; + +/** + * An interface for an event when a land-line number has been linked with a + * contact + *

+ * @author Roland Haeder + */ +public interface AdminLinkedLandLineNumberEvent extends Serializable { + + /** + * Getter for linked land-line numbers + *

+ * @return Linked land-line numbers + */ + DialableLandLineNumber getLinkedLandLineNumber (); + + /** + * Getter for contact instance + *

+ * @return Contact instance + */ + Contact getContact (); + +} diff --git a/src/org/mxchange/jcontacts/events/landline/unlinked/AdminUnlinkedLandLineNumberEvent.java b/src/org/mxchange/jcontacts/events/landline/unlinked/AdminUnlinkedLandLineNumberEvent.java index 002bfdd..a0e3834 100644 --- a/src/org/mxchange/jcontacts/events/landline/unlinked/AdminUnlinkedLandLineNumberEvent.java +++ b/src/org/mxchange/jcontacts/events/landline/unlinked/AdminUnlinkedLandLineNumberEvent.java @@ -28,9 +28,9 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; public interface AdminUnlinkedLandLineNumberEvent extends Serializable { /** - * Getter for updated land-line numbers + * Getter for unlinked land-line numbers *

- * @return Updated land-line numbers + * @return Unlinked land-line numbers */ DialableLandLineNumber getUnlinkedLandLineNumber (); diff --git a/src/org/mxchange/jcontacts/events/mobile/linked/AdminLinkedMobileNumberEvent.java b/src/org/mxchange/jcontacts/events/mobile/linked/AdminLinkedMobileNumberEvent.java new file mode 100644 index 0000000..23bed04 --- /dev/null +++ b/src/org/mxchange/jcontacts/events/mobile/linked/AdminLinkedMobileNumberEvent.java @@ -0,0 +1,44 @@ +/* + * 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.jcontacts.events.mobile.linked; + +import java.io.Serializable; +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; + +/** + * An interface for an event when a mobile number has been linked with a contact + *

+ * @author Roland Haeder + */ +public interface AdminLinkedMobileNumberEvent extends Serializable { + + /** + * Getter for linked mobile numbers + *

+ * @return Linked mobile numbers + */ + DialableMobileNumber getLinkedMobileNumber (); + + /** + * Getter for contact instance + *

+ * @return Contact instance + */ + Contact getContact (); + +} diff --git a/src/org/mxchange/jcontacts/events/mobile/linked/AdminMobileNumberLinkedEvent.java b/src/org/mxchange/jcontacts/events/mobile/linked/AdminMobileNumberLinkedEvent.java new file mode 100644 index 0000000..c9501af --- /dev/null +++ b/src/org/mxchange/jcontacts/events/mobile/linked/AdminMobileNumberLinkedEvent.java @@ -0,0 +1,66 @@ +/* + * 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.jcontacts.events.mobile.linked; + +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; + +/** + * An event when a mobile number has been linked with a contact + *

+ * @author Roland Haeder + */ +public class AdminMobileNumberLinkedEvent implements AdminLinkedMobileNumberEvent { + + /** + * Serial number + */ + private static final long serialVersionUID = 18_521_758_718_691_064L; + + /** + * Contact instance + */ + private final Contact contact; + + /** + * Unlinked mobile number + */ + private final DialableMobileNumber linkedMobileNumber; + + /** + * Constructor with unlinked mobile number + *

+ * @param contact Contact with linked mobile instance + * @param linkedMobileNumber Linked mobile number + */ + public AdminMobileNumberLinkedEvent (final Contact contact, final DialableMobileNumber linkedMobileNumber) { + // Set it here + this.contact = contact; + this.linkedMobileNumber = linkedMobileNumber; + } + + @Override + public Contact getContact () { + return this.contact; + } + + @Override + public DialableMobileNumber getLinkedMobileNumber () { + return this.linkedMobileNumber; + } + +} diff --git a/src/org/mxchange/jcontacts/events/mobile/unlinked/AdminUnlinkedMobileNumberEvent.java b/src/org/mxchange/jcontacts/events/mobile/unlinked/AdminUnlinkedMobileNumberEvent.java index a84d702..af4aaec 100644 --- a/src/org/mxchange/jcontacts/events/mobile/unlinked/AdminUnlinkedMobileNumberEvent.java +++ b/src/org/mxchange/jcontacts/events/mobile/unlinked/AdminUnlinkedMobileNumberEvent.java @@ -28,9 +28,9 @@ import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; public interface AdminUnlinkedMobileNumberEvent extends Serializable { /** - * Getter for updated mobile numbers + * Getter for unlinked mobile numbers *

- * @return Updated mobile numbers + * @return Unlinked mobile numbers */ DialableMobileNumber getUnlinkedMobileNumber (); -- 2.39.5