+/*
+ * Copyright (C) 2017 - 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.jcontactsbusiness.events.branchoffice.updated;
+
+import java.text.MessageFormat;
+import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
+
+/**
+ * An event being fired when a branch office has been updated by an
+ * administrator.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class AdminBranchOfficeUpdatedEvent implements ObservableAdminBranchOfficeUpdatedEvent {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 572_367_561_659_114L;
+
+ /**
+ * Branch office instance being added
+ */
+ private final BranchOffice updatedBranchOffice;
+
+ /**
+ * Constructor with branch office instance
+ * <p>
+ * @param updatedBranchOffice Branch office instance
+ * <p>
+ * @throws NullPointerException If the parameter is null
+ */
+ public AdminBranchOfficeUpdatedEvent (final BranchOffice updatedBranchOffice) {
+ // Check parameter
+ if (null == updatedBranchOffice) {
+ // Throw NPE
+ throw new NullPointerException("updatedBranchOffice is null"); //NOI18N
+ } else if (updatedBranchOffice.getBranchId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("updatedBranchOffice.branchId is null"); //NOI18N
+ } else if (updatedBranchOffice.getBranchId() < 1) {
+ // Throw NPE again
+ throw new NullPointerException(MessageFormat.format("updatedBranchOffice.branchId={0} is not valid", updatedBranchOffice.getBranchId())); //NOI18N
+ }
+
+ // Set it
+ this.updatedBranchOffice = updatedBranchOffice;
+ }
+
+ @Override
+ public BranchOffice getUpdatedBranchOffice () {
+ return this.updatedBranchOffice;
+ }
+
+}