From cc7085c9d22bcaa3406fb81951c44ba0d7373885 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 25 Apr 2020 20:31:25 +0200 Subject: [PATCH] Continued: - ops, needs to be updatedCategory to have it visible in other Java code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../updated/AdminUpdatedCategoryEvent.java | 32 +++++++++---------- .../ObservableAdminUpdatedCategoryEvent.java | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) 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 (); } -- 2.39.5