--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * 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.headquarters.added;
+
+import java.text.MessageFormat;
+import org.mxchange.jcontactsbusiness.model.headquarters.Headquarter;
+
+/**
+ * An event being fired when a branch office has been added
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class HeadquartersAddedEvent implements ObservableHeadquartersAddedEvent {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 572_367_561_659_110L;
+
+ /**
+ * Headquarters office instance being added
+ */
+ private final Headquarter headquarters;
+
+ /**
+ * Constructor with branch office instance
+ * <p>
+ * @param headquarters Headquarters office instance
+ * @throws NullPointerException If the parameter is null
+ */
+ public HeadquartersAddedEvent (final Headquarter headquarters) {
+ // Check parameter
+ if (null == headquarters) {
+ // Throw NPE
+ throw new NullPointerException("headquarters is null"); //NOI18N
+ } else if (headquarters.getHeadquartersId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("headquarters.headquartersId is null"); //NOI18N
+ } else if (headquarters.getHeadquartersId() < 1) {
+ // Throw NPE again
+ throw new NullPointerException(MessageFormat.format("headquarters.headquartersId={0} is not valid", headquarters.getHeadquartersId())); //NOI18N
+ }
+
+ // Set it
+ this.headquarters = headquarters;
+ }
+
+ @Override
+ public Headquarter getHeadquarters () {
+ return this.headquarters;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * 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.headquarters.added;
+
+import java.io.Serializable;
+import org.mxchange.jcontactsbusiness.model.headquarters.Headquarter;
+
+/**
+ * An interface for events being triggered when a headquarters has been added.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableHeadquartersAddedEvent extends Serializable {
+
+ /**
+ * Getter for headquarters instance
+ * <p>
+ * @return Headquarters instance
+ */
+ Headquarter getHeadquarters ();
+
+}