*/
private List<Category> categories;
- @Override
- public void addCategory (final Category category) {
- // Add the category
- this.categories.add(category);
- }
-
@Override
public void afterShopCategoryAdded (@Observes final AddedCategoryEvent event) {
// Is all valid?
throw new IllegalArgumentException(MessageFormat.format("event.addedCategory.categoryId={0} is not valid.", event.getAddedCategory().getCategoryId())); //NOI18N
}
- // Add it here, too.
- this.addCategory(event.getAddedCategory());
+ // Add the category
+ this.categories.add(event.getAddedCategory());
}
@Override
*/
public interface PizzaCategoryWebApplicationController extends Serializable {
- /**
- * Adds given category to the "cached" instance
- * <p>
- * @param category Category instance
- */
- void addCategory (final Category category);
-
/**
* Some "getter" for a linked list of all categories
* <p>
*/
private List<Product> availableProducts;
- @Override
- public void addProduct (final Product product) {
- // Is the product available?
- if (product.getProductAvailability()) {
- // Add it
- this.availableProducts.add(product);
- }
- }
-
@Override
public void afterShopProductAdded (@Observes final AddedProductEvent event) {
// Is all valid?
throw new IllegalArgumentException(MessageFormat.format("event.addedProduct.productId={0} is not valid.", event.getAddedProduct().getProductId())); //NOI18N
}
- // Add it here, too.
- this.addProduct(event.getAddedProduct());
+ // Is the product available?
+ if (event.getAddedProduct().getProductAvailability()) {
+ // Add it
+ this.availableProducts.add(event.getAddedProduct());
+ }
}
@Override
*/
public interface PizzaProductWebApplicationController extends Serializable {
- /**
- * Adds given product to the "cached" instance
- * <p>
- * @param product Product instance
- */
- void addProduct (final Product product);
-
/**
* Some "getter" for a linked list of only available products
* <p>