From: Roland Häder Date: Sat, 25 Apr 2020 18:31:25 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cc7085c9d22bcaa3406fb81951c44ba0d7373885;p=jproduct-core.git Continued: - ops, needs to be updatedCategory to have it visible in other Java code Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jproduct/events/category/updated/AdminUpdatedCategoryEvent.java b/src/org/mxchange/jproduct/events/category/updated/AdminUpdatedCategoryEvent.java index f497b7e..75f8add 100644 --- a/src/org/mxchange/jproduct/events/category/updated/AdminUpdatedCategoryEvent.java +++ b/src/org/mxchange/jproduct/events/category/updated/AdminUpdatedCategoryEvent.java @@ -34,39 +34,39 @@ public class AdminUpdatedCategoryEvent implements ObservableAdminUpdatedCategory /** * Category instance that has been added */ - private final Category addedCategory; + private final Category updatedCategory; /** * Constructor with added category instance *

- * @param addedCategory Added category + * @param updatedCategory Added category */ - public AdminUpdatedCategoryEvent (final Category addedCategory) { + public AdminUpdatedCategoryEvent (final Category updatedCategory) { // The category should be valid - if (null == addedCategory) { + if (null == updatedCategory) { // Is NULL, throw NPE - throw new NullPointerException("addedCategory is null"); //NOI18N - } else if (addedCategory.getCategoryI18nKey() == null) { + throw new NullPointerException("updatedCategory is null"); //NOI18N + } else if (updatedCategory.getCategoryI18nKey() == null) { // Is NULL, throw NPE again - throw new NullPointerException("addedCategory.categoryI18nKey is null"); //NOI18N - } else if (addedCategory.getCategoryI18nKey().isEmpty()) { + throw new NullPointerException("updatedCategory.categoryI18nKey is null"); //NOI18N + } else if (updatedCategory.getCategoryI18nKey().isEmpty()) { // Empty title - throw new IllegalArgumentException("addedCategory.categoryI18nKey is empty"); //NOI18N - } else if (addedCategory.getCategoryId() == null) { + throw new IllegalArgumentException("updatedCategory.categoryI18nKey is empty"); //NOI18N + } else if (updatedCategory.getCategoryId() == null) { // Id is NULL - throw new NullPointerException("addedCategory.categoryId is null"); //NOI18N - } else if (addedCategory.getCategoryId() <= 0) { + throw new NullPointerException("updatedCategory.categoryId is null"); //NOI18N + } else if (updatedCategory.getCategoryId() <= 0) { // Not valid id - throw new IllegalArgumentException(MessageFormat.format("addedCategory.categoryId={0} is not valid.", addedCategory.getCategoryId())); //NOI18N + throw new IllegalArgumentException(MessageFormat.format("updatedCategory.categoryId={0} is not valid.", updatedCategory.getCategoryId())); //NOI18N } // Set it here - this.addedCategory = addedCategory; + this.updatedCategory = updatedCategory; } @Override - public Category getAddedCategory () { - return this.addedCategory; + public Category getUpdatedCategory () { + return this.updatedCategory; } } diff --git a/src/org/mxchange/jproduct/events/category/updated/ObservableAdminUpdatedCategoryEvent.java b/src/org/mxchange/jproduct/events/category/updated/ObservableAdminUpdatedCategoryEvent.java index ae4a79b..69e480b 100644 --- a/src/org/mxchange/jproduct/events/category/updated/ObservableAdminUpdatedCategoryEvent.java +++ b/src/org/mxchange/jproduct/events/category/updated/ObservableAdminUpdatedCategoryEvent.java @@ -31,6 +31,6 @@ public interface ObservableAdminUpdatedCategoryEvent extends Serializable { *

* @return Added category instance */ - public Category getAddedCategory (); + public Category getUpdatedCategory (); }