2 * Copyright (C) 2016 Roland Häder
\r
4 * This program is free software: you can redistribute it and/or modify
\r
5 * it under the terms of the GNU General Public License as published by
\r
6 * the Free Software Foundation, either version 3 of the License, or
\r
7 * (at your option) any later version.
\r
9 * This program is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 * GNU General Public License for more details.
\r
14 * You should have received a copy of the GNU General Public License
\r
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
17 package org.mxchange.jcontacts.events.contact.update;
\r
19 import java.text.MessageFormat;
\r
20 import org.mxchange.jcontacts.contact.Contact;
\r
23 * An event being fired when the administrator has updated a new user account
\r
25 * @author Roland Häder<roland@mxchange.org>
\r
27 public class AdminContactUpdatedEvent implements AdminUpdatedContactEvent {
\r
32 private static final long serialVersionUID = 185_381_945_234_802L;
\r
35 * Updated contact instance
\r
37 private final Contact updatedContact;
\r
40 * Constructor with updated contact instance
\r
42 * @param updatedContact Updated contact instance
\r
44 public AdminContactUpdatedEvent (final Contact updatedContact) {
\r
45 // Is the contact instance valid?
\r
46 if (null == updatedContact) {
\r
48 throw new NullPointerException("updatedContact is null"); //NOI18N
\r
49 } else if (updatedContact.getContactId() == null) {
\r
51 throw new NullPointerException("updatedContact.contactId is null"); //NOI18N
\r
52 } else if (updatedContact.getContactId() < 1) {
\r
53 // Invalid id number
\r
54 throw new IllegalArgumentException(MessageFormat.format("updatedContact.contactId={0} is invalid.", updatedContact.getContactId())); //NOI18N
\r
58 this.updatedContact = updatedContact;
\r
62 public Contact getUpdatedContact () {
\r
63 return this.updatedContact;
\r