From: Roland Haeder Date: Tue, 8 Sep 2015 20:44:54 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ea2ac9942269d6155aaf6dc62213791c1bb15984;p=jshop-core.git Continued: - had to put all classes and interfaces in one package jar-wide ... :-( - updated jcore.jar, jcoreee.jar Signed-off-by:Roland Häder --- diff --git a/lib/jcore-ee-logger.jar b/lib/jcore-ee-logger.jar index b7c4751..4869b92 100644 Binary files a/lib/jcore-ee-logger.jar and b/lib/jcore-ee-logger.jar differ diff --git a/lib/jcore.jar b/lib/jcore.jar index 7318d47..217c364 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index f479cd8..9f0039f 100644 Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index e841dc3..d6048cc 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -921,6 +921,14 @@ is divided into following sections: + + + + + + + + @@ -1406,6 +1414,14 @@ is divided into following sections: + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index a684ce4..104b3f2 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=622c8e1d +build.xml.data.CRC32=bbffe842 build.xml.script.CRC32=fa35cacf build.xml.stylesheet.CRC32=8064a381@1.75.2.48 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=622c8e1d -nbproject/build-impl.xml.script.CRC32=40bf9247 +nbproject/build-impl.xml.data.CRC32=bbffe842 +nbproject/build-impl.xml.script.CRC32=a945b1d8 nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 diff --git a/nbproject/project.properties b/nbproject/project.properties index 8b450d2..d77d1a4 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -30,16 +30,15 @@ dist.jar=${dist.dir}/jshop-core.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= -file.reference.jcore-ee-logger.jar=lib\\jcore-ee-logger.jar file.reference.jcore.jar=lib/jcore.jar -file.reference.jcoreee.jar=lib\\jcoreee.jar +file.reference.jcoreee.jar=lib/jcoreee.jar includes=** jar.archive.disabled=${jnlp.enabled} jar.compress=false jar.index=${jnlp.enabled} javac.classpath=\ ${file.reference.jcore.jar}:\ - ${file.reference.jcore-ee-logger.jar}:\ + ${reference.jcore-ee-logger.jar}:\ ${file.reference.jcoreee.jar} # Space-separated list of extra javac options javac.compilerargs=-Xlint:unchecked -Xlint:deprecation @@ -80,7 +79,9 @@ manifest.custom.permissions= meta.inf.dir=${src.dir}/META-INF mkdist.disabled=true platform.active=default_platform +project.jcore-ee-logger=../jcore-ee-logger project.license=gpl30 +reference.jcore-ee-logger.jar=${project.jcore-ee-logger}/dist/jcore-ee-logger.jar run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} @@ -92,7 +93,6 @@ run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 -source.reference.jcore-ee-logger.jar=../jcore-ee-logger/src/ source.reference.jcore.jar=../jcore/src/ source.reference.jcoreee.jar=../jcoreee/src/ src.dir=src diff --git a/nbproject/project.xml b/nbproject/project.xml index 815ee3d..90befe4 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -14,5 +14,15 @@ ./lib/nblibraries.properties + + + jcore-ee-logger + jar + + jar + clean + jar + + diff --git a/src/org/mxchange/jshopcore/model/basket/AddableBasketItem.java b/src/org/mxchange/jshopcore/model/basket/AddableBasketItem.java new file mode 100644 index 0000000..db0855a --- /dev/null +++ b/src/org/mxchange/jshopcore/model/basket/AddableBasketItem.java @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jshopcore.model.basket; + +import java.io.Serializable; +import org.mxchange.jshopcore.model.product.Product; + +/** + * An interface for addable basket items + * + * @author Roland Haeder + */ +public interface AddableBasketItem extends Serializable { + + /** + * Item amount + * + * @return the amount + */ + public Long getAmount (); + + /** + * Item amount + * + * @param amount the amount to set + */ + public void setAmount (final Long amount); + + /** + * Entry id (from database backend) + * + * @return the id + */ + public Long getId (); + + /** + * Entry id (from database backend) + * + * @param id the id to set + */ + public void setId (final Long id); + + /** + * @return the id + */ + public Long getItemId (); + + /** + * @param id the id to set + */ + public void setItemId (final Long id); + + /** + * @return the type + */ + public String getItemType (); + + /** + * @param type the type to set + */ + public void setItemType (final String type); + + /** + * @return the product + */ + public Product getProduct (); + + /** + * Product instance + * + * @param product the product to set + */ + public void setProduct (final Product product); +} diff --git a/src/org/mxchange/jshopcore/model/basket/BaseBasket.java b/src/org/mxchange/jshopcore/model/basket/BaseBasket.java index 9e47ad5..cc4d280 100644 --- a/src/org/mxchange/jshopcore/model/basket/BaseBasket.java +++ b/src/org/mxchange/jshopcore/model/basket/BaseBasket.java @@ -21,8 +21,7 @@ import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.text.MessageFormat; import java.util.Map; -import org.mxchange.jcoree.BaseEeSystem; -import org.mxchange.jshopcore.model.item.AddableBasketItem; +import org.mxchange.jcoreee.BaseEeSystem; /** * A general basket class diff --git a/src/org/mxchange/jshopcore/model/basket/Basket.java b/src/org/mxchange/jshopcore/model/basket/Basket.java index 679200a..24502ec 100644 --- a/src/org/mxchange/jshopcore/model/basket/Basket.java +++ b/src/org/mxchange/jshopcore/model/basket/Basket.java @@ -21,7 +21,6 @@ import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.util.Map; -import org.mxchange.jshopcore.model.item.AddableBasketItem; /** * An interface for baskets diff --git a/src/org/mxchange/jshopcore/model/basket/ShopBasket.java b/src/org/mxchange/jshopcore/model/basket/ShopBasket.java new file mode 100644 index 0000000..7cd016c --- /dev/null +++ b/src/org/mxchange/jshopcore/model/basket/ShopBasket.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jshopcore.model.basket; + +import java.sql.SQLException; +import org.mxchange.jshopcore.model.basket.BaseBasket; +import org.mxchange.jshopcore.model.basket.Basket; +import org.mxchange.jshopcore.model.basket.AddableBasketItem; + +/** + * A basket for orderable items + * + * @author Roland Haeder + */ +public class ShopBasket extends BaseBasket implements Basket { + /** + * Serial number + */ + private static final long serialVersionUID = 4_384_123_923_163_957L; + + /** + * Default constructor to be able to throw exceptions from super constructor + * @throws java.sql.SQLException If an SQL error occurs + */ + public ShopBasket () throws SQLException { + // Call super constructor + super(); + } +} diff --git a/src/org/mxchange/jshopcore/model/basket/item/ItemBasket.java b/src/org/mxchange/jshopcore/model/basket/item/ItemBasket.java deleted file mode 100644 index 9cd3c53..0000000 --- a/src/org/mxchange/jshopcore/model/basket/item/ItemBasket.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jshopcore.model.basket.item; - -import java.sql.SQLException; -import org.mxchange.jshopcore.model.basket.BaseBasket; -import org.mxchange.jshopcore.model.basket.Basket; -import org.mxchange.jshopcore.model.item.AddableBasketItem; - -/** - * A basket for orderable items - * - * @author Roland Haeder - */ -public class ItemBasket extends BaseBasket implements Basket { - /** - * Serial number - */ - private static final long serialVersionUID = 4_384_123_923_163_957L; - - /** - * Default constructor to be able to throw exceptions from super constructor - * @throws java.sql.SQLException If an SQL error occurs - */ - public ItemBasket () throws SQLException { - // Call super constructor - super(); - } -} diff --git a/src/org/mxchange/jshopcore/model/category/BaseCategory.java b/src/org/mxchange/jshopcore/model/category/BaseCategory.java index e8fe1d9..ecc6a82 100644 --- a/src/org/mxchange/jshopcore/model/category/BaseCategory.java +++ b/src/org/mxchange/jshopcore/model/category/BaseCategory.java @@ -16,10 +16,9 @@ */ package org.mxchange.jshopcore.model.category; -import java.io.UnsupportedEncodingException; import java.text.MessageFormat; import java.util.Objects; -import org.mxchange.jcoree.BaseEeSystem; +import org.mxchange.jcoreee.BaseEeSystem; /** * A general product category class @@ -99,20 +98,6 @@ public abstract class BaseCategory extends BaseEeSystem implements Category { return 1; } - /** - * Decodes the UTF8-encoded title - * - * @return Decoded title - */ - @Override - public String getDecodedTitle () throws UnsupportedEncodingException { - // Get title - byte[] t = this.getTitle().getBytes(); - - // Decode it - return new String(t, "UTF-8"); //NOI18N - } - /** * Id number of category * diff --git a/src/org/mxchange/jshopcore/model/category/Category.java b/src/org/mxchange/jshopcore/model/category/Category.java index fd775cc..1fb60e8 100644 --- a/src/org/mxchange/jshopcore/model/category/Category.java +++ b/src/org/mxchange/jshopcore/model/category/Category.java @@ -17,7 +17,6 @@ package org.mxchange.jshopcore.model.category; import java.io.Serializable; -import java.io.UnsupportedEncodingException; /** * An interface for categories @@ -69,12 +68,4 @@ public interface Category extends Comparable, Serializable { */ @Override public int compareTo (final Category category); - - /** - * Decodes the UTF8-encoded title - * - * @return Decoded title - * @throws java.io.UnsupportedEncodingException If the encoding UTF-8 is not supported - */ - public String getDecodedTitle () throws UnsupportedEncodingException ; } diff --git a/src/org/mxchange/jshopcore/model/category/ProductCategory.java b/src/org/mxchange/jshopcore/model/category/ProductCategory.java new file mode 100644 index 0000000..cfd56f8 --- /dev/null +++ b/src/org/mxchange/jshopcore/model/category/ProductCategory.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jshopcore.model.category; + +import org.mxchange.jshopcore.model.category.BaseCategory; +import org.mxchange.jshopcore.model.category.BaseCategory; + +/** + * A product category + * @author Roland Haeder + */ +public class ProductCategory extends BaseCategory { + /** + * Serial number + */ + private static final long serialVersionUID = 21_458_945_712_659L; + + /** + * Constructor which accepts all database fields + * @param id Id number of database record + * @param title Category title + * @param parent Parent id + */ + public ProductCategory (final Long id, final String title, final Long parent) { + // Call parent constructor + super(id, title, parent); + } + + /** + * Default constructor + */ + public ProductCategory () { + } +} diff --git a/src/org/mxchange/jshopcore/model/category/product/ProductCategory.java b/src/org/mxchange/jshopcore/model/category/product/ProductCategory.java deleted file mode 100644 index ad6ef83..0000000 --- a/src/org/mxchange/jshopcore/model/category/product/ProductCategory.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jshopcore.model.category.product; - -import org.mxchange.jshopcore.model.category.BaseCategory; - -/** - * A product category - * @author Roland Haeder - */ -public class ProductCategory extends BaseCategory { - /** - * Serial number - */ - private static final long serialVersionUID = 21_458_945_712_659L; - - /** - * Constructor which accepts all database fields - * @param id Id number of database record - * @param title Category title - * @param parent Parent id - */ - public ProductCategory (final Long id, final String title, final Long parent) { - // Call parent constructor - super(id, title, parent); - } - - /** - * Default constructor - */ - public ProductCategory () { - } -} diff --git a/src/org/mxchange/jshopcore/model/item/AddableBasketItem.java b/src/org/mxchange/jshopcore/model/item/AddableBasketItem.java deleted file mode 100644 index 00ea850..0000000 --- a/src/org/mxchange/jshopcore/model/item/AddableBasketItem.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jshopcore.model.item; - -import java.io.Serializable; -import org.mxchange.jshopcore.model.product.Product; - -/** - * An interface for addable basket items - * - * @author Roland Haeder - */ -public interface AddableBasketItem extends Serializable { - - /** - * Item amount - * @return the amount - */ - public Long getAmount (); - - /** - * Item amount - * @param amount the amount to set - */ - public void setAmount (final Long amount); - - /** - * Entry id (from database backend) - * @return the id - */ - public Long getId (); - - /** - * Entry id (from database backend) - * @param id the id to set - */ - public void setId (final Long id); - - /** - * @return the id - */ - public Long getItemId (); - - /** - * @param id the id to set - */ - public void setItemId (final Long id); - - /** - * @return the type - */ - public String getItemType (); - - /** - * @param type the type to set - */ - public void setItemType (final String type); - - /** - * Calculates total price by multipying amount and single price - * - * @return Total price of this item - */ - public Float calculateTotalPrice (); - - /** - * @return the product - */ - public Product getProduct (); - - /** - * @param product the product to set - */ - public void setProduct (final Product product); -} diff --git a/src/org/mxchange/jshopcore/model/item/BaseItem.java b/src/org/mxchange/jshopcore/model/item/BaseItem.java index 0353d33..d2895c6 100644 --- a/src/org/mxchange/jshopcore/model/item/BaseItem.java +++ b/src/org/mxchange/jshopcore/model/item/BaseItem.java @@ -18,7 +18,8 @@ package org.mxchange.jshopcore.model.item; import java.text.MessageFormat; import java.util.Objects; -import org.mxchange.jcoree.BaseEeSystem; +import org.mxchange.jcoreee.BaseEeSystem; +import org.mxchange.jshopcore.model.basket.AddableBasketItem; import org.mxchange.jshopcore.model.product.Product; /** @@ -58,19 +59,6 @@ public abstract class BaseItem extends BaseEeSystem implements AddableBasketItem */ 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 diff --git a/src/org/mxchange/jshopcore/model/item/BasketItem.java b/src/org/mxchange/jshopcore/model/item/BasketItem.java new file mode 100644 index 0000000..334179e --- /dev/null +++ b/src/org/mxchange/jshopcore/model/item/BasketItem.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jshopcore.model.item; + +import java.text.MessageFormat; +import org.mxchange.jshopcore.model.basket.AddableBasketItem; +import org.mxchange.jshopcore.model.product.Product; + +/** + * A general basket item + * + * @author Roland Haeder + */ +public class BasketItem extends BaseItem implements AddableBasketItem { + /** + * Serial number + */ + private static final long serialVersionUID = 52_749_158_492_581_578L; + + /** + * Default constructor + */ + public BasketItem () { + } + + /** + * Constructor for an item from given Product instance + * + * @param product Product instance + */ + public BasketItem (final Product product) { + // Call default constructor + this(); + + // Trace message + this.getLogger().logDebug(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N + + // product must not be null + if (null == product) { + // Abort here + throw new NullPointerException("product is null"); //NOI18N + } + + // Copy all neccessary values + this.setItemId(product.getItemId()); + this.setItemType("Product"); //NOI18N + } +} diff --git a/src/org/mxchange/jshopcore/model/item/basket/BasketItem.java b/src/org/mxchange/jshopcore/model/item/basket/BasketItem.java deleted file mode 100644 index 217b3ac..0000000 --- a/src/org/mxchange/jshopcore/model/item/basket/BasketItem.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jshopcore.model.item.basket; - -import java.text.MessageFormat; -import org.mxchange.jshopcore.model.item.AddableBasketItem; -import org.mxchange.jshopcore.model.item.BaseItem; -import org.mxchange.jshopcore.model.product.Product; - -/** - * A general basket item - * - * @author Roland Haeder - */ -public class BasketItem extends BaseItem implements AddableBasketItem { - /** - * Serial number - */ - private static final long serialVersionUID = 52_749_158_492_581_578L; - - /** - * Default constructor - */ - public BasketItem () { - } - - /** - * Constructor for an item from given Product instance - * - * @param product Product instance - */ - public BasketItem (final Product product) { - // Call default constructor - this(); - - // Trace message - this.getLogger().logDebug(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N - - // product must not be null - if (null == product) { - // Abort here - throw new NullPointerException("product is null"); //NOI18N - } - - // Copy all neccessary values - this.setItemId(product.getItemId()); - this.setItemType("Product"); //NOI18N - } -} diff --git a/src/org/mxchange/jshopcore/model/product/BaseProduct.java b/src/org/mxchange/jshopcore/model/product/BaseProduct.java index b1704d6..e655ed5 100644 --- a/src/org/mxchange/jshopcore/model/product/BaseProduct.java +++ b/src/org/mxchange/jshopcore/model/product/BaseProduct.java @@ -7,7 +7,7 @@ package org.mxchange.jshopcore.model.product; import java.text.MessageFormat; import java.util.Objects; -import org.mxchange.jcoree.BaseEeSystem; +import org.mxchange.jcoreee.BaseEeSystem; /** * A general product class diff --git a/src/org/mxchange/jshopcore/model/product/GenericProduct.java b/src/org/mxchange/jshopcore/model/product/GenericProduct.java new file mode 100644 index 0000000..15a40f7 --- /dev/null +++ b/src/org/mxchange/jshopcore/model/product/GenericProduct.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jshopcore.model.product; + +import java.text.MessageFormat; +import org.mxchange.jshopcore.model.product.BaseProduct; +import org.mxchange.jshopcore.model.product.BaseProduct; +import org.mxchange.jshopcore.model.product.Product; +import org.mxchange.jshopcore.model.product.Product; + +/** + * Generic product class + * + * @author Roland Haeder + * TODO: Find a better name + */ +public class GenericProduct extends BaseProduct implements Product { + /** + * Serial number + */ + private static final long serialVersionUID = 54_578_571_769_283L; + + /** + * Default constructor + */ + public GenericProduct () { + } + + /** + * Constructor will all required data + * + * @param id Id number of product + * @param title Name of product + * @param price Price + * @param categoryId Category id + * @param available Availability (selectable by customer) + */ + public GenericProduct (final Long id, final String title, final Float price, final Long categoryId, final Boolean available) { + // Trace message + this.getLogger().logTrace(MessageFormat.format("id={0},title={1},price={2},categoryId={3},available={4} - CALLED!", id, title, price, categoryId, available)); //NOI18N + + // Set all here + this.setItemId(id); + this.setTitle(title); + this.setPrice(price); + this.setCategoryId(categoryId); + this.setAvailable(available); + } +} diff --git a/src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java b/src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java deleted file mode 100644 index 58619f3..0000000 --- a/src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jshopcore.model.product.generic; - -import java.text.MessageFormat; -import org.mxchange.jshopcore.model.product.BaseProduct; -import org.mxchange.jshopcore.model.product.Product; - -/** - * Generic product class - * - * @author Roland Haeder - * TODO: Find a better name - */ -public class GenericProduct extends BaseProduct implements Product { - /** - * Serial number - */ - private static final long serialVersionUID = 54_578_571_769_283L; - - /** - * Default constructor - */ - public GenericProduct () { - } - - /** - * Constructor will all required data - * - * @param id Id number of product - * @param title Name of product - * @param price Price - * @param categoryId Category id - * @param available Availability (selectable by customer) - */ - public GenericProduct (final Long id, final String title, final Float price, final Long categoryId, final Boolean available) { - // Trace message - this.getLogger().logTrace(MessageFormat.format("id={0},title={1},price={2},categoryId={3},available={4} - CALLED!", id, title, price, categoryId, available)); //NOI18N - - // Set all here - this.setItemId(id); - this.setTitle(title); - this.setPrice(price); - this.setCategoryId(categoryId); - this.setAvailable(available); - } -}