--- /dev/null
+/*
+ * Copyright (C) 2016 - 2020 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
+ * 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.update;
+
+import java.io.Serializable;
+import org.mxchange.jcontacts.model.contact.Contact;
+
+/**
+ * An interface for events being fired when an user updated a new user account.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableUpdatedContactEvent extends Serializable {
+
+ /**
+ * Getter for updated contact instance
+ * <p>
+ * @return Updated contact instance
+ */
+ Contact getUpdatedContact ();
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 - 2020 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
+ * 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.update;
+
+import java.text.MessageFormat;
+import org.mxchange.jcontacts.model.contact.Contact;
+
+/**
+ * An event being fired when an user has updated a new user account
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class UpdatedContactEvent implements ObservableUpdatedContactEvent {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 185_381_945_234_803L;
+
+ /**
+ * Updated contact instance
+ */
+ private final Contact updatedContact;
+
+ /**
+ * Constructor with updated contact instance
+ * <p>
+ * @param updatedContact Updated contact instance
+ */
+ public UpdatedContactEvent (final Contact updatedContact) {
+ // Is the contact instance valid?
+ if (null == updatedContact) {
+ // Throw NPE
+ throw new NullPointerException("updatedContact is null"); //NOI18N
+ } else if (updatedContact.getContactId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("updatedContact.contactId is null"); //NOI18N
+ } else if (updatedContact.getContactId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("updatedContact.contactId={0} is invalid.", updatedContact.getContactId())); //NOI18N
+ }
+
+ // Set it here
+ this.updatedContact = updatedContact;
+ }
+
+ @Override
+ public Contact getUpdatedContact () {
+ return this.updatedContact;
+ }
+
+}