/*
- * Copyright (C) 2016 Roland Haeder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
*
* 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
*/
package org.mxchange.jcontacts.events.landline.linked;
-import java.io.Serializable;
-import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
/**
- * An interface for an event when a land-line number has been linked with a
- * contact
+ * An event when a land-line number has been linked with a contact
* <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Hรคder<roland@mxchange.org>
*/
-public interface AdminLinkedLandLineNumberEvent extends Serializable {
+public class AdminLinkedLandLineNumberEvent implements ObservableAdminLinkedLandLineNumberEvent {
/**
- * Getter for linked land-line numbers
- * <p>
- * @return Linked land-line numbers
+ * Serial number
*/
- DialableLandLineNumber getLinkedLandLineNumber ();
+ private static final long serialVersionUID = 18_521_758_718_691_065L;
/**
- * Getter for contact instance
+ * Contact instance
+ */
+ private final Contact contact;
+
+ /**
+ * Linked land-line number
+ */
+ private final DialableLandLineNumber linkedLandLineNumber;
+
+ /**
+ * Constructor with unlinked land-line number
* <p>
- * @return Contact instance
+ * @param contact Contact with linked land-line instance
+ * @param linkedLandLineNumber Linked land-line number
*/
- Contact getContact ();
+ public AdminLinkedLandLineNumberEvent (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;
+ }
}