From: Roland Häder Date: Sat, 28 Oct 2017 16:24:29 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2fa3d149dc72d3702f246f2b631ec950cad7f675;p=jproduct-core.git Continued: - added unit amount and type, for example "Milk" is product title and amount is 1 and type is "l" for liter Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jproduct/model/product/GenericProduct.java b/src/org/mxchange/jproduct/model/product/GenericProduct.java index bac7e4c..f98e247 100644 --- a/src/org/mxchange/jproduct/model/product/GenericProduct.java +++ b/src/org/mxchange/jproduct/model/product/GenericProduct.java @@ -81,6 +81,11 @@ public class GenericProduct implements Product { @Temporal (TemporalType.TIMESTAMP) private Date productCreated; + /** + * Currency code for both prices + */ + private String productCurrencyCode; + /** * Gross price of product */ @@ -116,9 +121,16 @@ public class GenericProduct implements Product { private String productTitle; /** - * Currency code for both prices + * Amount of this product (for example 1 for 1 liter) */ - private String productCurrencyCode; + @Column (name = "product_unit_amount") + private Float productUnitAmount; + + /** + * Unit type (for example liter) + */ + @Column (name = "product_unit_type") + private String productUnitType; /** * Default constructor @@ -257,6 +269,26 @@ public class GenericProduct implements Product { this.productTitle = productTitle; } + @Override + public Float getProductUnitAmount () { + return this.productUnitAmount; + } + + @Override + public void setProductUnitAmount (final Float productUnitAmount) { + this.productUnitAmount = productUnitAmount; + } + + @Override + public String getProductUnitType () { + return this.productUnitType; + } + + @Override + public void setProductUnitType (final String productUnitType) { + this.productUnitType = productUnitType; + } + @Override public int hashCode () { int hash = 7; diff --git a/src/org/mxchange/jproduct/model/product/Product.java b/src/org/mxchange/jproduct/model/product/Product.java index 083cb6a..4c54466 100644 --- a/src/org/mxchange/jproduct/model/product/Product.java +++ b/src/org/mxchange/jproduct/model/product/Product.java @@ -153,6 +153,34 @@ public interface Product extends Serializable { */ void setProductTitle (final String productTitle); + /** + * Getter for product's unit amount + *

+ * @return Product's unit amount + */ + Float getProductUnitAmount (); + + /** + * Setter for product's unit amount + *

+ * @param productUnitAmount Product's unit amount + */ + void setProductUnitAmount (final Float productUnitAmount); + + /** + * Getter for product's unit type + *

+ * @return Product's unit type + */ + String getProductUnitType (); + + /** + * Setter for product's unit type + *

+ * @param productUnitType Product's unit type + */ + void setProductUnitType (final String productUnitType); + @Override boolean equals (final Object object);