/**
* Category instance that has been added
*/
- private final Category addedCategory;
+ private final Category updatedCategory;
/**
* Constructor with added category instance
* <p>
- * @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;
}
}