]> git.mxchange.org Git - jcustomer-core.git/blobdiff - src/org/mxchange/jshopcore/model/item/BaseItem.java
Continued:
[jcustomer-core.git] / src / org / mxchange / jshopcore / model / item / BaseItem.java
index 213ac7fc9f41d3620c91348ca5f63fdc0869f68a..d2895c6533a071246e7db34c659f7af2f496f4b8 100644 (file)
@@ -18,7 +18,8 @@ package org.mxchange.jshopcore.model.item;
 
 import java.text.MessageFormat;
 import java.util.Objects;
-import org.mxchange.jcore.BaseFrameworkSystem;
+import org.mxchange.jcoreee.BaseEeSystem;
+import org.mxchange.jshopcore.model.basket.AddableBasketItem;
 import org.mxchange.jshopcore.model.product.Product;
 
 /**
@@ -27,7 +28,12 @@ import org.mxchange.jshopcore.model.product.Product;
  *
  * @author Roland Haeder
  */
-public abstract class BaseItem extends BaseFrameworkSystem implements AddableBasketItem {
+public abstract class BaseItem extends BaseEeSystem implements AddableBasketItem, Comparable<AddableBasketItem> {
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 24_348_671_457_829_156L;
+
        /**
         * Entry id (from database backend)
         */
@@ -53,23 +59,10 @@ public abstract class BaseItem extends BaseFrameworkSystem implements AddableBas
         */
        private Product product;
 
-       @Override
-       public Float calculateTotalPrice () {
-               // product should be set
-               if (this.getProduct() == null) {
-                       // Abort here
-                       throw new NullPointerException("product is null"); //NOI18N
-               }
-
-               // Calculate and return it
-               // TODO: If later other purchaseable items (other than products) are handled through this class, this needs expansion
-               return (this.getAmount() * this.getProduct().getPrice());
-       }
-
        @Override
        public int compareTo (final AddableBasketItem item) {
                // Trace message
-               this.getLogger().trace(MessageFormat.format("item={0} - CALLED!", item)); //NOI18N
+               this.getLogger().logTrace(MessageFormat.format("item={0} - CALLED!", item)); //NOI18N
                
                // item should not be null
                if (null == item) {
@@ -77,7 +70,7 @@ public abstract class BaseItem extends BaseFrameworkSystem implements AddableBas
                }
 
                // Debug message
-               this.getLogger().debug(MessageFormat.format("this.itemId={0},item.itemId={1}", this.getItemId(), item.getItemId())); //NOI18N
+               this.getLogger().logDebug(MessageFormat.format("this.itemId={0},item.itemId={1}", this.getItemId(), item.getItemId())); //NOI18N
 
                // Is the id the same?
                if (Objects.equals(this.getItemId(), item.getItemId())) {
@@ -132,17 +125,11 @@ public abstract class BaseItem extends BaseFrameworkSystem implements AddableBas
                this.itemType = itemType;
        }
 
-       /**
-        * @return the product
-        */
        @Override
        public Product getProduct () {
                return this.product;
        }
 
-       /**
-        * @param product the product to set
-        */
        @Override
        public void setProduct (final Product product) {
                this.product = product;