+++ /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 Affero 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jproduct.events.category.added;
-
-import java.io.Serializable;
-import org.mxchange.jproduct.model.category.Category;
-
-/**
- * An interface for added category events
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AddedCategoryEvent extends Serializable {
-
- /**
- * Getter for added category instance
- * <p>
- * @return Added category instance
- */
- public Category getAddedCategory ();
-
-}
--- /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 Affero 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jproduct.events.category.added;
+
+import java.text.MessageFormat;
+import org.mxchange.jproduct.model.category.Category;
+
+/**
+ * An event fired when an administrator has added a new category.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class AdminAddedCategoryEvent implements ObservableAdminAddedCategoryEvent {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 83_275_471_765_091_760L;
+
+ /**
+ * Category instance that has been added
+ */
+ private final Category addedCategory;
+
+ /**
+ * Constructor with added category instance
+ * <p>
+ * @param addedCategory Added category
+ */
+ public AdminAddedCategoryEvent (final Category addedCategory) {
+ // The category should be valid
+ if (null == addedCategory) {
+ // Is NULL, throw NPE
+ throw new NullPointerException("addedCategory is null"); //NOI18N
+ } else if (addedCategory.getCategoryI18nKey() == null) {
+ // Is NULL, throw NPE again
+ throw new NullPointerException("addedCategory.categoryI18nKey is null"); //NOI18N
+ } else if (addedCategory.getCategoryI18nKey().isEmpty()) {
+ // Empty title
+ throw new IllegalArgumentException("addedCategory.categoryI18nKey is empty"); //NOI18N
+ } else if (addedCategory.getCategoryId() == null) {
+ // Id is NULL
+ throw new NullPointerException("addedCategory.categoryId is null"); //NOI18N
+ } else if (addedCategory.getCategoryId() <= 0) {
+ // Not valid id
+ throw new IllegalArgumentException(MessageFormat.format("addedCategory.categoryId={0} is not valid.", addedCategory.getCategoryId())); //NOI18N
+ }
+
+ // Set it here
+ this.addedCategory = addedCategory;
+ }
+
+ @Override
+ public Category getAddedCategory () {
+ return this.addedCategory;
+ }
+
+}
+++ /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 Affero 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jproduct.events.category.added;
-
-import java.text.MessageFormat;
-import org.mxchange.jproduct.model.category.Category;
-
-/**
- * An event fired when a new shop category has been added.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class CategoryAddedEvent implements AddedCategoryEvent {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 83_275_471_765_091_760L;
-
- /**
- * Category instance that has been added
- */
- private final Category addedCategory;
-
- /**
- * Constructor with added category instance
- * <p>
- * @param addedCategory Added category
- */
- public CategoryAddedEvent (final Category addedCategory) {
- // The category should be valid
- if (null == addedCategory) {
- // Is NULL, throw NPE
- throw new NullPointerException("addedCategory is null"); //NOI18N
- } else if (addedCategory.getCategoryI18nKey() == null) {
- // Is NULL, throw NPE again
- throw new NullPointerException("addedCategory.categoryI18nKey is null"); //NOI18N
- } else if (addedCategory.getCategoryI18nKey().isEmpty()) {
- // Empty title
- throw new IllegalArgumentException("addedCategory.categoryI18nKey is empty"); //NOI18N
- } else if (addedCategory.getCategoryId() == null) {
- // Id is NULL
- throw new NullPointerException("addedCategory.categoryId is null"); //NOI18N
- } else if (addedCategory.getCategoryId() <= 0) {
- // Not valid id
- throw new IllegalArgumentException(MessageFormat.format("addedCategory.categoryId={0} is not valid.", addedCategory.getCategoryId())); //NOI18N
- }
-
- // Set it here
- this.addedCategory = addedCategory;
- }
-
- @Override
- public Category getAddedCategory () {
- return this.addedCategory;
- }
-
-}
--- /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 Affero 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jproduct.events.category.added;
+
+import java.io.Serializable;
+import org.mxchange.jproduct.model.category.Category;
+
+/**
+ * An interface for events being fired when an administrator has added a
+ * category.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminAddedCategoryEvent extends Serializable {
+
+ /**
+ * Getter for added category instance
+ * <p>
+ * @return Added category instance
+ */
+ public Category getAddedCategory ();
+
+}
--- /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 Affero 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jproduct.events.category.updated;
+
+import java.text.MessageFormat;
+import org.mxchange.jproduct.model.category.Category;
+
+/**
+ * An event fired when an administrator has updated a new category.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class AdminUpdatedCategoryEvent implements ObservableAdminUpdatedCategoryEvent {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 83_275_471_765_091_761L;
+
+ /**
+ * Category instance that has been added
+ */
+ private final Category addedCategory;
+
+ /**
+ * Constructor with added category instance
+ * <p>
+ * @param addedCategory Added category
+ */
+ public AdminUpdatedCategoryEvent (final Category addedCategory) {
+ // The category should be valid
+ if (null == addedCategory) {
+ // Is NULL, throw NPE
+ throw new NullPointerException("addedCategory is null"); //NOI18N
+ } else if (addedCategory.getCategoryI18nKey() == null) {
+ // Is NULL, throw NPE again
+ throw new NullPointerException("addedCategory.categoryI18nKey is null"); //NOI18N
+ } else if (addedCategory.getCategoryI18nKey().isEmpty()) {
+ // Empty title
+ throw new IllegalArgumentException("addedCategory.categoryI18nKey is empty"); //NOI18N
+ } else if (addedCategory.getCategoryId() == null) {
+ // Id is NULL
+ throw new NullPointerException("addedCategory.categoryId is null"); //NOI18N
+ } else if (addedCategory.getCategoryId() <= 0) {
+ // Not valid id
+ throw new IllegalArgumentException(MessageFormat.format("addedCategory.categoryId={0} is not valid.", addedCategory.getCategoryId())); //NOI18N
+ }
+
+ // Set it here
+ this.addedCategory = addedCategory;
+ }
+
+ @Override
+ public Category getAddedCategory () {
+ return this.addedCategory;
+ }
+
+}
--- /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 Affero 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jproduct.events.category.updated;
+
+import java.io.Serializable;
+import org.mxchange.jproduct.model.category.Category;
+
+/**
+ * An interface for events when an administrator has updated a category.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminUpdatedCategoryEvent extends Serializable {
+
+ /**
+ * Getter for added category instance
+ * <p>
+ * @return Added category instance
+ */
+ public Category getAddedCategory ();
+
+}