]> git.mxchange.org Git - jproduct-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 24 Nov 2018 15:02:46 +0000 (16:02 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 24 Nov 2018 15:02:46 +0000 (16:02 +0100)
- moved "added category" event class/interface to deeper package
- removed discouraged "created product" event

src/org/mxchange/jproduct/events/category/AddedCategoryEvent.java [deleted file]
src/org/mxchange/jproduct/events/category/CategoryAddedEvent.java [deleted file]
src/org/mxchange/jproduct/events/category/added/AddedCategoryEvent.java [new file with mode: 0644]
src/org/mxchange/jproduct/events/category/added/CategoryAddedEvent.java [new file with mode: 0644]
src/org/mxchange/jproduct/events/product/created/CreatedProductEvent.java [deleted file]
src/org/mxchange/jproduct/events/product/created/ObservableCreatedProductEvent.java [deleted file]

diff --git a/src/org/mxchange/jproduct/events/category/AddedCategoryEvent.java b/src/org/mxchange/jproduct/events/category/AddedCategoryEvent.java
deleted file mode 100644 (file)
index bedd155..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 - 2018 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;
-
-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 ();
-
-}
diff --git a/src/org/mxchange/jproduct/events/category/CategoryAddedEvent.java b/src/org/mxchange/jproduct/events/category/CategoryAddedEvent.java
deleted file mode 100644 (file)
index 601f6aa..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2016 - 2018 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;
-
-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;
-       }
-
-}
diff --git a/src/org/mxchange/jproduct/events/category/added/AddedCategoryEvent.java b/src/org/mxchange/jproduct/events/category/added/AddedCategoryEvent.java
new file mode 100644 (file)
index 0000000..663e0ae
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 - 2018 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 ();
+
+}
diff --git a/src/org/mxchange/jproduct/events/category/added/CategoryAddedEvent.java b/src/org/mxchange/jproduct/events/category/added/CategoryAddedEvent.java
new file mode 100644 (file)
index 0000000..2b8dbf8
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2016 - 2018 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;
+       }
+
+}
diff --git a/src/org/mxchange/jproduct/events/product/created/CreatedProductEvent.java b/src/org/mxchange/jproduct/events/product/created/CreatedProductEvent.java
deleted file mode 100644 (file)
index 34de314..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2017, 2018 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.jproduct.events.product.created;
-
-import org.mxchange.jproduct.model.product.Product;
-
-/**
- * An interface for observable events being fired when a product instance has
- * been successfully created. This may happen when a product profile was called.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class CreatedProductEvent implements ObservableCreatedProductEvent {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 24_138_056_876_716_551L;
-
-       /**
-        * Product instance being created
-        */
-       private final Product createdProduct;
-
-       /**
-        * Constructor with product instance
-        * <p>
-        * @param createdProduct Product instance being created by helper
-        */
-       public CreatedProductEvent (final Product createdProduct) {
-               // Set product instance
-               this.createdProduct = createdProduct;
-       }
-
-       @Override
-       public Product getCreatedProduct () {
-               return this.createdProduct;
-       }
-
-}
diff --git a/src/org/mxchange/jproduct/events/product/created/ObservableCreatedProductEvent.java b/src/org/mxchange/jproduct/events/product/created/ObservableCreatedProductEvent.java
deleted file mode 100644 (file)
index 69ee9ab..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2017, 2018 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.jproduct.events.product.created;
-
-import java.io.Serializable;
-import org.mxchange.jproduct.model.product.Product;
-
-/**
- * An interface for observable events being fired when a product instance has
- * been successfully created. This may happen when a product profile was called.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface ObservableCreatedProductEvent extends Serializable {
-
-       /**
-        * Getter for created product instance
-        * <p>
-        * @return Created product instance
-        */
-       Product getCreatedProduct ();
-
-}