-/*\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.jcontacts.events.contact.add;\r
-\r
-import java.io.Serializable;\r
-import org.mxchange.jcontacts.contact.Contact;\r
-\r
-/**\r
- * An interface for events being fired when an administrator added a new user\r
- * account.\r
- * <p>\r
- * @author Roland Haeder<roland@mxchange.org>\r
- */\r
-public interface AdminAddedContactEvent extends Serializable {\r
-\r
- /**\r
- * Getter for added contact instance\r
- * <p>\r
- * @return Added contact instance\r
- */\r
- Contact getAddedContact ();\r
-\r
-}\r
+/*
+ * 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.jcontacts.events.contact.add;
+
+import java.io.Serializable;
+import org.mxchange.jcontacts.contact.Contact;
+
+/**
+ * An interface for events being fired when an administrator added new contact
+ * data.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface AdminAddedContactEvent extends Serializable {
+
+ /**
+ * Getter for added contact instance
+ * <p>
+ * @return Added contact instance
+ */
+ Contact getAddedContact ();
+
+}
--- /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.jcontacts.events.contact.deleted;
+
+import java.text.MessageFormat;
+import org.mxchange.jcontacts.contact.Contact;
+
+/**
+ * An event being fired when the administrator has deleted a contact
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public class AdminContactDeletedEvent implements AdminDeletedContactEvent {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 14_785_787_174_676_290L;
+
+ /**
+ * Deleted contact instance
+ */
+ private final Contact deletedContact;
+
+ /**
+ * Constructor with deleted contact instance
+ * <p>
+ * @param deletedContact Deleted contact instance
+ */
+ public AdminContactDeletedEvent (final Contact deletedContact) {
+ // Is the contact instance valid?
+ if (null == deletedContact) {
+ // Throw NPE
+ throw new NullPointerException("deletedContact is null"); //NOI18N
+ } else if (deletedContact.getContactId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("deletedContact.contactId is null"); //NOI18N
+ } else if (deletedContact.getContactId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("deletedContact.contactId={0} is invalid.", deletedContact.getContactId())); //NOI18N
+ }
+
+ // Set it here
+ this.deletedContact = deletedContact;
+ }
+
+ @Override
+ public Contact getDeletedContact () {
+ return this.deletedContact;
+ }
+
+}
--- /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.jcontacts.events.contact.deleted;
+
+import java.io.Serializable;
+import org.mxchange.jcontacts.contact.Contact;
+
+/**
+ * An interface for events being fired when an administrator deleted a contact.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface AdminDeletedContactEvent extends Serializable {
+
+ /**
+ * Getter for deleted contact instance
+ * <p>
+ * @return Deleted contact instance
+ */
+ Contact getDeletedContact ();
+
+}