From: Roland Häder Date: Fri, 24 Apr 2020 00:42:44 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7c9115d922274349079ad9d3efffddf8641d2f08;p=jcontacts-business-core.git Continued: - renamed branchOffice -> addedBranchOffice - renamed BranchOfficeAddedEvent -> AdminBranchOfficeAddedEvent - renamed ObservableBranchOfficeAddedEvent -> ObservableAdminBranchOfficeAddedEvent - added event for when an administrator has updated a branch office Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/AdminBranchOfficeAddedEvent.java b/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/AdminBranchOfficeAddedEvent.java new file mode 100644 index 0000000..8045429 --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/AdminBranchOfficeAddedEvent.java @@ -0,0 +1,68 @@ +/* + * 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 . + */ +package org.mxchange.jcontactsbusiness.events.branchoffice.added; + +import java.text.MessageFormat; +import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; + +/** + * An event being fired when a branch office has been added by an administrator. + *

+ * @author Roland Häder + */ +public class AdminBranchOfficeAddedEvent implements ObservableAdminBranchOfficeAddedEvent { + + /** + * Serial number + */ + private static final long serialVersionUID = 572_367_561_659_109L; + + /** + * Branch office instance being added + */ + private final BranchOffice addedBranchOffice; + + /** + * Constructor with branch office instance + *

+ * @param addedBranchOffice Branch office instance + * + * @throws NullPointerException If the parameter is null + */ + public AdminBranchOfficeAddedEvent (final BranchOffice addedBranchOffice) { + // Check parameter + if (null == addedBranchOffice) { + // Throw NPE + throw new NullPointerException("addedBranchOffice is null"); //NOI18N + } else if (addedBranchOffice.getBranchId() == null) { + // Throw NPE again + throw new NullPointerException("addedBranchOffice.branchId is null"); //NOI18N + } else if (addedBranchOffice.getBranchId() < 1) { + // Throw NPE again + throw new NullPointerException(MessageFormat.format("addedBranchOffice.branchId={0} is not valid", addedBranchOffice.getBranchId())); //NOI18N + } + + // Set it + this.addedBranchOffice = addedBranchOffice; + } + + @Override + public BranchOffice getAddedBranchOffice () { + return this.addedBranchOffice; + } + +} diff --git a/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/BranchOfficeAddedEvent.java b/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/BranchOfficeAddedEvent.java deleted file mode 100644 index 56e6128..0000000 --- a/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/BranchOfficeAddedEvent.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 . - */ -package org.mxchange.jcontactsbusiness.events.branchoffice.added; - -import java.text.MessageFormat; -import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; - -/** - * An event being fired when a branch office has been added - *

- * @author Roland Häder - */ -public class BranchOfficeAddedEvent implements ObservableBranchOfficeAddedEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 572_367_561_659_109L; - - /** - * Branch office instance being added - */ - private final BranchOffice branchOffice; - - /** - * Constructor with branch office instance - *

- * @param branchOffice Branch office instance - * @throws NullPointerException If the parameter is null - */ - public BranchOfficeAddedEvent (final BranchOffice branchOffice) { - // Check parameter - if (null == branchOffice) { - // Throw NPE - throw new NullPointerException("branchOffice is null"); //NOI18N - } else if (branchOffice.getBranchId() == null) { - // Throw NPE again - throw new NullPointerException("branchOffice.branchId is null"); //NOI18N - } else if (branchOffice.getBranchId() < 1) { - // Throw NPE again - throw new NullPointerException(MessageFormat.format("branchOffice.branchId={0} is not valid", branchOffice.getBranchId())); //NOI18N - } - - // Set it - this.branchOffice = branchOffice; - } - - @Override - public BranchOffice getBranchOffice () { - return this.branchOffice; - } - -} diff --git a/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/ObservableAdminBranchOfficeAddedEvent.java b/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/ObservableAdminBranchOfficeAddedEvent.java new file mode 100644 index 0000000..8d85388 --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/ObservableAdminBranchOfficeAddedEvent.java @@ -0,0 +1,37 @@ +/* + * 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 . + */ +package org.mxchange.jcontactsbusiness.events.branchoffice.added; + +import java.io.Serializable; +import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; + +/** + * An interface for events being fired when a branch office has been added by an + * administrator. + *

+ * @author Roland Häder + */ +public interface ObservableAdminBranchOfficeAddedEvent extends Serializable { + + /** + * Getter for added branch office instance + *

+ * @return Added branch office instance + */ + BranchOffice getAddedBranchOffice (); + +} diff --git a/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/ObservableBranchOfficeAddedEvent.java b/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/ObservableBranchOfficeAddedEvent.java deleted file mode 100644 index 6d7ae85..0000000 --- a/src/org/mxchange/jcontactsbusiness/events/branchoffice/added/ObservableBranchOfficeAddedEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 . - */ -package org.mxchange.jcontactsbusiness.events.branchoffice.added; - -import java.io.Serializable; -import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; - -/** - * An interface for events being triggered when a branch office has been added. - *

- * @author Roland Häder - */ -public interface ObservableBranchOfficeAddedEvent extends Serializable { - - /** - * Getter for branch office instance - *

- * @return Branch office instance - */ - BranchOffice getBranchOffice (); - -} diff --git a/src/org/mxchange/jcontactsbusiness/events/branchoffice/updated/AdminBranchOfficeUpdatedEvent.java b/src/org/mxchange/jcontactsbusiness/events/branchoffice/updated/AdminBranchOfficeUpdatedEvent.java new file mode 100644 index 0000000..ffa308d --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/events/branchoffice/updated/AdminBranchOfficeUpdatedEvent.java @@ -0,0 +1,69 @@ +/* + * 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 . + */ +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. + *

+ * @author Roland Häder + */ +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 + *

+ * @param updatedBranchOffice Branch office instance + *

+ * @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; + } + +} diff --git a/src/org/mxchange/jcontactsbusiness/events/branchoffice/updated/ObservableAdminBranchOfficeUpdatedEvent.java b/src/org/mxchange/jcontactsbusiness/events/branchoffice/updated/ObservableAdminBranchOfficeUpdatedEvent.java new file mode 100644 index 0000000..70c37d1 --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/events/branchoffice/updated/ObservableAdminBranchOfficeUpdatedEvent.java @@ -0,0 +1,37 @@ +/* + * 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 . + */ +package org.mxchange.jcontactsbusiness.events.branchoffice.updated; + +import java.io.Serializable; +import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; + +/** + * An interface for events being fired when an administrator has updated a + * branch office. + *

+ * @author Roland Häder + */ +public interface ObservableAdminBranchOfficeUpdatedEvent extends Serializable { + + /** + * Getter for branch office instance + *

+ * @return Branch office instance + */ + BranchOffice getUpdatedBranchOffice (); + +} diff --git a/src/org/mxchange/jcontactsbusiness/events/department/added/DepartmentAddedEvent.java b/src/org/mxchange/jcontactsbusiness/events/department/added/DepartmentAddedEvent.java index 92987f1..97de10d 100644 --- a/src/org/mxchange/jcontactsbusiness/events/department/added/DepartmentAddedEvent.java +++ b/src/org/mxchange/jcontactsbusiness/events/department/added/DepartmentAddedEvent.java @@ -29,7 +29,7 @@ public class DepartmentAddedEvent implements ObservableDepartmentAddedEvent { /** * Serial number */ - private static final long serialVersionUID = 572_367_561_659_110L; + private static final long serialVersionUID = 572_367_561_659_111L; /** * Branch office instance being added @@ -40,6 +40,7 @@ public class DepartmentAddedEvent implements ObservableDepartmentAddedEvent { * Constructor with department instance *

* @param department Branch office instance + *

* @throws NullPointerException If the parameter is null */ public DepartmentAddedEvent (final Department department) { diff --git a/src/org/mxchange/jcontactsbusiness/events/department/added/ObservableDepartmentAddedEvent.java b/src/org/mxchange/jcontactsbusiness/events/department/added/ObservableDepartmentAddedEvent.java index 3181de1..bbdae8c 100644 --- a/src/org/mxchange/jcontactsbusiness/events/department/added/ObservableDepartmentAddedEvent.java +++ b/src/org/mxchange/jcontactsbusiness/events/department/added/ObservableDepartmentAddedEvent.java @@ -20,7 +20,7 @@ import java.io.Serializable; import org.mxchange.jcontactsbusiness.model.department.Department; /** - * An interface for events being triggered when a department has been added. + * An interface for events being fired when a department has been added. *

* @author Roland Häder */ diff --git a/src/org/mxchange/jcontactsbusiness/events/employee/added/ObservableEmployeeAddedEvent.java b/src/org/mxchange/jcontactsbusiness/events/employee/added/ObservableEmployeeAddedEvent.java index a5c6e9d..1b37a5a 100644 --- a/src/org/mxchange/jcontactsbusiness/events/employee/added/ObservableEmployeeAddedEvent.java +++ b/src/org/mxchange/jcontactsbusiness/events/employee/added/ObservableEmployeeAddedEvent.java @@ -20,7 +20,7 @@ import java.io.Serializable; import org.mxchange.jcontactsbusiness.model.employee.Employable; /** - * An interface for events being triggered when a employee has been added. + * An interface for events being fired when a employee has been added. *

* @author Roland Häder */ diff --git a/src/org/mxchange/jcontactsbusiness/events/headquarter/added/ObservableHeadquarterAddedEvent.java b/src/org/mxchange/jcontactsbusiness/events/headquarter/added/ObservableHeadquarterAddedEvent.java index 09a9556..1ac8561 100644 --- a/src/org/mxchange/jcontactsbusiness/events/headquarter/added/ObservableHeadquarterAddedEvent.java +++ b/src/org/mxchange/jcontactsbusiness/events/headquarter/added/ObservableHeadquarterAddedEvent.java @@ -20,7 +20,7 @@ import java.io.Serializable; import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter; /** - * An interface for events being triggered when a headquarter has been added. + * An interface for events being fired when a headquarter has been added. *

* @author Roland Häder */ diff --git a/src/org/mxchange/jcontactsbusiness/events/opening_time/added/ObservableOpeningTimeAddedEvent.java b/src/org/mxchange/jcontactsbusiness/events/opening_time/added/ObservableOpeningTimeAddedEvent.java index 037def4..3963de8 100644 --- a/src/org/mxchange/jcontactsbusiness/events/opening_time/added/ObservableOpeningTimeAddedEvent.java +++ b/src/org/mxchange/jcontactsbusiness/events/opening_time/added/ObservableOpeningTimeAddedEvent.java @@ -20,7 +20,7 @@ import java.io.Serializable; import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime; /** - * An interface for events being triggered when a opening time has been added. + * An interface for events being fired when a opening time has been added. *

* @author Roland Häder */ diff --git a/src/org/mxchange/jcontactsbusiness/events/opening_time/added/OpeningTimeAddedEvent.java b/src/org/mxchange/jcontactsbusiness/events/opening_time/added/OpeningTimeAddedEvent.java index 5266883..66f12d1 100644 --- a/src/org/mxchange/jcontactsbusiness/events/opening_time/added/OpeningTimeAddedEvent.java +++ b/src/org/mxchange/jcontactsbusiness/events/opening_time/added/OpeningTimeAddedEvent.java @@ -29,7 +29,7 @@ public class OpeningTimeAddedEvent implements ObservableOpeningTimeAddedEvent { /** * Serial number */ - private static final long serialVersionUID = 572_367_561_659_111L; + private static final long serialVersionUID = 572_367_561_659_113L; /** * Branch office instance being added @@ -40,6 +40,7 @@ public class OpeningTimeAddedEvent implements ObservableOpeningTimeAddedEvent { * Constructor with opening time instance *

* @param openingTime Branch office instance + *

* @throws NullPointerException If the parameter is null */ public OpeningTimeAddedEvent (final OpeningTime openingTime) {