]> git.mxchange.org Git - pizzaservice-war.git/blobdiff - src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebController.java
Finally added calculateItemPrice() ...
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / basket / BasketWebController.java
index 72bf7db8a05e5bade570eb03906a160a1470eacc..d071350686884d554a2963f252969c6a46e81d6a 100644 (file)
@@ -26,6 +26,7 @@ import org.mxchange.jshopcore.model.product.Product;
  * @author Roland Haeder<roland@mxchange.org>
  */
 public interface BasketWebController extends Serializable {
+
        /**
         * Checks whether the basket is empty
         *
@@ -34,7 +35,8 @@ public interface BasketWebController extends Serializable {
        public boolean isEmpty ();
 
        /**
-        * Checks whether the basket has items in it. This method is wrapper to isEmpty()
+        * Checks whether the basket has items in it. This method is wrapper to
+        * isEmpty()
         *
         * @return Whether the basket is empty
         */
@@ -49,7 +51,8 @@ public interface BasketWebController extends Serializable {
        public boolean isProductAdded (final Product product);
 
        /**
-        * Adds given product instance to basket by adding amount from form data to it.
+        * Adds given product instance to basket by adding amount from form data to
+        * it.
         *
         * @param product Product instance to add
         * @return Redirect target or null
@@ -83,4 +86,12 @@ public interface BasketWebController extends Serializable {
         * @param currentItem Current item
         */
        public void setCurrentItem (final AddableBasketItem currentItem);
+
+       /**
+        * Calculates total price (no tax added) of current item. If no current item
+        * is set and no amount, a NPE is thrown.
+        *
+        * @return Current item's total price
+        */
+       public Float calculateItemPrice ();
 }