]> git.mxchange.org Git - jproduct-core.git/commitdiff
renamed even more fields/attributes
authorRoland Haeder <roland@mxchange.org>
Fri, 25 Sep 2015 08:41:48 +0000 (10:41 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 25 Sep 2015 08:41:48 +0000 (10:41 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jshopcore/model/basket/AddableBasketItem.java
src/org/mxchange/jshopcore/model/basket/items/BaseItem.java
src/org/mxchange/jshopcore/model/basket/items/BasketItem.java
src/org/mxchange/jshopcore/model/order/items/OrderItem.java

index 4257d1792e9be398a1d7905b35dc37c464ca10ac..023729def73382de7fc0063e262888e90994bf07 100644 (file)
@@ -39,14 +39,14 @@ public interface AddableBasketItem extends Serializable {
         *
         * @return the amount
         */
-       public Long getAmount ();
+       public Long getOrderedAmount ();
 
        /**
         * Setter for item amount
         *
         * @param amount the amount to set
         */
-       public void setAmount (final Long amount);
+       public void setOrderedAmount (final Long amount);
 
        /**
         * Getter for entry id (from database backend)
@@ -81,14 +81,14 @@ public interface AddableBasketItem extends Serializable {
         *
         * @return the product
         */
-       public Product getProduct ();
+       public Product getItemProduct ();
 
        /**
         * Setter fo product instance
         *
         * @param product the product to set
         */
-       public void setProduct (final Product product);
+       public void setItemProduct (final Product product);
 
        /**
         * Hash-code calculattion
index e2ac6208110d2cd239322b94d51621117db094c6..6c2309fb50dc4888c0d287245a4d380ed8587e19 100644 (file)
@@ -41,10 +41,10 @@ public abstract class BaseItem implements AddableBasketItem, Comparable<AddableB
                }
 
                // Is the id the same?
-               if (Objects.equals(this.getProduct(), item.getProduct())) {
+               if (Objects.equals(this.getItemProduct(), item.getItemProduct())) {
                        // Same id, means same item
                        return 0;
-               } else if (this.getProduct().getProductId() > item.getProduct().getProductId()) {
+               } else if (this.getItemProduct().getProductId() > item.getItemProduct().getProductId()) {
                        // This id is larger than compared to
                        return -1;
                }
@@ -68,14 +68,14 @@ public abstract class BaseItem implements AddableBasketItem, Comparable<AddableB
                AddableBasketItem item = (AddableBasketItem) object;
 
                // Item id and type must be the same
-               return ((Objects.equals(item.getProduct().getProductId(), this.getProduct().getProductId()))
+               return ((Objects.equals(item.getItemProduct().getProductId(), this.getItemProduct().getProductId()))
                                && (Objects.equals(item.getItemType(), this.getItemType())));
        }
 
        @Override
        public int hashCode () {
                int hash = 5;
-               hash = 29 * hash + Objects.hashCode(this.getProduct().getProductId());
+               hash = 29 * hash + Objects.hashCode(this.getItemProduct().getProductId());
                hash = 29 * hash + Objects.hashCode(this.getItemType());
                return hash;
        }
@@ -83,6 +83,6 @@ public abstract class BaseItem implements AddableBasketItem, Comparable<AddableB
        @Override
        public boolean isProductType () {
                // Is the instance set?
-               return (this.getProduct() instanceof Product);
+               return (this.getItemProduct() instanceof Product);
        }
 }
index d6cf05c775a6ff9ae3f18108370303aec7d7c685..5cb551de0ec75db93216ea247f923725eb3d897d 100644 (file)
@@ -44,11 +44,11 @@ public class BasketItem extends BaseItem implements AddableBasketItem {
        private static final long serialVersionUID = 52_749_158_492_581_578L;
 
        /**
-        * Item amount
+        * Item orderedAmount
         */
        @Basic (optional = false)
-       @Column (name = "amount", nullable = false, length = 20)
-       private Long amount;
+       @Column (name = "ordered_amount", nullable = false, length = 20)
+       private Long orderedAmount;
 
        /**
         * Entry itemId (from database backend)
@@ -70,7 +70,7 @@ public class BasketItem extends BaseItem implements AddableBasketItem {
         */
        @JoinColumn (name = "product_id", updatable = false)
        @OneToOne (targetEntity = GenericProduct.class)
-       private Product product;
+       private Product itemProduct;
 
        /**
         * Default constructor
@@ -87,7 +87,7 @@ public class BasketItem extends BaseItem implements AddableBasketItem {
                // Call default constructor
                this();
 
-               // product must not be null
+               // itemProduct must not be null
                if (null == product) {
                        // Abort here
                        throw new NullPointerException("product is null"); //NOI18N
@@ -97,37 +97,37 @@ public class BasketItem extends BaseItem implements AddableBasketItem {
                this.itemType = "product"; //NOI18N
 
                // Copy instance
-               this.product = product;
+               this.itemProduct = product;
        }
 
        /**
-        * Constructor for an item from given Product instance and amount.
+        * Constructor for an item from given Product instance and orderedAmount.
         *
         * @param product Product instance
-        * @param amount Ordered amount
+        * @param amount Ordered orderedAmount
         */
        public BasketItem (final Product product, final Long amount) {
                // Other constructor
                this(product);
 
-               // amount must not be null
+               // orderedAmount must not be null
                if (null == amount) {
                        // Abort here
                        throw new NullPointerException("amount is null"); //NOI18N
                }
 
-               // Set amount
-               this.amount = amount;
+               // Set orderedAmount
+               this.orderedAmount = amount;
        }
 
        @Override
-       public Long getAmount () {
-               return this.amount;
+       public Long getOrderedAmount () {
+               return this.orderedAmount;
        }
 
        @Override
-       public void setAmount (final Long amount) {
-               this.amount = amount;
+       public void setOrderedAmount (final Long orderedAmount) {
+               this.orderedAmount = orderedAmount;
        }
 
        @Override
@@ -151,12 +151,12 @@ public class BasketItem extends BaseItem implements AddableBasketItem {
        }
 
        @Override
-       public Product getProduct () {
-               return this.product;
+       public Product getItemProduct () {
+               return this.itemProduct;
        }
 
        @Override
-       public void setProduct (final Product product) {
-               this.product = product;
+       public void setItemProduct (final Product itemProduct) {
+               this.itemProduct = itemProduct;
        }
 }
index 5defb8f7ab0d3a7a595ef3841f983e783e3ec36e..9cca1183151edb8894883f7d4b8a0c805be3ff35 100644 (file)
@@ -80,12 +80,12 @@ public class OrderItem extends BaseItem implements AddableBasketItem {
        }
 
        @Override
-       public Long getAmount () {
+       public Long getOrderedAmount () {
                return this.amount;
        }
 
        @Override
-       public void setAmount (final Long amount) {
+       public void setOrderedAmount (final Long amount) {
                this.amount = amount;
        }
 
@@ -110,12 +110,12 @@ public class OrderItem extends BaseItem implements AddableBasketItem {
        }
 
        @Override
-       public Product getProduct () {
+       public Product getItemProduct () {
                return this.product;
        }
 
        @Override
-       public void setProduct (final Product product) {
+       public void setItemProduct (final Product product) {
                this.product = product;
        }
 }